Add "process_pinned_messages_as_mentions" option to allow keep previous behavior.
This commit is contained in:
parent
121fbe535f
commit
2a9393ff7a
@ -13061,6 +13061,10 @@ std::pair<DialogId, unique_ptr<MessagesManager::Message>> MessagesManager::creat
|
||||
is_pinned = false;
|
||||
}
|
||||
|
||||
bool has_mention =
|
||||
message_info.has_mention || (content_type == MessageContentType::PinMessage &&
|
||||
td_->option_manager_->get_option_boolean("process_pinned_messages_as_mentions"));
|
||||
|
||||
LOG(INFO) << "Receive " << message_id << " in " << dialog_id << " from " << sender_user_id << "/" << sender_dialog_id;
|
||||
|
||||
auto message = make_unique<Message>();
|
||||
@ -13083,8 +13087,8 @@ std::pair<DialogId, unique_ptr<MessagesManager::Message>> MessagesManager::creat
|
||||
message->author_signature = std::move(message_info.author_signature);
|
||||
message->is_outgoing = is_outgoing;
|
||||
message->is_channel_post = is_channel_post;
|
||||
message->contains_mention = !is_outgoing && dialog_type != DialogType::User && !is_expired &&
|
||||
message_info.has_mention && !td_->auth_manager_->is_bot();
|
||||
message->contains_mention =
|
||||
!is_outgoing && dialog_type != DialogType::User && !is_expired && has_mention && !td_->auth_manager_->is_bot();
|
||||
message->contains_unread_mention =
|
||||
!message_id.is_scheduled() && message_id.is_server() && message->contains_mention &&
|
||||
message_info.has_unread_content &&
|
||||
|
@ -884,6 +884,9 @@ void OptionManager::set_option(const string &name, td_api::object_ptr<td_api::Op
|
||||
send_closure(td_->state_manager_, &StateManager::on_network_updated);
|
||||
return;
|
||||
}
|
||||
if (set_boolean_option("process_pinned_messages_as_mentions")) {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 'r':
|
||||
// temporary option
|
||||
|
Loading…
x
Reference in New Issue
Block a user