Always write MTP data right after login.

Also write to DebugLogs all keys write attempts.
This commit is contained in:
John Preston 2017-04-03 21:59:13 +03:00
parent 50586eb06d
commit 81375a05f1
2 changed files with 5 additions and 2 deletions

View File

@ -424,7 +424,7 @@ void Widget::Step::finish(const MTPUser &user, QImage photo) {
}
Messenger::Instance().authSessionCreate(user.c_user().vid.v);
Local::writeMtpData();
App::wnd()->setupMain(&user);
// "this" is already deleted here by creating the main widget.

View File

@ -195,9 +195,12 @@ QByteArray Messenger::serializeMtpAuthorization() const {
QDataStream stream(&buffer);
stream.setVersion(QDataStream::Qt_5_1);
stream << qint32(AuthSession::Exists() ? AuthSession::CurrentUserId() : 0) << qint32(mainDcId);
auto currentUserId = AuthSession::Exists() ? AuthSession::CurrentUserId() : 0;
stream << qint32(currentUserId) << qint32(mainDcId);
writeKeys(stream, keys);
writeKeys(stream, keysToDestroy);
DEBUG_LOG(("MTP Info: Keys written, userId: %1, dcId: %2").arg(currentUserId).arg(mainDcId));
}
return result;
};