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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user