Allow searching for messages by a user who has left a chat (#6417)

Fixes #5667
This commit is contained in:
Sameer Hoosen
2019-09-09 09:05:29 +02:00
committed by John Preston
parent eebcdb842d
commit f979df3dfe
5 changed files with 19 additions and 17 deletions

View File

@@ -19,18 +19,15 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace Dialogs {
void ShowSearchFromBox(
not_null<Window::SessionNavigation*> navigation,
not_null<PeerData*> peer,
Fn<void(not_null<UserData*>)> callback,
Fn<void()> closedCallback) {
auto createController = [
navigation,
peer,
callback = std::move(callback)
]() -> std::unique_ptr<PeerListController> {
if (peer && (peer->isChat() || peer->isMegagroup())) {
return std::make_unique<Dialogs::SearchFromController>(
navigation,
peer,
std::move(callback));
}
@@ -50,18 +47,20 @@ void ShowSearchFromBox(
}
SearchFromController::SearchFromController(
not_null<Window::SessionNavigation*> navigation,
not_null<PeerData*> peer,
Fn<void(not_null<UserData*>)> callback)
: ParticipantsBoxController(
navigation,
: AddSpecialBoxController(
peer,
ParticipantsBoxController::Role::Members)
, _callback(std::move(callback)) {
ParticipantsBoxController::Role::Members,
AdminDoneCallback(),
BannedDoneCallback())
, _callback(std::move(callback))
{
_excludeSelf = false;
}
void SearchFromController::prepare() {
ParticipantsBoxController::prepare();
AddSpecialBoxController::prepare();
delegate()->peerListSetTitle(tr::lng_search_messages_from());
}