mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Fix incorrect topic names in forum preview row.
This commit is contained in:
parent
234fdbed4a
commit
88b555e907
3 changed files with 11 additions and 6 deletions
|
@ -707,8 +707,7 @@ void ForumTopic::applyTitle(const QString &title) {
|
|||
return;
|
||||
}
|
||||
_title = title;
|
||||
++_titleVersion;
|
||||
_forum->recentTopicsInvalidate(this);
|
||||
invalidateTitleWithIcon();
|
||||
_defaultIcon = QImage();
|
||||
indexTitleParts();
|
||||
updateChatListEntry();
|
||||
|
@ -724,7 +723,7 @@ void ForumTopic::applyIconId(DocumentId iconId) {
|
|||
return;
|
||||
}
|
||||
_iconId = iconId;
|
||||
++_titleVersion;
|
||||
invalidateTitleWithIcon();
|
||||
_icon = iconId
|
||||
? std::make_unique<Ui::Text::LimitedLoopsEmoji>(
|
||||
owner().customEmojiManager().create(
|
||||
|
@ -740,6 +739,11 @@ void ForumTopic::applyIconId(DocumentId iconId) {
|
|||
session().changes().topicUpdated(this, UpdateFlag::IconId);
|
||||
}
|
||||
|
||||
void ForumTopic::invalidateTitleWithIcon() {
|
||||
++_titleVersion;
|
||||
_forum->recentTopicsInvalidate(this);
|
||||
}
|
||||
|
||||
int32 ForumTopic::colorId() const {
|
||||
return _colorId;
|
||||
}
|
||||
|
|
|
@ -179,6 +179,7 @@ private:
|
|||
void validateGeneralIcon(const Dialogs::Ui::PaintContext &context) const;
|
||||
void applyTopicTopMessage(MsgId topMessageId);
|
||||
void growLastKnownServerMessageId(MsgId id);
|
||||
void invalidateTitleWithIcon();
|
||||
|
||||
void setLastMessage(HistoryItem *item);
|
||||
void setLastServerMessage(HistoryItem *item);
|
||||
|
|
|
@ -56,10 +56,9 @@ void TopicsView::prepare(MsgId frontRootId, Fn<void()> customEmojiRepaint) {
|
|||
_titles.emplace_back();
|
||||
}
|
||||
auto &title = _titles[index++];
|
||||
title.topicRootId = rootId;
|
||||
|
||||
const auto unread = topic->chatListBadgesState().unread;
|
||||
if (title.unread == unread
|
||||
if (title.topicRootId == rootId
|
||||
&& title.unread == unread
|
||||
&& title.version == topic->titleVersion()) {
|
||||
continue;
|
||||
}
|
||||
|
@ -69,6 +68,7 @@ void TopicsView::prepare(MsgId frontRootId, Fn<void()> customEmojiRepaint) {
|
|||
.customEmojiLoopLimit = kIconLoopCount,
|
||||
};
|
||||
auto topicTitle = topic->titleWithIcon();
|
||||
title.topicRootId = rootId;
|
||||
title.version = topic->titleVersion();
|
||||
title.unread = unread;
|
||||
title.title.setMarkedText(
|
||||
|
|
Loading…
Add table
Reference in a new issue