diff options
author | George Hazan <george.hazan@gmail.com> | 2023-10-03 11:41:51 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2023-10-03 11:42:45 +0300 |
commit | 673577296fc06f446946d5f651bb33547399e25c (patch) | |
tree | da321f73c15780d1bf38ebcf42cb3039d8705cea /protocols/Telegram/src | |
parent | 94d491fae2ce798d1c2e9bfd699249f636d0f47b (diff) |
Telegram: support for active reactions' list
Diffstat (limited to 'protocols/Telegram/src')
-rw-r--r-- | protocols/Telegram/src/proto.h | 2 | ||||
-rw-r--r-- | protocols/Telegram/src/server.cpp | 14 |
2 files changed, 16 insertions, 0 deletions
diff --git a/protocols/Telegram/src/proto.h b/protocols/Telegram/src/proto.h index a4bfc440d2..dd2e1263d3 100644 --- a/protocols/Telegram/src/proto.h +++ b/protocols/Telegram/src/proto.h @@ -202,6 +202,7 @@ class CTelegramProto : public PROTO<CTelegramProto> bool m_bAuthorized, m_bTerminated, m_bUnregister = false, m_bSmileyAdd = false; int32_t m_iClientId, m_iQueryId; + CMStringA m_defaultEmoji; OBJLIST<TG_OWN_MESSAGE> m_arOwnMsg; OBJLIST<TG_REQUEST_BASE> m_arRequests; @@ -245,6 +246,7 @@ class CTelegramProto : public PROTO<CTelegramProto> void ProcessChatPosition(TD::updateChatPosition *pObj); void ProcessChatReactions(TD::updateChatAvailableReactions *); void ProcessConnectionState(TD::updateConnectionState *pObj); + void ProcessActiveEmoji(TD::updateActiveEmojiReactions *pObj); void ProcessDeleteMessage(TD::updateDeleteMessages *pObj); void ProcessFile(TD::updateFile *pObj); void ProcessGroups(TD::updateChatFolders *pObj); diff --git a/protocols/Telegram/src/server.cpp b/protocols/Telegram/src/server.cpp index 403d2f390c..d33a605ba9 100644 --- a/protocols/Telegram/src/server.cpp +++ b/protocols/Telegram/src/server.cpp @@ -137,6 +137,10 @@ void CTelegramProto::ProcessResponse(td::ClientManager::Response response) }
switch (response.object->get_id()) {
+ case TD::updateActiveEmojiReactions::ID:
+ ProcessActiveEmoji((TD::updateActiveEmojiReactions *)response.object.get());
+ break;
+
case TD::updateAuthorizationState::ID:
ProcessAuth((TD::updateAuthorizationState *)response.object.get());
break;
@@ -580,6 +584,16 @@ void CTelegramProto::ProcessConnectionState(TD::updateConnectionState *pObj) }
}
+void CTelegramProto::ProcessActiveEmoji(TD::updateActiveEmojiReactions *pObj)
+{
+ m_defaultEmoji.Empty();
+
+ for (auto &it : pObj->emojis_)
+ m_defaultEmoji.AppendFormat("%s ", it.c_str());
+
+ m_defaultEmoji.TrimRight();
+}
+
void CTelegramProto::ProcessDeleteMessage(TD::updateDeleteMessages *pObj)
{
if (!pObj->is_permanent_)
|