Minor improvements of process_update.

This commit is contained in:
levlam 2020-12-25 03:14:49 +03:00
parent a8377db05d
commit ebc4e57da7

View File

@ -7201,11 +7201,12 @@ void MessagesManager::process_update(tl_object_ptr<telegram_api::Update> &&updat
case dummyUpdate::ID: case dummyUpdate::ID:
LOG(INFO) << "Process dummyUpdate"; LOG(INFO) << "Process dummyUpdate";
break; break;
case telegram_api::updateNewMessage::ID: case telegram_api::updateNewMessage::ID: {
auto update_new_message = move_tl_object_as<telegram_api::updateNewMessage>(update);
LOG(INFO) << "Process updateNewMessage"; LOG(INFO) << "Process updateNewMessage";
on_get_message(std::move(move_tl_object_as<telegram_api::updateNewMessage>(update)->message_), true, false, false, on_get_message(std::move(update_new_message->message_), true, false, false, true, true, "updateNewMessage");
true, true, "updateNewMessage");
break; break;
}
case updateSentMessage::ID: { case updateSentMessage::ID: {
auto send_message_success_update = move_tl_object_as<updateSentMessage>(update); auto send_message_success_update = move_tl_object_as<updateSentMessage>(update);
LOG(INFO) << "Process updateSentMessage " << send_message_success_update->random_id_; LOG(INFO) << "Process updateSentMessage " << send_message_success_update->random_id_;
@ -7222,9 +7223,9 @@ void MessagesManager::process_update(tl_object_ptr<telegram_api::Update> &&updat
break; break;
} }
case telegram_api::updateEditMessage::ID: { case telegram_api::updateEditMessage::ID: {
auto full_message_id = auto update_edit_message = move_tl_object_as<telegram_api::updateEditMessage>(update);
on_get_message(std::move(move_tl_object_as<telegram_api::updateEditMessage>(update)->message_), false, false, auto full_message_id = on_get_message(std::move(update_edit_message->message_), false, false, false, false, false,
false, false, false, "updateEditMessage"); "updateEditMessage");
LOG(INFO) << "Process updateEditMessage"; LOG(INFO) << "Process updateEditMessage";
on_message_edited(full_message_id); on_message_edited(full_message_id);
break; break;
@ -7287,11 +7288,13 @@ void MessagesManager::process_channel_update(tl_object_ptr<telegram_api::Update>
send_message_success_update->date_, FileId(), "process updateSentChannelMessage"); send_message_success_update->date_, FileId(), "process updateSentChannelMessage");
break; break;
} }
case telegram_api::updateNewChannelMessage::ID: case telegram_api::updateNewChannelMessage::ID: {
auto update_new_channel_message = move_tl_object_as<telegram_api::updateNewChannelMessage>(update);
LOG(INFO) << "Process updateNewChannelMessage"; LOG(INFO) << "Process updateNewChannelMessage";
on_get_message(std::move(move_tl_object_as<telegram_api::updateNewChannelMessage>(update)->message_), true, true, on_get_message(std::move(update_new_channel_message->message_), true, true, false, true, true,
false, true, true, "updateNewChannelMessage"); "updateNewChannelMessage");
break; break;
}
case telegram_api::updateDeleteChannelMessages::ID: { case telegram_api::updateDeleteChannelMessages::ID: {
auto delete_channel_messages_update = move_tl_object_as<telegram_api::updateDeleteChannelMessages>(update); auto delete_channel_messages_update = move_tl_object_as<telegram_api::updateDeleteChannelMessages>(update);
LOG(INFO) << "Process updateDeleteChannelMessages"; LOG(INFO) << "Process updateDeleteChannelMessages";
@ -7311,10 +7314,10 @@ void MessagesManager::process_channel_update(tl_object_ptr<telegram_api::Update>
break; break;
} }
case telegram_api::updateEditChannelMessage::ID: { case telegram_api::updateEditChannelMessage::ID: {
auto update_edit_channel_message = move_tl_object_as<telegram_api::updateEditChannelMessage>(update);
LOG(INFO) << "Process updateEditChannelMessage"; LOG(INFO) << "Process updateEditChannelMessage";
auto full_message_id = auto full_message_id = on_get_message(std::move(update_edit_channel_message->message_), false, true, false, false,
on_get_message(std::move(move_tl_object_as<telegram_api::updateEditChannelMessage>(update)->message_), false, false, "updateEditChannelMessage");
true, false, false, false, "updateEditChannelMessage");
on_message_edited(full_message_id); on_message_edited(full_message_id);
break; break;
} }