Add This Community tab to message search scopes

This commit is contained in:
John Preston
2026-07-09 18:25:48 +04:00
parent 1ae92b5fe8
commit 527cb34f0f
9 changed files with 63 additions and 11 deletions
+6 -1
View File
@@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "dialogs/dialogs_key.h"
#include "data/data_channel.h"
#include "data/data_folder.h"
#include "data/data_forum_topic.h"
#include "data/data_saved_sublist.h"
@@ -92,9 +93,13 @@ PeerData *Key::peer() const {
}
ChatSearchTab SearchState::defaultTabForMe() const {
const auto history = inChat.history();
const auto channel = history ? history->peer->asChannel() : nullptr;
return inChat.topic()
? ChatSearchTab::ThisTopic
: (inChat.history() || inChat.sublist())
: (channel && channel->isCommunity())
? ChatSearchTab::ThisCommunity
: (history || inChat.sublist())
? ChatSearchTab::ThisPeer
: inChat.folder()
? ChatSearchTab::Archive