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

Use "Feed" name for chats list index and search.

This commit is contained in:
John Preston
2018-01-22 12:33:09 +03:00
parent 89941a8e83
commit 4527c03c0d
26 changed files with 178 additions and 136 deletions

View File

@@ -53,6 +53,16 @@ public:
HistoryItem *chatsListItem() const override {
return _lastMessage;
}
const QString &chatsListName() const override {
return _name;
}
const base::flat_set<QString> &chatsListNameWords() const override {
return _nameWords;
}
const base::flat_set<QChar> &chatsListFirstLetters() const override {
return _nameFirstLetters;
}
void loadUserpic() override;
void paintUserpic(
Painter &p,
@@ -61,12 +71,16 @@ public:
int size) const override;
private:
void indexNameParts();
void recountLastMessage();
bool justSetLastMessage(not_null<HistoryItem*> item);
FeedId _id = 0;
std::vector<not_null<History*>> _channels;
QString _name;
base::flat_set<QString> _nameWords;
base::flat_set<QChar> _nameFirstLetters;
HistoryItem *_lastMessage = nullptr;
rpl::variable<MessagePosition> _unreadPosition;