1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-04-11 21:15:44 +02:00

Mark DMs as read when replying to them

This commit is contained in:
chylex 2018-08-17 07:02:22 +02:00
parent 2b8ca77c0d
commit b865074c32

View File

@ -1514,6 +1514,24 @@
});
}
//
// Block: Fix DMs not being marked as read when replying to them.
//
execSafe(function markRepliedDMsAsRead(){
throw 1 if !ensurePropertyExists(TD, "controller", "clients", "getClient");
throw 2 if !ensurePropertyExists(TD, "services", "Conversations", "prototype", "getConversation");
$(document).on("dataDmSent", function(e, data){
let client = TD.controller.clients.getClient(data.request.accountKey);
return if !client;
let conversation = client.conversations.getConversation(data.request.conversationId);
return if !conversation;
conversation.markAsRead();
});
});
//
// Block: Limit amount of loaded DMs to avoid massive lag from re-opening them several times.
//