MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / handleSendActionUpdate

Method handleSendActionUpdate

Telegram/SourceFiles/api/api_updates.cpp:1082–1125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1080}
1081
1082void Updates::handleSendActionUpdate(
1083 PeerId peerId,
1084 MsgId rootId,
1085 PeerId fromId,
1086 const MTPSendMessageAction &action) {
1087 const auto history = session().data().historyLoaded(peerId);
1088 if (!history) {
1089 return;
1090 }
1091 const auto peer = history->peer;
1092 const auto from = (fromId == session().userPeerId())
1093 ? session().user().get()
1094 : session().data().peerLoaded(fromId);
1095 const auto when = requestingDifference()
1096 ? 0
1097 : base::unixtime::now();
1098 if (action.type() == mtpc_speakingInGroupCallAction) {
1099 handleSpeakingInCall(peer, fromId, from);
1100 }
1101 if (!from || !from->isUser() || from->isSelf()) {
1102 return;
1103 } else if (action.type() == mtpc_sendMessageEmojiInteraction) {
1104 handleEmojiInteraction(peer, action.c_sendMessageEmojiInteraction());
1105 return;
1106 } else if (action.type() == mtpc_sendMessageEmojiInteractionSeen) {
1107 const auto &data = action.c_sendMessageEmojiInteractionSeen();
1108 handleEmojiInteraction(peer, qs(data.vemoticon()));
1109 return;
1110 } else if (action.type() == mtpc_sendMessageTextDraftAction) {
1111 const auto &data = action.c_sendMessageTextDraftAction();
1112 history->streamedDrafts().apply(rootId, fromId, when, data);
1113 return;
1114 } else if (action.type() == mtpc_sendMessageRichMessageDraftAction) {
1115 const auto &data = action.c_sendMessageRichMessageDraftAction();
1116 history->streamedDrafts().apply(rootId, fromId, when, data);
1117 return;
1118 }
1119 session().data().sendActionManager().registerFor(
1120 history,
1121 rootId,
1122 from->asUser(),
1123 action,
1124 when);
1125}
1126
1127void Updates::handleEmojiInteraction(
1128 not_null<PeerData*> peer,

Callers

nothing calls this directly

Calls 13

qsFunction · 0.85
userPeerIdMethod · 0.80
isSelfMethod · 0.80
registerForMethod · 0.80
asUserMethod · 0.80
historyLoadedMethod · 0.45
dataMethod · 0.45
getMethod · 0.45
userMethod · 0.45
peerLoadedMethod · 0.45
typeMethod · 0.45
isUserMethod · 0.45

Tested by

no test coverage detected