2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 22:46:10 +00:00

Respect reactions_default from appconfig.

This commit is contained in:
John Preston
2022-01-13 19:39:44 +03:00
parent f3e84de5fb
commit 8a071fe1fe
7 changed files with 63 additions and 13 deletions

View File

@@ -19,12 +19,6 @@ constexpr auto kRefreshTimeout = 3600 * crl::time(1000);
} // namespace
AppConfig::AppConfig(not_null<Account*> account) : _account(account) {
account->mtpMainSessionValue(
) | rpl::start_with_next([=](not_null<MTP::Instance*> instance) {
_api.emplace(instance);
refresh();
}, _lifetime);
account->sessionChanges(
) | rpl::filter([=](Session *session) {
return (session != nullptr);
@@ -33,6 +27,14 @@ AppConfig::AppConfig(not_null<Account*> account) : _account(account) {
}, _lifetime);
}
void AppConfig::start() {
_account->mtpMainSessionValue(
) | rpl::start_with_next([=](not_null<MTP::Instance*> instance) {
_api.emplace(instance);
refresh();
}, _lifetime);
}
void AppConfig::refresh() {
if (_requestId || !_api) {
return;
@@ -178,6 +180,8 @@ rpl::producer<> AppConfig::suggestionRequested(const QString &key) const {
}
void AppConfig::dismissSuggestion(const QString &key) {
Expects(_api.has_value());
if (!_dismissedSuggestions.emplace(key).second) {
return;
}