2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

FullMsgId rely on PeerId instead of ChannelId.

This commit is contained in:
John Preston
2021-12-09 11:32:54 +04:00
parent a8f05a01ed
commit 5e7e7eaa83
61 changed files with 446 additions and 475 deletions

View File

@@ -1193,11 +1193,11 @@ FullMsgId ResolveTopPinnedId(
.skippedAfter = 0,
};
if (!slice.messageIds.empty()) {
return FullMsgId(peerToChannel(peer->id), slice.messageIds.back());
return FullMsgId(peer->id, slice.messageIds.back());
} else if (!migrated || slice.count != 0 || old.messageIds.empty()) {
return FullMsgId();
} else {
return FullMsgId(0, old.messageIds.back());
return FullMsgId(migrated->id, old.messageIds.back());
}
}
@@ -1227,9 +1227,9 @@ FullMsgId ResolveMinPinnedId(
.skippedAfter = 0,
};
if (!old.messageIds.empty()) {
return FullMsgId(0, old.messageIds.front());
return FullMsgId(migrated->id, old.messageIds.front());
} else if (old.count == 0 && !slice.messageIds.empty()) {
return FullMsgId(peerToChannel(peer->id), slice.messageIds.front());
return FullMsgId(peer->id, slice.messageIds.front());
} else {
return FullMsgId();
}