2017-08-01 15:55:51 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
2018-01-03 10:23:14 +00:00
|
|
|
the official desktop application for the Telegram messaging service.
|
2017-08-01 15:55:51 +00:00
|
|
|
|
2018-01-03 10:23:14 +00:00
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
2017-08-01 15:55:51 +00:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "boxes/peer_list_box.h"
|
|
|
|
#include "profile/profile_channel_controllers.h"
|
|
|
|
|
|
|
|
namespace Dialogs {
|
|
|
|
|
2017-10-03 13:05:58 +00:00
|
|
|
void ShowSearchFromBox(
|
2017-12-04 07:33:33 +00:00
|
|
|
not_null<Window::Navigation*> navigation,
|
2017-10-03 13:05:58 +00:00
|
|
|
not_null<PeerData*> peer,
|
|
|
|
base::lambda<void(not_null<UserData*>)> callback,
|
|
|
|
base::lambda<void()> closedCallback);
|
2017-08-06 20:07:51 +00:00
|
|
|
|
2017-08-01 15:55:51 +00:00
|
|
|
class ChatSearchFromController : public PeerListController, protected base::Subscriber {
|
|
|
|
public:
|
2017-10-03 13:05:58 +00:00
|
|
|
ChatSearchFromController(
|
2017-12-04 07:33:33 +00:00
|
|
|
not_null<Window::Navigation*> navigation,
|
2017-10-03 13:05:58 +00:00
|
|
|
not_null<ChatData*> chat,
|
|
|
|
base::lambda<void(not_null<UserData*>)> callback);
|
2017-08-01 15:55:51 +00:00
|
|
|
|
|
|
|
void prepare() override;
|
2017-08-17 08:31:24 +00:00
|
|
|
void rowClicked(not_null<PeerListRow*> row) override;
|
2017-08-01 15:55:51 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void rebuildRows();
|
|
|
|
void checkForEmptyRows();
|
2017-08-17 08:31:24 +00:00
|
|
|
void appendRow(not_null<UserData*> user);
|
2017-08-01 15:55:51 +00:00
|
|
|
|
2017-08-17 08:31:24 +00:00
|
|
|
not_null<ChatData*> _chat;
|
|
|
|
base::lambda<void(not_null<UserData*>)> _callback;
|
2017-08-01 15:55:51 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
class ChannelSearchFromController : public Profile::ParticipantsBoxController {
|
|
|
|
public:
|
2017-10-03 13:05:58 +00:00
|
|
|
ChannelSearchFromController(
|
2017-12-04 07:33:33 +00:00
|
|
|
not_null<Window::Navigation*> navigation,
|
2017-10-03 13:05:58 +00:00
|
|
|
not_null<ChannelData*> channel,
|
|
|
|
base::lambda<void(not_null<UserData*>)> callback);
|
2017-08-01 15:55:51 +00:00
|
|
|
|
|
|
|
void prepare() override;
|
2017-08-17 08:31:24 +00:00
|
|
|
void rowClicked(not_null<PeerListRow*> row) override;
|
2017-08-01 15:55:51 +00:00
|
|
|
|
|
|
|
protected:
|
2017-08-17 08:31:24 +00:00
|
|
|
std::unique_ptr<PeerListRow> createRow(not_null<UserData*> user) const override;
|
2017-08-01 15:55:51 +00:00
|
|
|
|
|
|
|
private:
|
2017-08-17 08:31:24 +00:00
|
|
|
base::lambda<void(not_null<UserData*>)> _callback;
|
2017-08-01 15:55:51 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Dialogs
|