From 0531816c6fc4336268930ff2a96aec0fdae06111 Mon Sep 17 00:00:00 2001 From: levlam Date: Tue, 13 Aug 2024 00:29:01 +0300 Subject: [PATCH] Don't add author signature to posts on behalf of channel. --- td/telegram/MessagesManager.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index e04fd3605..e705caf16 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -23342,10 +23342,12 @@ unique_ptr MessagesManager::create_message_to_send( } if (is_channel_post && !is_scheduled && td_->chat_manager_->get_channel_sign_messages(dialog_id.get_channel_id())) { auto show_message_sender = td_->chat_manager_->get_channel_show_message_sender(dialog_id.get_channel_id()); - m->author_signature = m->sender_dialog_id == dialog_id || m->sender_dialog_id == DialogId() || - (m->has_explicit_sender && !show_message_sender) - ? td_->user_manager_->get_user_title(my_id) - : td_->dialog_manager_->get_dialog_title(m->sender_dialog_id); + if (m->sender_dialog_id != dialog_id || !m->has_explicit_sender) { + m->author_signature = m->sender_dialog_id == dialog_id || m->sender_dialog_id == DialogId() || + (m->has_explicit_sender && !show_message_sender) + ? td_->user_manager_->get_user_title(my_id) + : td_->dialog_manager_->get_dialog_title(m->sender_dialog_id); + } if (!show_message_sender) { m->sender_user_id = UserId(); m->sender_dialog_id = dialog_id;