2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

unread loading by inboxReadBefore message id added

This commit is contained in:
John Preston
2015-09-08 16:34:22 +03:00
parent 54d5b6dd71
commit 8ff20d759b
7 changed files with 83 additions and 48 deletions

View File

@@ -3687,7 +3687,12 @@ void MainWidget::feedUpdate(const MTPUpdate &update) {
case mtpc_updateChatUserTyping: {
const MTPDupdateChatUserTyping &d(update.c_updateChatUserTyping());
History *history = App::historyLoaded(peerFromChat(d.vchat_id));
History *history = 0;
if (PeerData *chat = App::peerLoaded(peerFromChat(d.vchat_id.v))) {
history = App::historyLoaded(chat->id);
} else if (PeerData *channel = App::peerLoaded(peerFromChannel(d.vchat_id.v))) {
history = App::historyLoaded(channel->id);
}
UserData *user = (d.vuser_id.v == MTP::authedId()) ? 0 : App::userLoaded(d.vuser_id.v);
if (history && user) {
App::histories().regSendAction(history, user, d.vaction);