Replace top_thread_message_id in unsupported messages.
This commit is contained in:
parent
e531ae2eb0
commit
848de33676
@ -36671,9 +36671,17 @@ bool MessagesManager::update_message(Dialog *d, Message *old_message, unique_ptr
|
|||||||
}
|
}
|
||||||
if (old_message->top_thread_message_id != new_message->top_thread_message_id) {
|
if (old_message->top_thread_message_id != new_message->top_thread_message_id) {
|
||||||
if ((new_message->top_thread_message_id == MessageId() || old_message->top_thread_message_id == MessageId()) &&
|
if ((new_message->top_thread_message_id == MessageId() || old_message->top_thread_message_id == MessageId()) &&
|
||||||
!is_message_in_dialog) {
|
(!is_message_in_dialog || replace_legacy)) {
|
||||||
LOG(DEBUG) << "Change message thread from " << old_message->top_thread_message_id << " to "
|
LOG(DEBUG) << "Change message thread from " << old_message->top_thread_message_id << " to "
|
||||||
<< new_message->top_thread_message_id;
|
<< new_message->top_thread_message_id;
|
||||||
|
if (is_message_in_dialog && old_message->is_topic_message) {
|
||||||
|
if (old_message->top_thread_message_id != MessageId()) {
|
||||||
|
td_->forum_topic_manager_->on_topic_message_count_changed(dialog_id, old_message->top_thread_message_id, -1);
|
||||||
|
}
|
||||||
|
if (new_message->top_thread_message_id != MessageId()) {
|
||||||
|
td_->forum_topic_manager_->on_topic_message_count_changed(dialog_id, new_message->top_thread_message_id, +1);
|
||||||
|
}
|
||||||
|
}
|
||||||
old_message->top_thread_message_id = new_message->top_thread_message_id;
|
old_message->top_thread_message_id = new_message->top_thread_message_id;
|
||||||
need_send_update = true;
|
need_send_update = true;
|
||||||
} else if (is_new_available) {
|
} else if (is_new_available) {
|
||||||
|
Loading…
Reference in New Issue
Block a user