mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-19 07:37:11 +02:00
Handle new typing update in channels.
This commit is contained in:
parent
a287dec242
commit
f53f934001
1 changed files with 15 additions and 8 deletions
|
@ -1541,14 +1541,8 @@ void Updates::feedUpdate(const MTPUpdate &update) {
|
|||
|
||||
case mtpc_updateChatUserTyping: {
|
||||
auto &d = update.c_updateChatUserTyping();
|
||||
const auto history = [&]() -> History* {
|
||||
if (const auto chat = session().data().chatLoaded(d.vchat_id().v)) {
|
||||
return session().data().historyLoaded(chat->id);
|
||||
} else if (const auto channel = session().data().channelLoaded(d.vchat_id().v)) {
|
||||
return session().data().historyLoaded(channel->id);
|
||||
}
|
||||
return nullptr;
|
||||
}();
|
||||
const auto history = session().data().historyLoaded(
|
||||
peerFromChat(d.vchat_id()));
|
||||
const auto user = (d.vuser_id().v == session().userId())
|
||||
? nullptr
|
||||
: session().data().userLoaded(d.vuser_id().v);
|
||||
|
@ -1558,6 +1552,19 @@ void Updates::feedUpdate(const MTPUpdate &update) {
|
|||
}
|
||||
} break;
|
||||
|
||||
case mtpc_updateChannelUserTyping: {
|
||||
const auto &d = update.c_updateChannelUserTyping();
|
||||
const auto history = session().data().historyLoaded(
|
||||
peerFromChannel(d.vchannel_id()));
|
||||
const auto user = (d.vuser_id().v == session().userId())
|
||||
? nullptr
|
||||
: session().data().userLoaded(d.vuser_id().v);
|
||||
if (history && user && !d.vtop_msg_id().value_or_empty()) {
|
||||
const auto when = requestingDifference() ? 0 : base::unixtime::now();
|
||||
session().data().registerSendAction(history, user, d.vaction(), when);
|
||||
}
|
||||
} break;
|
||||
|
||||
case mtpc_updateChatParticipants: {
|
||||
session().data().applyUpdate(update.c_updateChatParticipants());
|
||||
} break;
|
||||
|
|
Loading…
Add table
Reference in a new issue