2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Append server-side topic search results.

This commit is contained in:
John Preston
2022-10-26 18:18:00 +04:00
parent d6ee5b3456
commit 60aef7871a
9 changed files with 224 additions and 73 deletions

View File

@@ -27,6 +27,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "history/history_unread_things.h"
#include "history/view/history_view_item_preview.h"
#include "main/main_session.h"
#include "base/unixtime.h"
#include "ui/painter.h"
#include "ui/color_int_conversion.h"
#include "styles/style_dialogs.h"
@@ -148,6 +149,7 @@ ForumTopic::ForumTopic(not_null<Forum*> forum, MsgId rootId)
rootId))
, _rootId(rootId)
, _lastKnownServerMessageId(rootId)
, _creationDate(creating() ? base::unixtime::now() : 0)
, _flags(creating() ? Flag::My : Flag()) {
Thread::setMuted(owner().notifySettings().isMuted(this));
@@ -201,6 +203,10 @@ MsgId ForumTopic::rootId() const {
return _rootId;
}
TimeId ForumTopic::creationDate() const {
return _creationDate;
}
bool ForumTopic::my() const {
return (_flags & Flag::My);
}
@@ -261,6 +267,8 @@ void ForumTopic::readTillEnd() {
void ForumTopic::applyTopic(const MTPDforumTopic &data) {
Expects(_rootId == data.vid().v);
_creationDate = data.vdate().v;
applyTitle(qs(data.vtitle()));
if (const auto iconId = data.vicon_emoji_id()) {
applyIconId(iconId->v);