2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Don't allow two same accounts being logged in.

This commit is contained in:
John Preston
2020-06-24 13:32:07 +04:00
parent d8a2b391a3
commit 0bc2bfe630
6 changed files with 61 additions and 16 deletions

View File

@@ -166,11 +166,9 @@ base::Observable<void> &Session::downloaderTaskFinished() {
}
uint64 Session::uniqueId() const {
auto result = uint64(uint32(userId()));
if (mtp().isTestMode()) {
result |= 0x0100'0000'0000'0000ULL;
}
return result;
// See also Account::willHaveSessionUniqueId.
return uint64(uint32(userId()))
| (mtp().isTestMode() ? 0x0100'0000'0000'0000ULL : 0ULL);
}
UserId Session::userId() const {