mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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;
|
return;
|
||||||
}
|
}
|
||||||
_title = title;
|
_title = title;
|
||||||
++_titleVersion;
|
invalidateTitleWithIcon();
|
||||||
_forum->recentTopicsInvalidate(this);
|
|
||||||
_defaultIcon = QImage();
|
_defaultIcon = QImage();
|
||||||
indexTitleParts();
|
indexTitleParts();
|
||||||
updateChatListEntry();
|
updateChatListEntry();
|
||||||
|
@ -724,7 +723,7 @@ void ForumTopic::applyIconId(DocumentId iconId) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_iconId = iconId;
|
_iconId = iconId;
|
||||||
++_titleVersion;
|
invalidateTitleWithIcon();
|
||||||
_icon = iconId
|
_icon = iconId
|
||||||
? std::make_unique<Ui::Text::LimitedLoopsEmoji>(
|
? std::make_unique<Ui::Text::LimitedLoopsEmoji>(
|
||||||
owner().customEmojiManager().create(
|
owner().customEmojiManager().create(
|
||||||
|
@ -740,6 +739,11 @@ void ForumTopic::applyIconId(DocumentId iconId) {
|
||||||
session().changes().topicUpdated(this, UpdateFlag::IconId);
|
session().changes().topicUpdated(this, UpdateFlag::IconId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ForumTopic::invalidateTitleWithIcon() {
|
||||||
|
++_titleVersion;
|
||||||
|
_forum->recentTopicsInvalidate(this);
|
||||||
|
}
|
||||||
|
|
||||||
int32 ForumTopic::colorId() const {
|
int32 ForumTopic::colorId() const {
|
||||||
return _colorId;
|
return _colorId;
|
||||||
}
|
}
|
||||||
|
|
|
@ -179,6 +179,7 @@ private:
|
||||||
void validateGeneralIcon(const Dialogs::Ui::PaintContext &context) const;
|
void validateGeneralIcon(const Dialogs::Ui::PaintContext &context) const;
|
||||||
void applyTopicTopMessage(MsgId topMessageId);
|
void applyTopicTopMessage(MsgId topMessageId);
|
||||||
void growLastKnownServerMessageId(MsgId id);
|
void growLastKnownServerMessageId(MsgId id);
|
||||||
|
void invalidateTitleWithIcon();
|
||||||
|
|
||||||
void setLastMessage(HistoryItem *item);
|
void setLastMessage(HistoryItem *item);
|
||||||
void setLastServerMessage(HistoryItem *item);
|
void setLastServerMessage(HistoryItem *item);
|
||||||
|
|
|
@ -56,10 +56,9 @@ void TopicsView::prepare(MsgId frontRootId, Fn<void()> customEmojiRepaint) {
|
||||||
_titles.emplace_back();
|
_titles.emplace_back();
|
||||||
}
|
}
|
||||||
auto &title = _titles[index++];
|
auto &title = _titles[index++];
|
||||||
title.topicRootId = rootId;
|
|
||||||
|
|
||||||
const auto unread = topic->chatListBadgesState().unread;
|
const auto unread = topic->chatListBadgesState().unread;
|
||||||
if (title.unread == unread
|
if (title.topicRootId == rootId
|
||||||
|
&& title.unread == unread
|
||||||
&& title.version == topic->titleVersion()) {
|
&& title.version == topic->titleVersion()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -69,6 +68,7 @@ void TopicsView::prepare(MsgId frontRootId, Fn<void()> customEmojiRepaint) {
|
||||||
.customEmojiLoopLimit = kIconLoopCount,
|
.customEmojiLoopLimit = kIconLoopCount,
|
||||||
};
|
};
|
||||||
auto topicTitle = topic->titleWithIcon();
|
auto topicTitle = topic->titleWithIcon();
|
||||||
|
title.topicRootId = rootId;
|
||||||
title.version = topic->titleVersion();
|
title.version = topic->titleVersion();
|
||||||
title.unread = unread;
|
title.unread = unread;
|
||||||
title.title.setMarkedText(
|
title.title.setMarkedText(
|
||||||
|
|
Loading…
Add table
Reference in a new issue