From dc3929fede9cf9fbd422d7d1c7f6a419e37d0b67 Mon Sep 17 00:00:00 2001 From: levlam Date: Sun, 7 Jan 2024 01:08:41 +0300 Subject: [PATCH] Remove is_unsent_animated_emoji_click proxy function. --- td/telegram/DialogActionManager.cpp | 13 +++++++++---- td/telegram/MessageContent.cpp | 10 ---------- td/telegram/MessageContent.h | 3 --- 3 files changed, 9 insertions(+), 17 deletions(-) diff --git a/td/telegram/DialogActionManager.cpp b/td/telegram/DialogActionManager.cpp index 014cec8a5..9d67139dd 100644 --- a/td/telegram/DialogActionManager.cpp +++ b/td/telegram/DialogActionManager.cpp @@ -10,15 +10,16 @@ #include "td/telegram/ContactsManager.h" #include "td/telegram/DialogManager.h" #include "td/telegram/Global.h" -#include "td/telegram/MessageContent.h" #include "td/telegram/MessageSender.h" #include "td/telegram/MessagesManager.h" #include "td/telegram/net/NetQuery.h" #include "td/telegram/SecretChatsManager.h" +#include "td/telegram/StickersManager.h" #include "td/telegram/Td.h" #include "td/telegram/telegram_api.h" #include "td/utils/buffer.h" +#include "td/utils/emoji.h" #include "td/utils/logging.h" #include "td/utils/Time.h" @@ -151,9 +152,13 @@ void DialogActionManager::on_dialog_action(DialogId dialog_id, MessageId top_thr } } - if (is_unsent_animated_emoji_click(td_, dialog_id, action)) { - LOG(DEBUG) << "Ignore unsent " << action; - return; + { + auto emoji = action.get_watching_animations_emoji(); + if (!emoji.empty() && + !td_->stickers_manager_->is_sent_animated_emoji_click(dialog_id, remove_emoji_modifiers(emoji))) { + LOG(DEBUG) << "Ignore unsent " << action; + return; + } } if (!td_->messages_manager_->have_dialog(dialog_id)) { diff --git a/td/telegram/MessageContent.cpp b/td/telegram/MessageContent.cpp index aa9d73bdc..6eca1c2e1 100644 --- a/td/telegram/MessageContent.cpp +++ b/td/telegram/MessageContent.cpp @@ -21,7 +21,6 @@ #include "td/telegram/ContactsManager.h" #include "td/telegram/CustomEmojiId.h" #include "td/telegram/Dependencies.h" -#include "td/telegram/DialogAction.h" #include "td/telegram/DialogManager.h" #include "td/telegram/DialogParticipant.h" #include "td/telegram/Dimensions.h" @@ -7960,15 +7959,6 @@ void move_message_content_sticker_set_to_top(Td *td, const MessageContent *conte } } -bool is_unsent_animated_emoji_click(Td *td, DialogId dialog_id, const DialogAction &action) { - auto emoji = action.get_watching_animations_emoji(); - if (emoji.empty()) { - // not a WatchingAnimations action - return false; - } - return !td->stickers_manager_->is_sent_animated_emoji_click(dialog_id, remove_emoji_modifiers(emoji)); -} - void init_stickers_manager(Td *td) { td->stickers_manager_->init(); } diff --git a/td/telegram/MessageContent.h b/td/telegram/MessageContent.h index 8f46178c4..f930fb90c 100644 --- a/td/telegram/MessageContent.h +++ b/td/telegram/MessageContent.h @@ -40,7 +40,6 @@ namespace td { class Dependencies; -class DialogAction; class Game; class MultiPromiseActor; struct Photo; @@ -302,8 +301,6 @@ void on_sent_message_content(Td *td, const MessageContent *content); void move_message_content_sticker_set_to_top(Td *td, const MessageContent *content); -bool is_unsent_animated_emoji_click(Td *td, DialogId dialog_id, const DialogAction &action); - void init_stickers_manager(Td *td); void on_dialog_used(TopDialogCategory category, DialogId dialog_id, int32 date);