mirror of https://github.com/procxx/kepka.git
Fix reading saved self.
This commit is contained in:
parent
0d4ad1b635
commit
3cdfa1014a
|
@ -4559,8 +4559,13 @@ void writeSelf() {
|
||||||
|
|
||||||
void readSelf(const QByteArray &serialized, int32 streamVersion) {
|
void readSelf(const QByteArray &serialized, int32 streamVersion) {
|
||||||
QDataStream stream(serialized);
|
QDataStream stream(serialized);
|
||||||
|
const auto user = Auth().user();
|
||||||
|
const auto wasLoadedStatus = std::exchange(
|
||||||
|
user->loadedStatus,
|
||||||
|
PeerData::NotLoaded);
|
||||||
const auto self = Serialize::readPeer(streamVersion, stream);
|
const auto self = Serialize::readPeer(streamVersion, stream);
|
||||||
if (!self || !self->isSelf() || self != Auth().user()) {
|
if (!self || !self->isSelf() || self != user) {
|
||||||
|
user->loadedStatus = wasLoadedStatus;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue