2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

Show forum messages search results with topics.

This commit is contained in:
John Preston
2022-10-26 16:33:58 +04:00
parent 88d1a502a5
commit d6ee5b3456
9 changed files with 235 additions and 177 deletions

View File

@@ -147,7 +147,7 @@ private:
};
class FakeRow : public BasicRow {
class FakeRow final : public BasicRow, public base::has_weak_ptr {
public:
FakeRow(
Key searchInChat,
@@ -157,6 +157,9 @@ public:
[[nodiscard]] Key searchInChat() const {
return _searchInChat;
}
[[nodiscard]] Data::ForumTopic *topic() const {
return _topic;
}
[[nodiscard]] not_null<HistoryItem*> item() const {
return _item;
}
@@ -171,11 +174,14 @@ public:
}
[[nodiscard]] const Ui::Text::String &name() const;
void invalidateTopic();
private:
friend class Ui::RowPainter;
const Key _searchInChat;
const not_null<HistoryItem*> _item;
Data::ForumTopic *_topic = nullptr;
const Fn<void()> _repaint;
mutable Ui::MessageView _itemView;
mutable Ui::PeerBadge _badge;