From fe6c61f2eae0e7669f1894b8a261463516901920 Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 15 Dec 2021 20:36:23 +0300 Subject: [PATCH] Workaround bogus C4753 MSVC warning. --- td/telegram/ContactsManager.cpp | 3 ++- td/telegram/MessagesManager.cpp | 9 ++++----- td/telegram/MessagesManager.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/td/telegram/ContactsManager.cpp b/td/telegram/ContactsManager.cpp index 040e9390d..5579d20e4 100644 --- a/td/telegram/ContactsManager.cpp +++ b/td/telegram/ContactsManager.cpp @@ -6685,7 +6685,8 @@ void ContactsManager::report_channel_spam(ChannelId channel_id, const vectormessages_manager_->get_message_sender({DialogId(channel_id), message_id}); + auto current_sender_dialog_id = + td_->messages_manager_->get_dialog_message_sender({DialogId(channel_id), message_id}); if (!current_sender_dialog_id.is_valid()) { continue; } diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 46949382e..db5999ede 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -10912,9 +10912,8 @@ void MessagesManager::delete_dialog_messages_by_sender(DialogId dialog_id, Dialo } vector message_ids; - find_messages(d->messages.get(), message_ids, [sender_dialog_id](const Message *m) { - return sender_dialog_id == MessagesManager::get_message_sender(m); - }); + find_messages(d->messages.get(), message_ids, + [sender_dialog_id](const Message *m) { return sender_dialog_id == get_message_sender(m); }); vector deleted_message_ids; bool need_update_dialog_pos = false; @@ -17053,8 +17052,8 @@ void MessagesManager::on_get_blocked_dialogs(int32 offset, int32 limit, int32 to promise.set_value(td_api::make_object(total_count, std::move(senders))); } -DialogId MessagesManager::get_message_sender(FullMessageId full_message_id) { - const auto *m = get_message_force(full_message_id, "get_message_sender"); +DialogId MessagesManager::get_dialog_message_sender(FullMessageId full_message_id) { + const auto *m = get_message_force(full_message_id, "get_dialog_message_sender"); if (m == nullptr) { return DialogId(); } diff --git a/td/telegram/MessagesManager.h b/td/telegram/MessagesManager.h index 837622364..66c3f23b9 100644 --- a/td/telegram/MessagesManager.h +++ b/td/telegram/MessagesManager.h @@ -567,7 +567,7 @@ class MessagesManager final : public Actor { bool can_get_message_statistics(FullMessageId full_message_id); - DialogId get_message_sender(FullMessageId full_message_id); + DialogId get_dialog_message_sender(FullMessageId full_message_id); bool have_message_force(FullMessageId full_message_id, const char *source);