Added forwarded info in tooltip of sticker.

This commit is contained in:
23rd 2019-03-09 13:58:54 +03:00 committed by John Preston
parent d7dc277003
commit 89f4408029
3 changed files with 14 additions and 0 deletions

View File

@ -3054,6 +3054,13 @@ QString HistoryInner::tooltipText() const {
ParseDateTime(forwarded->originalDate).toString(
QLocale::system().dateTimeFormat(
QLocale::LongFormat)));
if (const auto media = view->media()) {
if (media->hidesForwardedInfo()) {
dateText += "\n" + lng_forwarded(
lt_user,
forwarded->originalSender->shortName());
}
}
}
if (const auto msgsigned = view->data()->Get<HistoryMessageSigned>()) {
if (msgsigned->isElided) {

View File

@ -201,6 +201,10 @@ public:
return false;
}
[[nodiscard]] virtual bool hidesForwardedInfo() const {
return false;
}
// Sometimes webpages can force the bubble to fit their size instead of
// allowing message text to be as wide as possible (like wallpapers).
[[nodiscard]] virtual bool enforceBubbleWidth() const {

View File

@ -45,6 +45,9 @@ public:
QString emoji() const {
return _emoji;
}
bool hidesForwardedInfo() const override {
return true;
}
private:
QSize countOptimalSize() override;