Always treat pins as mentions.

GitOrigin-RevId: 8a573c3b67c198e246d81a1ff64b5a702b45fac3
This commit is contained in:
levlam 2019-09-30 23:29:56 +03:00
parent fff1b6d4b5
commit 5f94662807

View File

@ -10034,8 +10034,8 @@ std::pair<DialogId, unique_ptr<MessagesManager::Message>> MessagesManager::creat
}
int32 ttl = message_info.ttl;
bool is_content_secret =
is_secret_message_content(ttl, message_info.content->get_type()); // should be calculated before TTL is adjusted
auto content_type = message_info.content->get_type();
bool is_content_secret = is_secret_message_content(ttl, content_type); // should be calculated before TTL is adjusted
if (ttl < 0) {
LOG(ERROR) << "Wrong ttl = " << ttl << " received in " << message_id << " in " << dialog_id;
ttl = 0;
@ -10068,7 +10068,8 @@ std::pair<DialogId, unique_ptr<MessagesManager::Message>> MessagesManager::creat
message->is_outgoing = is_outgoing;
message->is_channel_post = is_channel_post;
message->contains_mention =
!is_outgoing && dialog_type != DialogType::User && (flags & MESSAGE_FLAG_HAS_MENTION) != 0;
!is_outgoing && dialog_type != DialogType::User &&
((flags & MESSAGE_FLAG_HAS_MENTION) != 0 || content_type == MessageContentType::PinMessage);
message->contains_unread_mention =
message_id.is_server() && message->contains_mention && (flags & MESSAGE_FLAG_HAS_UNREAD_CONTENT) != 0 &&
(dialog_type == DialogType::Chat || (dialog_type == DialogType::Channel && !is_broadcast_channel(dialog_id)));
@ -10080,7 +10081,6 @@ std::pair<DialogId, unique_ptr<MessagesManager::Message>> MessagesManager::creat
message->reply_markup = get_reply_markup(std::move(message_info.reply_markup), td_->auth_manager_->is_bot(), false,
message->contains_mention || dialog_id.get_type() == DialogType::User);
auto content_type = message->content->get_type();
if (content_type == MessageContentType::ExpiredPhoto || content_type == MessageContentType::ExpiredVideo) {
CHECK(message->ttl == 0); // ttl is ignored/set to 0 if the message has already been expired
if (message->reply_markup != nullptr) {