2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Improve topic creation, fix glitches.

This commit is contained in:
John Preston
2022-10-21 13:42:21 +04:00
parent fd2edb51e9
commit ce17904dcc
6 changed files with 21 additions and 13 deletions

View File

@@ -388,7 +388,9 @@ void ForumTopic::setLastServerMessage(HistoryItem *item) {
if (_lastMessage
&& *_lastMessage
&& !(*_lastMessage)->isRegular()
&& (!item || (*_lastMessage)->date() > item->date())) {
&& (!item
|| (*_lastMessage)->date() > item->date()
|| (*_lastMessage)->isSending())) {
return;
}
setLastMessage(item);
@@ -566,7 +568,11 @@ void ForumTopic::applyColorId(int32 colorId) {
}
void ForumTopic::applyItemAdded(not_null<HistoryItem*> item) {
setLastMessage(item);
if (item->isRegular()) {
setLastServerMessage(item);
} else {
setLastMessage(item);
}
}
void ForumTopic::maybeSetLastMessage(not_null<HistoryItem*> item) {