mirror of https://github.com/procxx/kepka.git
Add some debug logs.
This commit is contained in:
parent
e3b6e1325e
commit
8ed600bf3f
|
@ -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,
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue