diff --git a/Telegram/SourceFiles/messenger.cpp b/Telegram/SourceFiles/messenger.cpp index e8307a0b0..a954e8f34 100644 --- a/Telegram/SourceFiles/messenger.cpp +++ b/Telegram/SourceFiles/messenger.cpp @@ -387,6 +387,9 @@ void Messenger::setAuthSessionFromStorage( int32 selfStreamVersion) { Expects(!authSession()); + DEBUG_LOG(("authSessionUserSerialized set: %1" + ).arg(selfSerialized.size())); + _private->storedAuthSession = std::move(data); _private->authSessionUserSerialized = std::move(selfSerialized); _private->authSessionUserStreamVersion = selfStreamVersion; @@ -467,6 +470,8 @@ void Messenger::startMtp() { } if (_private->authSessionUserId) { + DEBUG_LOG(("authSessionUserSerialized.size: %1" + ).arg(_private->authSessionUserSerialized.size())); QDataStream peekStream(_private->authSessionUserSerialized); const auto phone = Serialize::peekUserPhone( _private->authSessionUserStreamVersion, diff --git a/Telegram/SourceFiles/storage/localstorage.cpp b/Telegram/SourceFiles/storage/localstorage.cpp index f067fef93..e112f480a 100644 --- a/Telegram/SourceFiles/storage/localstorage.cpp +++ b/Telegram/SourceFiles/storage/localstorage.cpp @@ -2325,6 +2325,7 @@ ReadMapState _readMap(const QByteArray &pass) { _readUserSettings(); _readMtpData(); + DEBUG_LOG(("selfSerialized set: %1").arg(selfSerialized.size())); Messenger::Instance().setAuthSessionFromStorage( std::move(StoredAuthSessionCache), std::move(selfSerialized), @@ -2372,10 +2373,12 @@ void _writeMap(WriteMapWhen when) { uint32 mapSize = 0; const auto self = [] { if (!AuthSession::Exists()) { + DEBUG_LOG(("AuthSelf Warning: Session does not exist.")); return QByteArray(); } const auto self = Auth().user(); if (self->phone().isEmpty()) { + DEBUG_LOG(("AuthSelf Error: Phone is empty.")); return QByteArray(); } auto result = QByteArray(); diff --git a/Telegram/SourceFiles/storage/serialize_common.cpp b/Telegram/SourceFiles/storage/serialize_common.cpp index d7784132b..39f3711bf 100644 --- a/Telegram/SourceFiles/storage/serialize_common.cpp +++ b/Telegram/SourceFiles/storage/serialize_common.cpp @@ -264,6 +264,7 @@ PeerData *readPeer(int streamAppVersion, QDataStream &stream) { QString peekUserPhone(int streamAppVersion, QDataStream &stream) { quint64 peerId = 0, photoId = 0; stream >> peerId >> photoId; + DEBUG_LOG(("peekUserPhone.id: %1").arg(peerId)); if (!peerId || !peerIsUser(peerId)) { return QString(); } @@ -273,6 +274,8 @@ QString peekUserPhone(int streamAppVersion, QDataStream &stream) { stream); QString first, last, phone; stream >> first >> last >> phone; + DEBUG_LOG(("peekUserPhone.data: %1 %2 %3" + ).arg(first).arg(last).arg(phone)); return phone; } diff --git a/Telegram/SourceFiles/support/support_common.cpp b/Telegram/SourceFiles/support/support_common.cpp index f0c664d83..a137b0ce4 100644 --- a/Telegram/SourceFiles/support/support_common.cpp +++ b/Telegram/SourceFiles/support/support_common.cpp @@ -14,6 +14,9 @@ namespace Support { bool ValidateAccount(const MTPUser &self) { //return true; AssertIsDebug(); return self.match([](const MTPDuser &data) { + DEBUG_LOG(("ValidateAccount: %1 %2" + ).arg(Logs::b(data.has_phone()) + ).arg(data.has_phone() ? qs(data.vphone) : QString())); return data.has_phone() && qs(data.vphone).startsWith(qstr("424")); }, [](const MTPDuserEmpty &data) { return false;