|
|
@ -190,7 +190,8 @@ define([
|
|
|
|
if (data.txid !== txid) { return; }
|
|
|
|
if (data.txid !== txid) { return; }
|
|
|
|
if (data.complete) {
|
|
|
|
if (data.complete) {
|
|
|
|
onHistory = function () {};
|
|
|
|
onHistory = function () {};
|
|
|
|
cb(null, messages);
|
|
|
|
var end = messages.length < count;
|
|
|
|
|
|
|
|
cb(null, messages, end);
|
|
|
|
historyState = false;
|
|
|
|
historyState = false;
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -207,12 +208,13 @@ define([
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
mailbox.getNotificationsHistory = function (type, count, lastKnownHash, cb) {
|
|
|
|
mailbox.getNotificationsHistory = function (type, count, lastKnownHash, cb) {
|
|
|
|
mailbox.getMoreHistory(type, count, lastKnownHash, function (err, messages) {
|
|
|
|
mailbox.getMoreHistory(type, count, lastKnownHash, function (err, messages, end) {
|
|
|
|
|
|
|
|
if (!Array.isArray(messages)) { return void cb(err); }
|
|
|
|
messages.forEach(function (data) {
|
|
|
|
messages.forEach(function (data) {
|
|
|
|
data.content.archived = true;
|
|
|
|
data.content.archived = true;
|
|
|
|
Notifications.add(Common, data);
|
|
|
|
Notifications.add(Common, data);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
cb(err, messages);
|
|
|
|
cb(err, messages, end);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|