2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-05 09:05:14 +00:00

Display topic name in chats list.

This commit is contained in:
John Preston
2022-11-02 16:39:13 +04:00
parent fdf4129e5e
commit 34a2c5c8ce
28 changed files with 223 additions and 172 deletions

View File

@@ -968,24 +968,9 @@ void Notification::updateNotifyDisplay() {
const auto topicWithChat = [&]() -> TextWithEntities {
const auto name = _history->peer->name();
const auto wrapIcon = [](DocumentId id) {
return TextWithEntities{
"@",
{ EntityInText(
EntityType::CustomEmoji,
0,
1,
Data::SerializeCustomEmojiId({.id = id }))
},
};
};
if (!_topic) {
return { name };
}
auto start = _topic->iconId()
? wrapIcon(_topic->iconId())
: TextWithEntities();
return start.append(_topic->title() + u" ("_q + name + ')');
return _topic
? _topic->titleWithIcon().append(u" ("_q + name + ')')
: TextWithEntities{ name };
};
auto title = options.hideNameAndPhoto
? TextWithEntities{ u"Telegram Desktop"_q }