2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Extend pinned messages support.

Support them in saved messages and normal groups.
This commit is contained in:
John Preston
2018-10-31 15:29:14 +04:00
parent 6d65cf2382
commit 78da810114
12 changed files with 122 additions and 99 deletions

View File

@@ -210,6 +210,15 @@ public:
ImagePtr currentUserpic() const;
bool canPinMessages() const;
MsgId pinnedMessageId() const {
return _pinnedMessageId;
}
void setPinnedMessageId(MsgId messageId);
void clearPinnedMessage() {
setPinnedMessageId(0);
}
protected:
void updateNameDelayed(
const QString &newName,
@@ -242,6 +251,7 @@ private:
base::flat_set<QChar> _nameFirstLetters;
TimeMs _lastFullUpdate = 0;
MsgId _pinnedMessageId = 0;
};
@@ -918,7 +928,6 @@ public:
bool hiddenPreHistory() const;
bool canAddMembers() const;
bool canAddAdmins() const;
bool canPinMessages() const;
bool canPublish() const;
bool canWrite() const;
bool canViewMembers() const;
@@ -999,14 +1008,6 @@ public:
}
void setAvailableMinId(MsgId availableMinId);
MsgId pinnedMessageId() const {
return _pinnedMessageId;
}
void setPinnedMessageId(MsgId messageId);
void clearPinnedMessage() {
setPinnedMessageId(0);
}
void setFeed(not_null<Data::Feed*> feed);
void clearFeed();
@@ -1031,7 +1032,6 @@ private:
int _restrictedCount = 0;
int _kickedCount = 0;
MsgId _availableMinId = 0;
MsgId _pinnedMessageId = 0;
AdminRightFlags _adminRights;
RestrictionFlags _restrictions;