Fixed display edited badge in scheduled albums.

Moved hideEditedBadge from HistoryMessage to HistoryItem.
This commit is contained in:
23rd 2021-10-08 04:31:08 +03:00 committed by John Preston
parent 816f422e21
commit 64aa5480ad
3 changed files with 7 additions and 6 deletions

View File

@ -227,6 +227,9 @@ public:
[[nodiscard]] bool hasFailed() const {
return _flags & MessageFlag::SendingFailed;
}
[[nodiscard]] bool hideEditedBadge() const {
return (_flags & MessageFlag::HideEdited);
}
void sendFailed();
[[nodiscard]] virtual int viewsCount() const {
return hasViews() ? 1 : -1;

View File

@ -128,10 +128,6 @@ public:
[[nodiscard]] bool allowsEdit(TimeId now) const override;
[[nodiscard]] bool uploading() const;
[[nodiscard]] bool hideEditedBadge() const {
return (_flags & MessageFlag::HideEdited);
}
void setViewsCount(int count) override;
void setForwardsCount(int count) override;
void setReplies(HistoryMessageRepliesData &&data) override;

View File

@ -638,8 +638,10 @@ DocumentData *GroupedMedia::getDocument() const {
HistoryMessageEdited *GroupedMedia::displayedEditBadge() const {
for (const auto &part : _parts) {
if (const auto edited = part.item->Get<HistoryMessageEdited>()) {
return edited;
if (!part.item->hideEditedBadge()) {
if (const auto edited = part.item->Get<HistoryMessageEdited>()) {
return edited;
}
}
}
return nullptr;