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) {
|
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());
|
text.setText(st::msgDateTextStyle, prefix + date, Ui::NameTextOptions());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,6 +118,9 @@ public:
|
|||||||
[[nodiscard]] bool hasMessageBadge() const {
|
[[nodiscard]] bool hasMessageBadge() const {
|
||||||
return !_messageBadge.isEmpty();
|
return !_messageBadge.isEmpty();
|
||||||
}
|
}
|
||||||
|
[[nodiscard]] bool hideEditedBadge() const {
|
||||||
|
return (_flags & MTPDmessage::Flag::f_edit_hide);
|
||||||
|
}
|
||||||
|
|
||||||
void applyGroupAdminChanges(
|
void applyGroupAdminChanges(
|
||||||
const base::flat_set<UserId> &changes) override;
|
const base::flat_set<UserId> &changes) override;
|
||||||
|
@ -1829,21 +1829,9 @@ bool Message::displayEditedBadge() const {
|
|||||||
|
|
||||||
TimeId Message::displayedEditDate() const {
|
TimeId Message::displayedEditDate() const {
|
||||||
const auto item = message();
|
const auto item = message();
|
||||||
auto hasViaBotId = item->Has<HistoryMessageVia>();
|
if (item->hideEditedBadge()) {
|
||||||
auto hasInlineMarkup = (item->inlineReplyMarkup() != nullptr);
|
|
||||||
return displayedEditDate(hasViaBotId || hasInlineMarkup);
|
|
||||||
}
|
|
||||||
|
|
||||||
TimeId Message::displayedEditDate(
|
|
||||||
bool hasViaBotOrInlineMarkup) const {
|
|
||||||
if (hasViaBotOrInlineMarkup) {
|
|
||||||
return TimeId(0);
|
return TimeId(0);
|
||||||
} else if (const auto fromUser = message()->from()->asUser()) {
|
} else if (const auto edited = displayedEditBadge()) {
|
||||||
if (fromUser->isBot()) {
|
|
||||||
return TimeId(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (const auto edited = displayedEditBadge()) {
|
|
||||||
return edited->date;
|
return edited->date;
|
||||||
}
|
}
|
||||||
return TimeId(0);
|
return TimeId(0);
|
||||||
|
@ -142,7 +142,6 @@ private:
|
|||||||
bool displayFastShare() const;
|
bool displayFastShare() const;
|
||||||
bool displayGoToOriginal() const;
|
bool displayGoToOriginal() const;
|
||||||
ClickHandlerPtr fastReplyLink() const;
|
ClickHandlerPtr fastReplyLink() const;
|
||||||
TimeId displayedEditDate(bool hasViaBotOrInlineMarkup) const;
|
|
||||||
const HistoryMessageEdited *displayedEditBadge() const;
|
const HistoryMessageEdited *displayedEditBadge() const;
|
||||||
HistoryMessageEdited *displayedEditBadge();
|
HistoryMessageEdited *displayedEditBadge();
|
||||||
void initTime();
|
void initTime();
|
||||||
|
Loading…
Reference in New Issue
Block a user