Add MessageOrigin::get_sender_name().

This commit is contained in:
levlam 2023-10-09 21:10:09 +03:00
parent 9e82513802
commit ae6e8b5a91
2 changed files with 6 additions and 2 deletions

View File

@ -51,6 +51,10 @@ struct MessageOrigin {
MessageFullId get_message_full_id() const;
const string &get_sender_name() const {
return sender_name_;
}
bool is_channel_post() const {
return message_id_.is_valid();
}

View File

@ -27453,7 +27453,7 @@ td_api::object_ptr<td_api::messageImportInfo> MessagesManager::get_message_impor
if (forward_info == nullptr || !forward_info->is_imported) {
return nullptr;
}
return td_api::make_object<td_api::messageImportInfo>(forward_info->origin.sender_name_, forward_info->date);
return td_api::make_object<td_api::messageImportInfo>(forward_info->origin.get_sender_name(), forward_info->date);
}
Result<unique_ptr<ReplyMarkup>> MessagesManager::get_dialog_reply_markup(
@ -35592,7 +35592,7 @@ bool MessagesManager::update_message(Dialog *d, Message *old_message, unique_ptr
if (old_message->forward_info->is_imported || new_message->forward_info->is_imported) {
return true;
}
if (!is_scheduled && !message_id.is_yet_unsent() && !old_message->forward_info->is_imported) {
if (!is_scheduled && !message_id.is_yet_unsent()) {
return true;
}
return !is_forward_info_sender_hidden(new_message->forward_info.get()) &&