2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-03 07:56:03 +00:00

Fix "Topic Author" badge for the new topics.

This commit is contained in:
John Preston
2022-11-03 14:13:36 +04:00
parent da941e4837
commit 1953cc2f8a
8 changed files with 56 additions and 6 deletions

View File

@@ -285,7 +285,7 @@ void ForumTopic::readTillEnd() {
void ForumTopic::applyTopic(const MTPDforumTopic &data) {
Expects(_rootId == data.vid().v);
_creatorId = peerFromMTP(data.vfrom_id());
applyCreator(peerFromMTP(data.vfrom_id()));
_creationDate = data.vdate().v;
applyTitle(qs(data.vtitle()));
@@ -328,6 +328,13 @@ void ForumTopic::applyTopic(const MTPDforumTopic &data) {
unreadReactions().setCount(data.vunread_reactions_count().v);
}
void ForumTopic::applyCreator(PeerId creatorId) {
if (_creatorId != creatorId) {
_creatorId = creatorId;
session().changes().topicUpdated(this, UpdateFlag::Creator);
}
}
bool ForumTopic::closed() const {
return _flags & Flag::Closed;
}