Do not iniitalize stickers manager before authorization.

GitOrigin-RevId: 497a09aeb0c7f8cadb00902d1ceeceaa144c0885
This commit is contained in:
levlam 2020-04-17 16:12:12 +03:00
parent 6225237cb9
commit b343e148e8
3 changed files with 12 additions and 0 deletions

View File

@ -20,6 +20,7 @@
#include "td/telegram/net/NetQueryDispatcher.h"
#include "td/telegram/NotificationManager.h"
#include "td/telegram/PasswordManager.h"
#include "td/telegram/StickersManager.h"
#include "td/telegram/Td.h"
#include "td/telegram/TdDb.h"
#include "td/telegram/TopDialogManager.h"
@ -727,6 +728,7 @@ void AuthManager::on_get_authorization(tl_object_ptr<telegram_api::auth_Authoriz
G()->shared_config().set_option_integer("session_count", auth->tmp_sessions_);
}
td->notification_manager_->init();
td->stickers_manager_->init();
send_closure(td->top_dialog_manager_, &TopDialogManager::do_start_up);
td->updates_manager_->get_difference("on_get_authorization");
td->on_online_updated(false, true);

View File

@ -1111,6 +1111,14 @@ StickersManager::StickersManager(Td *td, ActorShared<> parent) : td_(td), parent
}
void StickersManager::start_up() {
init();
}
void StickersManager::init() {
if (!td_->auth_manager_->is_authorized() || td_->auth_manager_->is_bot() || G()->close_flag()) {
return;
}
// add animated emoji sticker set
special_sticker_sets_[SpecialStickerSetType::AnimatedEmoji].type_ = "animated_emoji_sticker_set";
special_sticker_sets_[SpecialStickerSetType::AnimatedDice].type_ = "animated_dice_sticker_set";

View File

@ -44,6 +44,8 @@ class StickersManager : public Actor {
StickersManager(Td *td, ActorShared<> parent);
void init();
tl_object_ptr<td_api::sticker> get_sticker_object(FileId file_id) const;
tl_object_ptr<td_api::stickers> get_stickers_object(const vector<FileId> &sticker_ids) const;