Fix attach menu icons initialization.

This commit is contained in:
levlam 2022-04-11 12:55:43 +03:00
parent 9fd72e86d0
commit 32ed470417

View File

@ -598,7 +598,7 @@ Result<AttachMenuManager::AttachMenuBot> AttachMenuManager::get_attach_menu_bot(
auto parsed_document =
td_->documents_manager_->on_get_document(move_tl_object_as<telegram_api::document>(icon->icon_), DialogId());
if (parsed_document.type != expected_document_type) {
LOG(ERROR) << "Receive wrong attach menu bot icon for " << user_id;
LOG(ERROR) << "Receive wrong attach menu bot icon \"" << name << "\" for " << user_id;
continue;
}
bool expect_colors = false;
@ -653,6 +653,7 @@ Result<AttachMenuManager::AttachMenuBot> AttachMenuManager::get_attach_menu_bot(
default:
UNREACHABLE();
}
}
if (attach_menu_bot.icon_color_.light_color_ == -1 || attach_menu_bot.icon_color_.dark_color_ == -1) {
LOG(ERROR) << "Receive wrong icon_color for " << user_id;
attach_menu_bot.icon_color_ = AttachMenuBotColor();
@ -662,7 +663,6 @@ Result<AttachMenuManager::AttachMenuBot> AttachMenuManager::get_attach_menu_bot(
attach_menu_bot.name_color_ = AttachMenuBotColor();
}
}
}
} else {
if (!icon->colors_.empty()) {
LOG(ERROR) << "Have unexpected colors for attach menu bot icon for " << user_id << " with name " << name;