2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-02 23:55:12 +00:00

Topics list in forum chats list entry.

This commit is contained in:
John Preston
2022-11-11 13:24:37 +04:00
parent 996b6bf46a
commit 4c8187f623
15 changed files with 395 additions and 97 deletions

View File

@@ -178,6 +178,9 @@ ForumTopic::ForumTopic(not_null<Forum*> forum, MsgId rootId)
}) | rpl::start_with_next([=](
std::optional<int> previous,
std::optional<int> now) {
if (previous.value_or(0) != now.value_or(0)) {
_forum->recentTopicsInvalidate(this);
}
notifyUnreadStateChange(unreadStateFor(
previous.value_or(0),
previous.has_value()));
@@ -489,7 +492,9 @@ void ForumTopic::setLastMessage(HistoryItem *item) {
void ForumTopic::setChatListMessage(HistoryItem *item) {
if (_chatListMessage && *_chatListMessage == item) {
return;
} else if (item) {
}
const auto was = _chatListMessage.value_or(nullptr);
if (item) {
if (item->isSponsored()) {
return;
}
@@ -505,6 +510,7 @@ void ForumTopic::setChatListMessage(HistoryItem *item) {
_chatListMessage = nullptr;
updateChatListEntry();
}
_forum->listMessageChanged(was, item);
}
void ForumTopic::loadUserpic() {
@@ -625,6 +631,7 @@ void ForumTopic::applyTitle(const QString &title) {
}
_title = title;
++_titleVersion;
_forum->recentTopicsInvalidate(this);
_defaultIcon = QImage();
indexTitleParts();
updateChatListEntry();