Always display name in media messages in groups.

This commit is contained in:
John Preston 2017-02-09 17:34:19 +03:00
parent 3c18532612
commit 2becd307df
3 changed files with 13 additions and 26 deletions

View File

@ -145,9 +145,6 @@ public:
virtual QMargins bubbleMargins() const {
return QMargins();
}
virtual bool hideFromName() const {
return false;
}
virtual bool hideForwardedFrom() const {
return false;
}

View File

@ -161,17 +161,14 @@ public:
if (!_caption.isEmpty()) {
return true;
}
if (_parent->viaBot()) {
return true;
if (auto message = _parent->toHistoryMessage()) {
return message->displayFromName();
}
return (_parent->Has<HistoryMessageForwarded>() || _parent->Has<HistoryMessageReply>());
return false;
}
bool customInfoLayout() const override {
return _caption.isEmpty();
}
bool hideFromName() const override {
return true;
}
bool skipBubbleTail() const override {
return isBubbleBottom() && _caption.isEmpty();
}
@ -251,17 +248,14 @@ public:
if (!_caption.isEmpty()) {
return true;
}
if (_parent->viaBot()) {
return true;
if (auto message = _parent->toHistoryMessage()) {
return message->displayFromName();
}
return (_parent->Has<HistoryMessageForwarded>() || _parent->Has<HistoryMessageReply>());
return false;
}
bool customInfoLayout() const override {
return _caption.isEmpty();
}
bool hideFromName() const override {
return true;
}
bool skipBubbleTail() const override {
return isBubbleBottom() && _caption.isEmpty();
}
@ -480,17 +474,14 @@ public:
if (!_caption.isEmpty()) {
return true;
}
if (_parent->viaBot()) {
return true;
if (auto message = _parent->toHistoryMessage()) {
return message->displayFromName();
}
return (_parent->Has<HistoryMessageForwarded>() || _parent->Has<HistoryMessageReply>());
return false;
}
bool customInfoLayout() const override {
return _caption.isEmpty();
}
bool hideFromName() const override {
return true;
}
bool skipBubbleTail() const override {
return isBubbleBottom() && _caption.isEmpty();
}
@ -884,10 +875,10 @@ public:
if (!_title.isEmpty() || !_description.isEmpty()) {
return true;
}
if (_parent->viaBot()) {
return true;
if (auto message = _parent->toHistoryMessage()) {
return message->displayFromName();
}
return (_parent->Has<HistoryMessageForwarded>() || _parent->Has<HistoryMessageReply>());
return false;
}
bool customInfoLayout() const override {
return true;

View File

@ -60,8 +60,7 @@ public:
bool displayFromName() const {
if (!hasFromName()) return false;
if (isAttachedToPrevious()) return false;
return (!emptyText() || !_media || !_media->isDisplayed() || Has<HistoryMessageReply>() || Has<HistoryMessageForwarded>() || viaBot() || !_media->hideFromName());
return true;
}
bool displayEditedBadge(bool hasViaBotOrInlineMarkup) const;
bool uploading() const {