Better forward_info changes logging.

GitOrigin-RevId: 49ba4447cbe7998e7c275377e545c2fe7e54b92a
This commit is contained in:
levlam 2019-01-08 22:48:43 +03:00
parent 42d59ba6b3
commit cccab2ba62
2 changed files with 11 additions and 8 deletions

View File

@ -21762,14 +21762,17 @@ void MessagesManager::update_message(Dialog *d, unique_ptr<Message> &old_message
old_message->forward_info->author_signature = new_message->forward_info->author_signature; old_message->forward_info->author_signature = new_message->forward_info->author_signature;
LOG_IF(ERROR, *old_message->forward_info != *new_message->forward_info) LOG_IF(ERROR, *old_message->forward_info != *new_message->forward_info)
<< message_id << " in " << dialog_id << " has changed forward info from " << *old_message->forward_info << message_id << " in " << dialog_id << " has changed forward info from " << *old_message->forward_info
<< " to " << *new_message->forward_info << ", really forwarded from " << old_message->debug_forward_from; << " to " << *new_message->forward_info << ", really forwarded from " << old_message->debug_forward_from
<< ", message content type is " << old_message->content->get_type() << '/'
<< new_message->content->get_type();
} }
old_message->forward_info = std::move(new_message->forward_info); old_message->forward_info = std::move(new_message->forward_info);
is_changed = true; is_changed = true;
} else { } else {
LOG(ERROR) << message_id << " in " << dialog_id << " sent by " << old_message->sender_user_id LOG(ERROR) << message_id << " in " << dialog_id << " sent by " << old_message->sender_user_id
<< " has lost forward info " << *old_message->forward_info << ", really forwarded from " << " has lost forward info " << *old_message->forward_info << ", really forwarded from "
<< old_message->debug_forward_from; << old_message->debug_forward_from << ", message content type is " << old_message->content->get_type()
<< '/' << new_message->content->get_type();
old_message->forward_info = nullptr; old_message->forward_info = nullptr;
is_changed = true; is_changed = true;
} }

View File

@ -3373,15 +3373,15 @@ class CliClient final : public Actor {
string mute_for; string mute_for;
string sound; string sound;
string show_previews; string show_preview;
std::tie(mute_for, settings) = split(settings, ','); std::tie(mute_for, settings) = split(settings, ',');
std::tie(sound, show_previews) = split(settings, ','); std::tie(sound, show_preview) = split(settings, ',');
send_request(make_tl_object<td_api::setChatNotificationSettings>( send_request(make_tl_object<td_api::setChatNotificationSettings>(
as_chat_id(chat_id), as_chat_id(chat_id),
make_tl_object<td_api::chatNotificationSettings>(mute_for.empty(), to_integer<int32>(mute_for), sound.empty(), make_tl_object<td_api::chatNotificationSettings>(mute_for.empty(), to_integer<int32>(mute_for), sound.empty(),
sound, show_previews.empty(), as_bool(show_previews)))); sound, show_preview.empty(), as_bool(show_preview))));
} else if (op == "ssns") { } else if (op == "ssns") {
string scope; string scope;
string settings; string settings;
@ -3390,14 +3390,14 @@ class CliClient final : public Actor {
string mute_for; string mute_for;
string sound; string sound;
string show_previews; string show_preview;
std::tie(mute_for, settings) = split(settings, ','); std::tie(mute_for, settings) = split(settings, ',');
std::tie(sound, show_previews) = split(settings, ','); std::tie(sound, show_preview) = split(settings, ',');
send_request(make_tl_object<td_api::setScopeNotificationSettings>( send_request(make_tl_object<td_api::setScopeNotificationSettings>(
get_notification_settings_scope(scope), make_tl_object<td_api::scopeNotificationSettings>( get_notification_settings_scope(scope), make_tl_object<td_api::scopeNotificationSettings>(
to_integer<int32>(mute_for), sound, as_bool(show_previews)))); to_integer<int32>(mute_for), sound, as_bool(show_preview))));
} else if (op == "rans") { } else if (op == "rans") {
send_request(make_tl_object<td_api::resetAllNotificationSettings>()); send_request(make_tl_object<td_api::resetAllNotificationSettings>());
} else if (op == "rn") { } else if (op == "rn") {