From 0725135de888034c2cbf499c215f37c40edd602d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 18 May 2024 14:45:04 +0300 Subject: no, we shall clear reactions if there aren't any --- protocols/Telegram/src/server.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'protocols') diff --git a/protocols/Telegram/src/server.cpp b/protocols/Telegram/src/server.cpp index 87fc449e87..5b82721765 100644 --- a/protocols/Telegram/src/server.cpp +++ b/protocols/Telegram/src/server.cpp @@ -983,11 +983,6 @@ void CTelegramProto::ProcessMessageContent(TD::updateMessageContent *pObj) void CTelegramProto::ProcessMessageReactions(TD::updateMessageInteractionInfo *pObj) { - if (pObj->interaction_info_ == nullptr) { - debugLogA("no reactions to process"); - return; - } - auto *pUser = FindChat(pObj->chat_id_); if (pUser == nullptr) { debugLogA("message from unknown chat/user, ignored"); @@ -1002,12 +997,14 @@ void CTelegramProto::ProcessMessageReactions(TD::updateMessageInteractionInfo *p } JSONNode reactions; reactions.set_name("r"); - for (auto &it : pObj->interaction_info_->reactions_) { - if (it->type_->get_id() != TD::reactionTypeEmoji::ID) - continue; + if (pObj->interaction_info_) { + for (auto &it : pObj->interaction_info_->reactions_) { + if (it->type_->get_id() != TD::reactionTypeEmoji::ID) + continue; - auto *pEmoji = (TD::reactionTypeEmoji *)it->type_.get(); - reactions << INT_PARAM(pEmoji->emoji_.c_str(), it->total_count_); + auto *pEmoji = (TD::reactionTypeEmoji *)it->type_.get(); + reactions << INT_PARAM(pEmoji->emoji_.c_str(), it->total_count_); + } } auto &json = dbei.setJson(); -- cgit v1.2.3