Get and send messages

This commit is contained in:
Pedro Lopez
2019-02-17 04:18:16 -04:00
parent bcbd16f196
commit c166e24ea5
6 changed files with 100 additions and 3 deletions

View File

@@ -47,4 +47,21 @@ exports.ExposeStore = () => {
setTimeout(function () {
init();
}, 5000);
}
exports.MarkAllRead = () => {
let Chats = Store.Chat.models;
for (chatIndex in Chats) {
if (isNaN(chatIndex)) {
continue;
}
let chat = Chats[chatIndex];
if (chat.unreadCount > 0) {
chat.markSeen();
Store.Wap.sendConversationSeen(chat.id, chat.getLastMsgKeyForAction(), chat.unreadCount - chat.pendingSeenCount);
}
}
}