Improve logging and fix on_topic_changed.
This commit is contained in:
parent
e7d6a982fa
commit
2ca4672a98
@ -13328,8 +13328,8 @@ std::pair<DialogId, unique_ptr<MessagesManager::Message>> MessagesManager::creat
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (message->saved_messages_topic_id.is_valid()) {
|
if (message->saved_messages_topic_id.is_valid()) {
|
||||||
LOG(ERROR) << "Receive Saved Messages topic " << message_info.saved_messages_topic_id << " for " << message_id
|
LOG(ERROR) << "Receive Saved Messages " << message_info.saved_messages_topic_id << " for " << message_id << " in "
|
||||||
<< " in " << dialog_id;
|
<< dialog_id;
|
||||||
message->saved_messages_topic_id = SavedMessagesTopicId();
|
message->saved_messages_topic_id = SavedMessagesTopicId();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -381,7 +381,7 @@ void SavedMessagesManager::do_set_topic_last_message_id(SavedMessagesTopic *topi
|
|||||||
}
|
}
|
||||||
|
|
||||||
CHECK(last_message_id == MessageId() || last_message_id.is_valid());
|
CHECK(last_message_id == MessageId() || last_message_id.is_valid());
|
||||||
LOG(INFO) << "Set last message in topic " << topic->saved_messages_topic_id_ << " to " << last_message_id;
|
LOG(INFO) << "Set last message in " << topic->saved_messages_topic_id_ << " to " << last_message_id;
|
||||||
topic->last_message_id_ = last_message_id;
|
topic->last_message_id_ = last_message_id;
|
||||||
topic->last_message_date_ = last_message_date;
|
topic->last_message_date_ = last_message_date;
|
||||||
topic->is_changed_ = true;
|
topic->is_changed_ = true;
|
||||||
@ -415,10 +415,11 @@ void SavedMessagesManager::on_topic_draft_message_updated(SavedMessagesTopicId s
|
|||||||
int32 draft_message_date) {
|
int32 draft_message_date) {
|
||||||
auto *topic = get_topic(saved_messages_topic_id);
|
auto *topic = get_topic(saved_messages_topic_id);
|
||||||
if (topic == nullptr) {
|
if (topic == nullptr) {
|
||||||
|
LOG(INFO) << "Updated draft in unknown " << saved_messages_topic_id;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG(INFO) << "Set draft message date in topic " << topic->saved_messages_topic_id_ << " to " << draft_message_date;
|
LOG(INFO) << "Set draft message date in " << topic->saved_messages_topic_id_ << " to " << draft_message_date;
|
||||||
topic->draft_message_date_ = draft_message_date;
|
topic->draft_message_date_ = draft_message_date;
|
||||||
topic->is_changed_ = true;
|
topic->is_changed_ = true;
|
||||||
|
|
||||||
@ -442,6 +443,7 @@ void SavedMessagesManager::on_topic_changed(SavedMessagesTopic *topic, const cha
|
|||||||
if (!topic->is_changed_) {
|
if (!topic->is_changed_) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
topic->is_changed_ = false;
|
||||||
|
|
||||||
if (topic->private_order_ != 0) {
|
if (topic->private_order_ != 0) {
|
||||||
bool is_deleted = topic_list_.ordered_topics_.erase({topic->private_order_, topic->saved_messages_topic_id_}) > 0;
|
bool is_deleted = topic_list_.ordered_topics_.erase({topic->private_order_, topic->saved_messages_topic_id_}) > 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user