Remove is_unsent_animated_emoji_click proxy function.

This commit is contained in:
levlam 2024-01-07 01:08:41 +03:00
parent b684039566
commit dc3929fede
3 changed files with 9 additions and 17 deletions

View File

@ -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)) {

View File

@ -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();
}

View File

@ -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);