mirror of
https://github.com/cheveguerra/whatsapp-web.js.git
synced 2026-04-18 03:29:14 +00:00
Get and send messages
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user