2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-02 15:35:51 +00:00

Use serverside keywords for emoji suggestions.

This commit is contained in:
John Preston
2019-03-28 12:48:32 +04:00
parent 3cd9d4b5ec
commit 77fbf19a72
11 changed files with 752 additions and 133 deletions

View File

@@ -18,6 +18,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "core/sandbox.h"
#include "core/local_url_handlers.h"
#include "core/launcher.h"
#include "chat_helpers/emoji_keywords.h"
#include "storage/localstorage.h"
#include "platform/platform_specific.h"
#include "mainwindow.h"
@@ -83,6 +84,7 @@ Application::Application(not_null<Launcher*> launcher)
, _databases(std::make_unique<Storage::Databases>())
, _animationsManager(std::make_unique<Ui::Animations::Manager>())
, _langpack(std::make_unique<Lang::Instance>())
, _emojiKeywords(std::make_unique<ChatHelpers::EmojiKeywords>())
, _audio(std::make_unique<Media::Audio::Instance>())
, _logo(Window::LoadLogo())
, _logoNoMargin(Window::LoadLogoNoMargin()) {
@@ -93,6 +95,41 @@ Application::Application(not_null<Launcher*> launcher)
Instance = this;
}
Application::~Application() {
_window.reset();
_mediaView.reset();
// Some MTP requests can be cancelled from data clearing.
authSessionDestroy();
// The langpack manager should be destroyed before MTProto instance,
// because it is MTP::Sender and it may have pending requests.
_langCloudManager.reset();
_mtproto.reset();
_mtprotoForKeysDestroy.reset();
Shortcuts::Finish();
Ui::Emoji::Clear();
anim::stopManager();
stopWebLoadManager();
App::deinitMedia();
Window::Theme::Unload();
Media::Player::finish(_audio.get());
style::stopManager();
Local::finish();
Global::finish();
ThirdParty::finish();
Instance = nullptr;
}
void Application::run() {
Fonts::Start();
@@ -1127,41 +1164,6 @@ void Application::startShortcuts() {
}, _lifetime);
}
Application::~Application() {
_window.reset();
_mediaView.reset();
// Some MTP requests can be cancelled from data clearing.
authSessionDestroy();
// The langpack manager should be destroyed before MTProto instance,
// because it is MTP::Sender and it may have pending requests.
_langCloudManager.reset();
_mtproto.reset();
_mtprotoForKeysDestroy.reset();
Shortcuts::Finish();
Ui::Emoji::Clear();
anim::stopManager();
stopWebLoadManager();
App::deinitMedia();
Window::Theme::Unload();
Media::Player::finish(_audio.get());
style::stopManager();
Local::finish();
Global::finish();
ThirdParty::finish();
Instance = nullptr;
}
bool IsAppLaunched() {
return (Application::Instance != nullptr);
}