mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 23:53:58 +02:00
Fix first message date with new peer info.
This commit is contained in:
parent
cae192682b
commit
a3637c12d6
3 changed files with 4 additions and 3 deletions
|
@ -323,7 +323,7 @@ public:
|
||||||
return (_flags & MessageFlag::HideEdited);
|
return (_flags & MessageFlag::HideEdited);
|
||||||
}
|
}
|
||||||
[[nodiscard]] bool hideDisplayDate() const {
|
[[nodiscard]] bool hideDisplayDate() const {
|
||||||
return (_flags & MessageFlag::HideDisplayDate);
|
return isEmpty() || (_flags & MessageFlag::HideDisplayDate);
|
||||||
}
|
}
|
||||||
[[nodiscard]] bool isLocal() const {
|
[[nodiscard]] bool isLocal() const {
|
||||||
return _flags & MessageFlag::Local;
|
return _flags & MessageFlag::Local;
|
||||||
|
|
|
@ -1397,7 +1397,7 @@ void Element::recountDisplayDateInBlocks() {
|
||||||
|
|
||||||
if (const auto previous = previousDisplayedInBlocks()) {
|
if (const auto previous = previousDisplayedInBlocks()) {
|
||||||
const auto prev = previous->data();
|
const auto prev = previous->data();
|
||||||
return prev->isEmpty()
|
return prev->hideDisplayDate()
|
||||||
|| (previous->dateTime().date() != dateTime().date());
|
|| (previous->dateTime().date() != dateTime().date());
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -4077,7 +4077,8 @@ void ListWidget::refreshAttachmentsFromTill(int from, int till) {
|
||||||
const auto viewDate = view->dateTime();
|
const auto viewDate = view->dateTime();
|
||||||
const auto nextDate = next->dateTime();
|
const auto nextDate = next->dateTime();
|
||||||
next->setDisplayDate(_context != Context::ShortcutMessages
|
next->setDisplayDate(_context != Context::ShortcutMessages
|
||||||
&& nextDate.date() != viewDate.date());
|
&& (nextDate.date() != viewDate.date()
|
||||||
|
|| view->data()->hideDisplayDate()));
|
||||||
auto attached = next->computeIsAttachToPrevious(view);
|
auto attached = next->computeIsAttachToPrevious(view);
|
||||||
next->setAttachToPrevious(attached, view);
|
next->setAttachToPrevious(attached, view);
|
||||||
view->setAttachToNext(attached, next);
|
view->setAttachToNext(attached, next);
|
||||||
|
|
Loading…
Add table
Reference in a new issue