2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 22:55:11 +00:00

Show saved messages sublists in profile.

This commit is contained in:
John Preston
2023-12-27 01:09:20 +00:00
parent ead40c759e
commit 18c4d210e5
41 changed files with 1030 additions and 65 deletions

View File

@@ -14,6 +14,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/data_folder.h"
#include "data/data_forum_topic.h"
#include "data/data_chat_filters.h"
#include "data/data_saved_sublist.h"
#include "core/application.h"
#include "core/core_settings.h"
#include "mainwidget.h"
@@ -83,6 +84,8 @@ Entry::Entry(not_null<Data::Session*> owner, Type type)
? (Flag::IsThread | Flag::IsHistory)
: (type == Type::ForumTopic)
? Flag::IsThread
: (type == Type::SavedSublist)
? Flag::IsSavedSublist
: Flag(0)) {
}
@@ -109,7 +112,7 @@ Data::Forum *Entry::asForum() {
}
Data::Folder *Entry::asFolder() {
return (_flags & Flag::IsThread)
return (_flags & (Flag::IsThread | Flag::IsSavedSublist))
? nullptr
: static_cast<Data::Folder*>(this);
}
@@ -126,6 +129,12 @@ Data::ForumTopic *Entry::asTopic() {
: nullptr;
}
Data::SavedSublist *Entry::asSublist() {
return (_flags & Flag::IsSavedSublist)
? static_cast<Data::SavedSublist*>(this)
: nullptr;
}
const History *Entry::asHistory() const {
return const_cast<Entry*>(this)->asHistory();
}
@@ -146,6 +155,10 @@ const Data::ForumTopic *Entry::asTopic() const {
return const_cast<Entry*>(this)->asTopic();
}
const Data::SavedSublist *Entry::asSublist() const {
return const_cast<Entry*>(this)->asSublist();
}
void Entry::pinnedIndexChanged(FilterId filterId, int was, int now) {
if (!filterId && session().supportMode()) {
// Force reorder in support mode.