2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-05 09:05:14 +00:00

Search by tag on click in Saved Messages.

This commit is contained in:
John Preston
2024-01-09 12:18:55 +04:00
parent 94a542a1d1
commit d1a0dfbb97
10 changed files with 102 additions and 20 deletions

View File

@@ -2968,13 +2968,17 @@ bool InnerWidget::hasFilteredResults() const {
return !_filterResults.empty() && _hashtagResults.empty();
}
void InnerWidget::searchInChat(Key key, PeerData *from) {
void InnerWidget::searchInChat(
Key key,
PeerData *from,
std::vector<Data::ReactionId> tags) {
_searchInMigrated = nullptr;
const auto sublist = key.sublist();
const auto peer = sublist ? session().user().get() : key.peer();
if (peer) {
if (const auto migrateTo = peer->migrateTo()) {
return searchInChat(peer->owner().history(migrateTo), from);
const auto to = peer->owner().history(migrateTo);
return searchInChat(to, from, tags);
} else if (const auto migrateFrom = peer->migrateFrom()) {
_searchInMigrated = peer->owner().history(migrateFrom);
}
@@ -2990,7 +2994,8 @@ void InnerWidget::searchInChat(Key key, PeerData *from) {
list()
) | rpl::then(
reactions->myTagsUpdates() | rpl::map(list)
));
),
tags);
_searchTags->selectedValue(
) | rpl::start_with_next([=](std::vector<Data::ReactionId> &&list) {