Returned display of message status for self and last messages.

This commit is contained in:
23rd 2020-02-26 14:25:51 +03:00
parent a0584ea7a1
commit 4e345ac688
6 changed files with 21 additions and 3 deletions

View File

@ -280,6 +280,16 @@ bool Element::isUnderCursor() const {
return _delegate->elementUnderCursor(this);
}
bool Element::isLastAndSelfMessage() const {
if (!hasOutLayout()) {
return false;
}
if (const auto last = data()->_history->lastMessage()) {
return last == data();
}
return false;
}
void Element::setPendingResize() {
_flags |= Flag::NeedsResize;
if (_context == Context::History) {

View File

@ -158,6 +158,8 @@ public:
bool pendingResize() const;
bool isUnderCursor() const;
bool isLastAndSelfMessage() const;
bool isAttachedToPrevious() const;
bool isAttachedToNext() const;

View File

@ -1444,7 +1444,8 @@ bool Gif::dataLoaded() const {
bool Gif::needInfoDisplay() const {
return _parent->data()->isSending()
|| _data->uploading()
|| _parent->isUnderCursor();
|| _parent->isUnderCursor()
|| _parent->isLastAndSelfMessage();
}
bool Gif::needCornerStatusDisplay() const {

View File

@ -453,7 +453,9 @@ bool GroupedMedia::computeNeedBubble() const {
}
bool GroupedMedia::needInfoDisplay() const {
return (_parent->data()->id < 0 || _parent->isUnderCursor());
return (_parent->data()->id < 0
|| _parent->isUnderCursor()
|| _parent->isLastAndSelfMessage());
}
} // namespace HistoryView

View File

@ -367,6 +367,7 @@ bool UnwrappedMedia::needInfoDisplay() const {
return (_parent->data()->id < 0)
|| (_parent->isUnderCursor())
|| (_parent->displayRightAction())
|| (_parent->isLastAndSelfMessage())
|| (_parent->hasOutLayout()
&& !Adaptive::ChatWide()
&& _content->alwaysShowOutTimestamp());

View File

@ -480,7 +480,9 @@ bool Photo::dataLoaded() const {
}
bool Photo::needInfoDisplay() const {
return (_parent->data()->id < 0 || _parent->isUnderCursor());
return (_parent->data()->id < 0
|| _parent->isUnderCursor()
|| _parent->isLastAndSelfMessage());
}
void Photo::validateGroupedCache(