Don't set explicitly source.is_outgoing for messages forwarded from the user.

This commit is contained in:
levlam 2024-01-25 18:01:51 +03:00
parent db1644bb13
commit b97773457b
2 changed files with 9 additions and 6 deletions

View File

@ -107,14 +107,17 @@ StringBuilder &operator<<(StringBuilder &string_builder, const LastForwardedMess
string_builder << " forwarded from "
<< MessageFullId(last_message_info.dialog_id_, last_message_info.message_id_);
}
if (last_message_info.sender_dialog_id_ != DialogId() || !last_message_info.sender_name_.empty()) {
string_builder << " sent by ";
if (last_message_info.sender_dialog_id_ != DialogId() || !last_message_info.sender_name_.empty() ||
last_message_info.is_outgoing_) {
string_builder << " sent by";
if (last_message_info.sender_dialog_id_.is_valid()) {
string_builder << last_message_info.sender_dialog_id_;
string_builder << ' ' << last_message_info.sender_dialog_id_;
}
if (!last_message_info.sender_name_.empty()) {
if (last_message_info.sender_dialog_id_.is_valid()) {
string_builder << '/';
} else {
string_builder << ' ';
}
string_builder << '"' << last_message_info.sender_name_ << '"';
}
@ -258,7 +261,7 @@ StringBuilder &operator<<(StringBuilder &string_builder, const MessageForwardInf
string_builder << ", psa_type " << forward_info.psa_type_;
}
if (!forward_info.last_message_info_.is_empty()) {
string_builder << ", from " << forward_info.last_message_info_;
string_builder << ", " << forward_info.last_message_info_;
}
return string_builder << " at " << forward_info.date_ << ']';
}

View File

@ -26714,8 +26714,8 @@ unique_ptr<MessageForwardInfo> MessagesManager::create_message_forward_info(Dial
if (!origin.is_empty()) {
last_message_info.hide_sender_if_needed(td_);
if (last_message_info.get_dialog_id() != DialogId()) {
last_message_info =
LastForwardedMessageInfo(from_dialog_id, m->message_id, DialogId(), string(), 0, m->is_outgoing);
last_message_info = LastForwardedMessageInfo(from_dialog_id, m->message_id, DialogId(), string(), 0,
m->is_outgoing && origin.get_sender() != my_dialog_id);
}
return td::make_unique<MessageForwardInfo>(std::move(origin), m->date, std::move(last_message_info), "", false);
}