2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-02 15:45:12 +00:00

Updated TDesktop sources to 3.0.1

This commit is contained in:
RadRussianRus
2021-09-17 09:22:56 +03:00
395 changed files with 9038 additions and 5933 deletions

View File

@@ -154,6 +154,12 @@ void Account::createSession(
const auto flags = MTPDuser::Flag::f_self | (phone.isEmpty()
? MTPDuser::Flag()
: MTPDuser::Flag::f_phone);
using ServerUserIdType = decltype(std::declval<MTPDuser>().vid().v);
if (ServerUserIdType(id.bare) <= 0) { // #TODO ids remove
return;
}
createSession(
MTP_user(
MTP_flags(flags),
@@ -251,6 +257,12 @@ rpl::producer<not_null<MTP::Instance*>> Account::mtpValue() const {
});
}
rpl::producer<not_null<MTP::Instance*>> Account::mtpMainSessionValue() const {
return mtpValue() | rpl::map([=](not_null<MTP::Instance*> instance) {
return instance->mainDcIdValue() | rpl::map_to(instance);
}) | rpl::flatten_latest();
}
rpl::producer<MTPUpdates> Account::mtpUpdates() const {
return _mtpUpdates.events();
}