| 1080 | } |
| 1081 | |
| 1082 | void 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 | |
| 1127 | void Updates::handleEmojiInteraction( |
| 1128 | not_null<PeerData*> peer, |
nothing calls this directly
no test coverage detected