2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

Remove some usages of App::main().

This commit is contained in:
John Preston
2020-06-10 22:08:17 +04:00
parent ea86433be5
commit ee43027bea
53 changed files with 518 additions and 429 deletions

View File

@@ -94,6 +94,7 @@ void CheckForSwitchInlineButton(not_null<HistoryItem*> item) {
using ButtonType = HistoryMessageMarkupButton::Type;
if (button.type == ButtonType::SwitchInline) {
Notify::switchInlineBotButtonReceived(
&item->history()->session(),
QString::fromUtf8(button.data));
return;
}
@@ -889,6 +890,25 @@ void Session::chatsListDone(Data::Folder *folder) {
_chatsListLoadedEvents.fire_copy(folder);
}
void Session::userIsBotChanged(not_null<UserData*> user) {
if (const auto history = this->history(user)) {
chatsFilters().refreshHistory(history);
}
_userIsBotChanges.fire_copy(user);
}
rpl::producer<not_null<UserData*>> Session::userIsBotChanges() const {
return _userIsBotChanges.events();
}
void Session::botCommandsChanged(not_null<UserData*> user) {
_botCommandsChanges.fire_copy(user);
}
rpl::producer<not_null<UserData*>> Session::botCommandsChanges() const {
return _botCommandsChanges.events();
}
Storage::Cache::Database &Session::cache() {
return *_cache;
}