2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Improve update handling for legacy chats.

This commit is contained in:
John Preston
2019-01-13 12:03:34 +04:00
parent 215856adc3
commit 67d12fa6d2
28 changed files with 650 additions and 797 deletions

View File

@@ -326,6 +326,19 @@ public:
return _feed;
}
enum class UpdateStatus {
Good,
TooOld,
Skipped,
};
int version() const {
return _version;
}
void setVersion(int version) {
_version = version;
}
UpdateStatus applyUpdateVersion(int version);
// Still public data members.
uint64 access = 0;
@@ -334,7 +347,6 @@ public:
QString username;
int32 date = 0;
int version = 0;
std::unique_ptr<MegagroupInfo> mgInfo;
UserId inviter = 0; // > 0 - user who invited me to channel, < 0 - not in channel
@@ -354,6 +366,7 @@ private:
int _restrictedCount = 0;
int _kickedCount = 0;
MsgId _availableMinId = 0;
int _version = 0;
RestrictionFlags _defaultRestrictions;
AdminRightFlags _adminRights;
@@ -368,3 +381,11 @@ private:
rpl::lifetime _lifetime;
};
namespace Data {
void ApplyChannelUpdate(
not_null<ChannelData*> channel,
const MTPDupdateChatDefaultBannedRights &update);
} // namespace Data