mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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: {
|
case mtpc_updateChatUserTyping: {
|
||||||
auto &d = update.c_updateChatUserTyping();
|
auto &d = update.c_updateChatUserTyping();
|
||||||
const auto history = [&]() -> History* {
|
const auto history = session().data().historyLoaded(
|
||||||
if (const auto chat = session().data().chatLoaded(d.vchat_id().v)) {
|
peerFromChat(d.vchat_id()));
|
||||||
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 user = (d.vuser_id().v == session().userId())
|
const auto user = (d.vuser_id().v == session().userId())
|
||||||
? nullptr
|
? nullptr
|
||||||
: session().data().userLoaded(d.vuser_id().v);
|
: session().data().userLoaded(d.vuser_id().v);
|
||||||
|
@ -1558,6 +1552,19 @@ void Updates::feedUpdate(const MTPUpdate &update) {
|
||||||
}
|
}
|
||||||
} break;
|
} 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: {
|
case mtpc_updateChatParticipants: {
|
||||||
session().data().applyUpdate(update.c_updateChatParticipants());
|
session().data().applyUpdate(update.c_updateChatParticipants());
|
||||||
} break;
|
} break;
|
||||||
|
|
Loading…
Add table
Reference in a new issue