mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-01-11 01:10:13 +00:00
Use edit_hide flag to hide 'edited' badge.
This commit is contained in:
parent
569340c7d3
commit
b27a2cd34a
@ -80,7 +80,9 @@ int HistoryMessageSigned::maxWidth() const {
|
||||
}
|
||||
|
||||
void HistoryMessageEdited::refresh(const QString &date, bool displayed) {
|
||||
const auto prefix = displayed ? (tr::lng_edited(tr::now) + ' ') : QString();
|
||||
const auto prefix = displayed
|
||||
? (tr::lng_edited(tr::now) + ' ')
|
||||
: QString();
|
||||
text.setText(st::msgDateTextStyle, prefix + date, Ui::NameTextOptions());
|
||||
}
|
||||
|
||||
|
@ -118,6 +118,9 @@ public:
|
||||
[[nodiscard]] bool hasMessageBadge() const {
|
||||
return !_messageBadge.isEmpty();
|
||||
}
|
||||
[[nodiscard]] bool hideEditedBadge() const {
|
||||
return (_flags & MTPDmessage::Flag::f_edit_hide);
|
||||
}
|
||||
|
||||
void applyGroupAdminChanges(
|
||||
const base::flat_set<UserId> &changes) override;
|
||||
|
@ -1829,21 +1829,9 @@ bool Message::displayEditedBadge() const {
|
||||
|
||||
TimeId Message::displayedEditDate() const {
|
||||
const auto item = message();
|
||||
auto hasViaBotId = item->Has<HistoryMessageVia>();
|
||||
auto hasInlineMarkup = (item->inlineReplyMarkup() != nullptr);
|
||||
return displayedEditDate(hasViaBotId || hasInlineMarkup);
|
||||
}
|
||||
|
||||
TimeId Message::displayedEditDate(
|
||||
bool hasViaBotOrInlineMarkup) const {
|
||||
if (hasViaBotOrInlineMarkup) {
|
||||
if (item->hideEditedBadge()) {
|
||||
return TimeId(0);
|
||||
} else if (const auto fromUser = message()->from()->asUser()) {
|
||||
if (fromUser->isBot()) {
|
||||
return TimeId(0);
|
||||
}
|
||||
}
|
||||
if (const auto edited = displayedEditBadge()) {
|
||||
} else if (const auto edited = displayedEditBadge()) {
|
||||
return edited->date;
|
||||
}
|
||||
return TimeId(0);
|
||||
|
@ -142,7 +142,6 @@ private:
|
||||
bool displayFastShare() const;
|
||||
bool displayGoToOriginal() const;
|
||||
ClickHandlerPtr fastReplyLink() const;
|
||||
TimeId displayedEditDate(bool hasViaBotOrInlineMarkup) const;
|
||||
const HistoryMessageEdited *displayedEditBadge() const;
|
||||
HistoryMessageEdited *displayedEditBadge();
|
||||
void initTime();
|
||||
|
Loading…
Reference in New Issue
Block a user