2014-05-30 08:53:19 +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.
|
2014-05-30 08:53:19 +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
|
2014-05-30 08:53:19 +00:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2017-08-01 12:01:42 +00:00
|
|
|
#include "dialogs/dialogs_widget.h"
|
2018-01-04 19:54:35 +00:00
|
|
|
#include "dialogs/dialogs_key.h"
|
2018-02-16 15:46:24 +00:00
|
|
|
#include "data/data_messages.h"
|
2017-08-31 16:28:58 +00:00
|
|
|
#include "base/flags.h"
|
2016-05-19 12:03:51 +00:00
|
|
|
|
2016-04-09 18:45:55 +00:00
|
|
|
namespace Dialogs {
|
|
|
|
class Row;
|
|
|
|
class FakeRow;
|
|
|
|
class IndexedList;
|
|
|
|
} // namespace Dialogs
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2016-06-20 15:40:36 +00:00
|
|
|
namespace Ui {
|
2016-10-27 21:19:38 +00:00
|
|
|
class IconButton;
|
2016-10-26 16:43:13 +00:00
|
|
|
class PopupMenu;
|
2016-11-11 13:46:04 +00:00
|
|
|
class LinkButton;
|
2016-06-20 15:40:36 +00:00
|
|
|
} // namespace Ui
|
|
|
|
|
2017-03-27 12:24:38 +00:00
|
|
|
namespace Window {
|
|
|
|
class Controller;
|
|
|
|
} // namespace Window
|
|
|
|
|
2016-11-16 10:44:06 +00:00
|
|
|
class DialogsInner : public Ui::SplittedWidget, public RPCSender, private base::Subscriber {
|
2014-05-30 08:53:19 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2017-08-17 08:31:24 +00:00
|
|
|
DialogsInner(QWidget *parent, not_null<Window::Controller*> controller, QWidget *main);
|
2014-05-30 08:53:19 +00:00
|
|
|
|
|
|
|
void dialogsReceived(const QVector<MTPDialog> &dialogs);
|
2015-09-06 10:17:09 +00:00
|
|
|
void addSavedPeersAfter(const QDateTime &date);
|
2015-08-07 12:11:50 +00:00
|
|
|
void addAllSavedPeers();
|
2018-01-22 10:58:11 +00:00
|
|
|
bool searchReceived(
|
|
|
|
const QVector<MTPMessage> &result,
|
|
|
|
DialogsSearchRequestType type,
|
|
|
|
int fullCount);
|
|
|
|
void peerSearchReceived(
|
|
|
|
const QString &query,
|
|
|
|
const QVector<MTPPeer> &my,
|
|
|
|
const QVector<MTPPeer> &result);
|
2014-05-30 08:53:19 +00:00
|
|
|
void showMore(int32 pixels);
|
|
|
|
|
|
|
|
void activate();
|
|
|
|
|
|
|
|
void selectSkip(int32 direction);
|
|
|
|
void selectSkipPage(int32 pixels, int32 direction);
|
|
|
|
|
2018-01-05 15:57:18 +00:00
|
|
|
void createDialog(Dialogs::Key key);
|
|
|
|
void removeDialog(Dialogs::Key key);
|
2018-01-22 17:39:20 +00:00
|
|
|
void repaintDialogRow(Dialogs::Mode list, not_null<Dialogs::Row*> row);
|
2018-12-30 09:16:50 +00:00
|
|
|
void repaintDialogRow(Dialogs::RowDescriptor row);
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2016-12-04 19:40:41 +00:00
|
|
|
void dragLeft();
|
|
|
|
|
2014-05-30 08:53:19 +00:00
|
|
|
void clearFilter();
|
|
|
|
void refresh(bool toTop = false);
|
|
|
|
|
2018-01-07 12:04:34 +00:00
|
|
|
bool chooseRow();
|
2014-05-30 08:53:19 +00:00
|
|
|
|
|
|
|
void destroyData();
|
|
|
|
|
2018-11-16 13:36:42 +00:00
|
|
|
void scrollToEntry(const Dialogs::RowDescriptor &entry);
|
2014-08-22 07:41:39 +00:00
|
|
|
|
2016-04-09 18:45:55 +00:00
|
|
|
Dialogs::IndexedList *contactsList();
|
|
|
|
Dialogs::IndexedList *dialogsList();
|
2017-03-14 14:16:03 +00:00
|
|
|
Dialogs::IndexedList *contactsNoDialogsList();
|
2015-11-18 13:11:56 +00:00
|
|
|
int32 lastSearchDate() const;
|
|
|
|
PeerData *lastSearchPeer() const;
|
2014-08-22 07:41:39 +00:00
|
|
|
MsgId lastSearchId() const;
|
2015-11-18 13:11:56 +00:00
|
|
|
MsgId lastSearchMigratedId() const;
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2018-01-07 12:04:34 +00:00
|
|
|
enum class State {
|
|
|
|
Default,
|
|
|
|
Filtered,
|
2014-07-04 11:12:54 +00:00
|
|
|
};
|
|
|
|
State state() const;
|
2018-01-07 12:04:34 +00:00
|
|
|
bool waitingForSearch() const {
|
|
|
|
return _waitingForSearch;
|
|
|
|
}
|
2015-02-09 23:19:48 +00:00
|
|
|
bool hasFilteredResults() const;
|
2014-07-04 11:12:54 +00:00
|
|
|
|
2018-02-14 19:38:01 +00:00
|
|
|
void searchInChat(Dialogs::Key key, UserData *from);
|
2015-08-04 15:01:47 +00:00
|
|
|
|
2018-12-29 08:11:54 +00:00
|
|
|
void applyFilterUpdate(QString newFilter, bool force = false);
|
2015-06-15 17:19:24 +00:00
|
|
|
void onHashtagFilterUpdate(QStringRef newFilter);
|
2014-07-04 11:12:54 +00:00
|
|
|
|
2018-12-25 12:41:40 +00:00
|
|
|
PeerData *updateFromParentDrag(QPoint globalPosition);
|
2015-06-24 17:24:48 +00:00
|
|
|
|
2018-12-29 13:09:45 +00:00
|
|
|
void setLoadMoreCallback(Fn<void()> callback);
|
|
|
|
[[nodiscard]] rpl::producer<> listBottomReached() const;
|
2015-12-02 17:17:53 +00:00
|
|
|
|
2017-08-01 15:55:51 +00:00
|
|
|
base::Observable<UserData*> searchFromUserChanged;
|
|
|
|
|
2016-04-11 10:59:01 +00:00
|
|
|
void notify_historyMuteUpdated(History *history);
|
2015-12-13 11:17:15 +00:00
|
|
|
|
2015-09-29 13:24:39 +00:00
|
|
|
~DialogsInner();
|
2014-07-04 11:12:54 +00:00
|
|
|
|
2017-08-11 10:42:52 +00:00
|
|
|
public slots:
|
2014-05-30 08:53:19 +00:00
|
|
|
void onParentGeometryChanged();
|
2016-04-09 18:45:55 +00:00
|
|
|
void onDialogRowReplaced(Dialogs::Row *oldRow, Dialogs::Row *newRow);
|
2014-07-04 11:12:54 +00:00
|
|
|
|
2014-05-30 08:53:19 +00:00
|
|
|
signals:
|
2017-01-30 15:27:13 +00:00
|
|
|
void draggingScrollDelta(int delta);
|
2014-05-30 08:53:19 +00:00
|
|
|
void mustScrollTo(int scrollToTop, int scrollToBottom);
|
2015-09-24 16:05:06 +00:00
|
|
|
void dialogMoved(int movedFrom, int movedTo);
|
2014-07-04 11:12:54 +00:00
|
|
|
void searchMessages();
|
2018-11-20 12:40:54 +00:00
|
|
|
void clearSearchQuery();
|
2018-02-14 19:38:01 +00:00
|
|
|
void cancelSearchInChat();
|
2015-03-24 10:00:27 +00:00
|
|
|
void completeHashtag(QString tag);
|
2015-03-24 15:18:20 +00:00
|
|
|
void refreshHashtags();
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2015-09-29 13:24:39 +00:00
|
|
|
protected:
|
2017-09-13 16:57:44 +00:00
|
|
|
void visibleTopBottomUpdated(
|
|
|
|
int visibleTop,
|
|
|
|
int visibleBottom) override;
|
|
|
|
|
2016-12-01 19:20:33 +00:00
|
|
|
void paintRegion(Painter &p, const QRegion ®ion, bool paintingOther) override;
|
2016-12-04 19:40:41 +00:00
|
|
|
void mouseMoveEvent(QMouseEvent *e) override;
|
|
|
|
void mousePressEvent(QMouseEvent *e) override;
|
2016-12-05 11:01:08 +00:00
|
|
|
void mouseReleaseEvent(QMouseEvent *e) override;
|
2016-12-04 19:40:41 +00:00
|
|
|
void resizeEvent(QResizeEvent *e) override;
|
2017-02-11 11:24:37 +00:00
|
|
|
void enterEventHook(QEvent *e) override;
|
|
|
|
void leaveEventHook(QEvent *e) override;
|
2016-12-04 19:40:41 +00:00
|
|
|
void contextMenuEvent(QContextMenuEvent *e) override;
|
2015-09-29 13:24:39 +00:00
|
|
|
|
2014-05-30 08:53:19 +00:00
|
|
|
private:
|
2016-12-05 11:01:08 +00:00
|
|
|
struct ImportantSwitch;
|
2017-02-21 13:45:56 +00:00
|
|
|
using DialogsList = std::unique_ptr<Dialogs::IndexedList>;
|
2016-12-05 11:01:08 +00:00
|
|
|
using FilteredDialogs = QVector<Dialogs::Row*>;
|
2017-02-21 13:45:56 +00:00
|
|
|
using SearchResults = std::vector<std::unique_ptr<Dialogs::FakeRow>>;
|
2016-12-05 11:01:08 +00:00
|
|
|
struct HashtagResult;
|
2017-02-21 13:45:56 +00:00
|
|
|
using HashtagResults = std::vector<std::unique_ptr<HashtagResult>>;
|
2016-12-05 11:01:08 +00:00
|
|
|
struct PeerSearchResult;
|
2017-02-21 13:45:56 +00:00
|
|
|
using PeerSearchResults = std::vector<std::unique_ptr<PeerSearchResult>>;
|
2016-12-05 11:01:08 +00:00
|
|
|
|
2018-12-29 13:09:45 +00:00
|
|
|
enum class JumpSkip {
|
|
|
|
PreviousOrBegin,
|
|
|
|
NextOrEnd,
|
|
|
|
PreviousOrOriginal,
|
|
|
|
NextOrOriginal,
|
|
|
|
};
|
|
|
|
|
2018-01-07 12:04:34 +00:00
|
|
|
struct ChosenRow {
|
|
|
|
Dialogs::Key key;
|
2018-02-16 15:46:24 +00:00
|
|
|
Data::MessagePosition message;
|
2018-01-07 12:04:34 +00:00
|
|
|
};
|
|
|
|
bool switchImportantChats();
|
|
|
|
bool chooseHashtag();
|
|
|
|
ChosenRow computeChosenRow() const;
|
2018-11-21 06:43:49 +00:00
|
|
|
bool isSearchResultActive(
|
|
|
|
not_null<Dialogs::FakeRow*> result,
|
|
|
|
const Dialogs::RowDescriptor &entry) const;
|
2018-01-07 12:04:34 +00:00
|
|
|
|
2018-12-25 12:41:40 +00:00
|
|
|
void clearMouseSelection(bool clearSelection = false);
|
2018-01-04 09:21:06 +00:00
|
|
|
void userIsContactUpdated(not_null<UserData*> user);
|
2018-12-25 12:41:40 +00:00
|
|
|
void mousePressReleased(QPoint globalPosition, Qt::MouseButton button);
|
2016-12-05 11:01:08 +00:00
|
|
|
void clearIrrelevantState();
|
2018-12-25 12:41:40 +00:00
|
|
|
void selectByMouse(QPoint globalPosition);
|
2017-01-30 15:27:13 +00:00
|
|
|
void loadPeerPhotos();
|
2016-12-05 11:01:08 +00:00
|
|
|
void setImportantSwitchPressed(bool pressed);
|
|
|
|
void setPressed(Dialogs::Row *pressed);
|
|
|
|
void setHashtagPressed(int pressed);
|
|
|
|
void setFilteredPressed(int pressed);
|
|
|
|
void setPeerSearchPressed(int pressed);
|
|
|
|
void setSearchedPressed(int pressed);
|
|
|
|
bool isPressed() const {
|
2018-01-03 18:00:11 +00:00
|
|
|
return _importantSwitchPressed
|
|
|
|
|| _pressed
|
|
|
|
|| (_hashtagPressed >= 0)
|
|
|
|
|| (_filteredPressed >= 0)
|
|
|
|
|| (_peerSearchPressed >= 0)
|
|
|
|
|| (_searchedPressed >= 0);
|
2016-12-05 11:01:08 +00:00
|
|
|
}
|
|
|
|
bool isSelected() const {
|
2018-01-03 18:00:11 +00:00
|
|
|
return _importantSwitchSelected
|
|
|
|
|| _selected
|
|
|
|
|| (_hashtagSelected >= 0)
|
|
|
|
|| (_filteredSelected >= 0)
|
|
|
|
|| (_peerSearchSelected >= 0)
|
|
|
|
|| (_searchedSelected >= 0);
|
2016-12-05 11:01:08 +00:00
|
|
|
}
|
2018-01-03 18:00:11 +00:00
|
|
|
void handlePeerNameChange(
|
|
|
|
not_null<PeerData*> peer,
|
2018-01-22 09:33:09 +00:00
|
|
|
const base::flat_set<QChar> &oldLetters);
|
2018-10-09 15:36:06 +00:00
|
|
|
bool uniqueSearchResults() const;
|
|
|
|
bool hasHistoryInSearchResults(not_null<History*> history) const;
|
2018-01-03 18:00:11 +00:00
|
|
|
|
2018-11-16 13:36:42 +00:00
|
|
|
void setupShortcuts();
|
2018-11-16 15:12:39 +00:00
|
|
|
Dialogs::RowDescriptor computeJump(
|
2018-11-16 13:36:42 +00:00
|
|
|
const Dialogs::RowDescriptor &to,
|
2018-12-29 13:09:45 +00:00
|
|
|
JumpSkip skip);
|
2018-12-30 12:50:23 +00:00
|
|
|
bool jumpToDialogRow(Dialogs::RowDescriptor to);
|
2018-11-16 13:36:42 +00:00
|
|
|
|
|
|
|
Dialogs::RowDescriptor chatListEntryBefore(
|
|
|
|
const Dialogs::RowDescriptor &which) const;
|
|
|
|
Dialogs::RowDescriptor chatListEntryAfter(
|
|
|
|
const Dialogs::RowDescriptor &which) const;
|
|
|
|
Dialogs::RowDescriptor chatListEntryFirst() const;
|
|
|
|
Dialogs::RowDescriptor chatListEntryLast() const;
|
|
|
|
|
2018-01-03 18:00:11 +00:00
|
|
|
void applyDialog(const MTPDdialog &dialog);
|
2018-03-06 17:07:42 +00:00
|
|
|
// void applyFeedDialog(const MTPDdialogFeed &dialog); // #feed
|
2016-12-05 11:01:08 +00:00
|
|
|
|
2017-10-05 15:35:52 +00:00
|
|
|
void itemRemoved(not_null<const HistoryItem*> item);
|
2016-12-05 08:45:56 +00:00
|
|
|
enum class UpdateRowSection {
|
2017-09-03 18:36:06 +00:00
|
|
|
Default = (1 << 0),
|
|
|
|
Filtered = (1 << 1),
|
|
|
|
PeerSearch = (1 << 2),
|
|
|
|
MessageSearch = (1 << 3),
|
|
|
|
All = Default | Filtered | PeerSearch | MessageSearch,
|
2016-12-05 08:45:56 +00:00
|
|
|
};
|
2017-08-31 16:28:58 +00:00
|
|
|
using UpdateRowSections = base::flags<UpdateRowSection>;
|
|
|
|
friend inline constexpr auto is_flag_type(UpdateRowSection) { return true; };
|
|
|
|
|
2018-01-04 17:15:04 +00:00
|
|
|
void updateSearchResult(not_null<PeerData*> peer);
|
2018-01-03 18:00:11 +00:00
|
|
|
void updateDialogRow(
|
2018-01-22 16:42:25 +00:00
|
|
|
Dialogs::RowDescriptor row,
|
2018-12-30 08:40:25 +00:00
|
|
|
QRect updateRect = QRect(),
|
2018-01-03 18:00:11 +00:00
|
|
|
UpdateRowSections sections = UpdateRowSection::All);
|
2018-12-30 08:40:25 +00:00
|
|
|
void fillSupportSearchMenu(not_null<Ui::PopupMenu*> menu);
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2016-04-11 10:59:01 +00:00
|
|
|
int dialogsOffset() const;
|
2018-05-11 14:03:53 +00:00
|
|
|
int proxyPromotedCount() const;
|
|
|
|
int pinnedOffset() const;
|
2016-04-11 10:59:01 +00:00
|
|
|
int filteredOffset() const;
|
2016-12-05 11:01:08 +00:00
|
|
|
int peerSearchOffset() const;
|
2016-04-11 10:59:01 +00:00
|
|
|
int searchedOffset() const;
|
2018-02-14 19:38:01 +00:00
|
|
|
int searchInChatSkip() const;
|
2016-04-11 10:59:01 +00:00
|
|
|
|
2018-01-04 17:15:04 +00:00
|
|
|
void paintPeerSearchResult(
|
|
|
|
Painter &p,
|
|
|
|
not_null<const PeerSearchResult*> result,
|
|
|
|
int fullWidth,
|
|
|
|
bool active,
|
|
|
|
bool selected,
|
|
|
|
bool onlyBackground,
|
|
|
|
TimeMs ms) const;
|
2018-02-14 19:38:01 +00:00
|
|
|
void paintSearchInChat(
|
2018-01-04 17:15:04 +00:00
|
|
|
Painter &p,
|
|
|
|
int fullWidth,
|
|
|
|
bool onlyBackground,
|
|
|
|
TimeMs ms) const;
|
2018-02-14 19:38:01 +00:00
|
|
|
void paintSearchInPeer(
|
|
|
|
Painter &p,
|
|
|
|
not_null<PeerData*> peer,
|
|
|
|
int top,
|
|
|
|
int fullWidth,
|
|
|
|
const Text &text) const;
|
|
|
|
void paintSearchInSaved(
|
|
|
|
Painter &p,
|
|
|
|
int top,
|
|
|
|
int fullWidth,
|
|
|
|
const Text &text) const;
|
|
|
|
void paintSearchInFeed(
|
|
|
|
Painter &p,
|
|
|
|
not_null<Data::Feed*> feed,
|
|
|
|
int top,
|
|
|
|
int fullWidth,
|
|
|
|
const Text &text) const;
|
|
|
|
template <typename PaintUserpic>
|
2017-12-05 14:07:01 +00:00
|
|
|
void paintSearchInFilter(
|
|
|
|
Painter &p,
|
2018-02-14 19:38:01 +00:00
|
|
|
PaintUserpic paintUserpic,
|
2017-12-05 14:07:01 +00:00
|
|
|
int top,
|
|
|
|
int fullWidth,
|
2018-02-14 19:38:01 +00:00
|
|
|
const style::icon *icon,
|
2017-12-05 14:07:01 +00:00
|
|
|
const Text &text) const;
|
2018-02-14 19:38:01 +00:00
|
|
|
void refreshSearchInChatLabel();
|
2016-04-11 10:59:01 +00:00
|
|
|
|
|
|
|
void clearSelection();
|
2016-12-05 11:01:08 +00:00
|
|
|
void clearSearchResults(bool clearPeerSearchResults = true);
|
2018-01-05 15:57:18 +00:00
|
|
|
void updateSelectedRow(Dialogs::Key key = Dialogs::Key());
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2018-01-13 12:45:11 +00:00
|
|
|
Dialogs::IndexedList *shownDialogs() const;
|
2016-04-11 10:59:01 +00:00
|
|
|
|
2017-01-30 15:27:13 +00:00
|
|
|
void checkReorderPinnedStart(QPoint localPosition);
|
|
|
|
int shownPinnedCount() const;
|
|
|
|
int updateReorderIndexGetCount();
|
|
|
|
bool updateReorderPinned(QPoint localPosition);
|
|
|
|
void finishReorderPinned();
|
|
|
|
void stopReorderPinned();
|
|
|
|
int countPinnedIndex(Dialogs::Row *ofRow);
|
|
|
|
void savePinnedOrder();
|
|
|
|
void step_pinnedShifting(TimeMs ms, bool timer);
|
|
|
|
|
2017-08-17 08:31:24 +00:00
|
|
|
not_null<Window::Controller*> _controller;
|
2017-04-09 18:06:06 +00:00
|
|
|
|
2016-12-05 11:01:08 +00:00
|
|
|
DialogsList _dialogs;
|
|
|
|
DialogsList _dialogsImportant;
|
2016-04-11 10:59:01 +00:00
|
|
|
|
2016-12-05 11:01:08 +00:00
|
|
|
DialogsList _contactsNoDialogs;
|
|
|
|
DialogsList _contacts;
|
2016-04-11 10:59:01 +00:00
|
|
|
|
2016-12-05 11:01:08 +00:00
|
|
|
bool _mouseSelection = false;
|
2018-12-25 12:41:40 +00:00
|
|
|
std::optional<QPoint> _lastMousePosition;
|
2016-12-05 11:01:08 +00:00
|
|
|
Qt::MouseButton _pressButton = Qt::LeftButton;
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2017-02-21 13:45:56 +00:00
|
|
|
std::unique_ptr<ImportantSwitch> _importantSwitch;
|
2016-12-05 11:01:08 +00:00
|
|
|
bool _importantSwitchSelected = false;
|
|
|
|
bool _importantSwitchPressed = false;
|
|
|
|
Dialogs::Row *_selected = nullptr;
|
|
|
|
Dialogs::Row *_pressed = nullptr;
|
|
|
|
|
2017-01-30 15:27:13 +00:00
|
|
|
Dialogs::Row *_dragging = nullptr;
|
|
|
|
int _draggingIndex = -1;
|
|
|
|
int _aboveIndex = -1;
|
|
|
|
QPoint _dragStart;
|
|
|
|
struct PinnedRow {
|
|
|
|
anim::value yadd;
|
|
|
|
TimeMs animStartTime = 0;
|
|
|
|
};
|
2017-02-21 13:45:56 +00:00
|
|
|
std::vector<PinnedRow> _pinnedRows;
|
2017-01-30 15:27:13 +00:00
|
|
|
BasicAnimation _a_pinnedShifting;
|
2018-01-04 19:54:35 +00:00
|
|
|
std::deque<Dialogs::Key> _pinnedOrder;
|
2017-01-30 15:27:13 +00:00
|
|
|
|
|
|
|
// Remember the last currently dragged row top shift for updating area.
|
|
|
|
int _aboveTopShift = -1;
|
|
|
|
|
|
|
|
int _visibleTop = 0;
|
|
|
|
int _visibleBottom = 0;
|
2015-11-18 13:11:56 +00:00
|
|
|
QString _filter, _hashtagFilter;
|
2015-03-24 10:00:27 +00:00
|
|
|
|
2016-12-05 11:01:08 +00:00
|
|
|
HashtagResults _hashtagResults;
|
|
|
|
int _hashtagSelected = -1;
|
|
|
|
int _hashtagPressed = -1;
|
|
|
|
bool _hashtagDeleteSelected = false;
|
|
|
|
bool _hashtagDeletePressed = false;
|
2015-03-24 10:00:27 +00:00
|
|
|
|
2015-11-18 13:11:56 +00:00
|
|
|
FilteredDialogs _filterResults;
|
2018-01-22 10:58:11 +00:00
|
|
|
base::flat_map<
|
|
|
|
not_null<PeerData*>,
|
|
|
|
std::unique_ptr<Dialogs::Row>> _filterResultsGlobal;
|
2016-12-05 11:01:08 +00:00
|
|
|
int _filteredSelected = -1;
|
|
|
|
int _filteredPressed = -1;
|
|
|
|
|
2018-01-07 12:04:34 +00:00
|
|
|
bool _waitingForSearch = false;
|
|
|
|
|
2016-12-05 11:01:08 +00:00
|
|
|
QString _peerSearchQuery;
|
|
|
|
PeerSearchResults _peerSearchResults;
|
|
|
|
int _peerSearchSelected = -1;
|
|
|
|
int _peerSearchPressed = -1;
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2015-11-18 13:11:56 +00:00
|
|
|
SearchResults _searchResults;
|
2016-04-09 18:45:55 +00:00
|
|
|
int _searchedCount = 0;
|
|
|
|
int _searchedMigratedCount = 0;
|
2016-12-05 11:01:08 +00:00
|
|
|
int _searchedSelected = -1;
|
|
|
|
int _searchedPressed = -1;
|
2014-10-22 18:39:03 +00:00
|
|
|
|
2016-04-09 18:45:55 +00:00
|
|
|
int _lastSearchDate = 0;
|
|
|
|
PeerData *_lastSearchPeer = nullptr;
|
|
|
|
MsgId _lastSearchId = 0;
|
|
|
|
MsgId _lastSearchMigratedId = 0;
|
2014-08-22 07:41:39 +00:00
|
|
|
|
2018-01-07 12:04:34 +00:00
|
|
|
State _state = State::Default;
|
2014-07-04 11:12:54 +00:00
|
|
|
|
2016-12-13 17:07:56 +00:00
|
|
|
object_ptr<Ui::LinkButton> _addContactLnk;
|
2018-02-14 19:38:01 +00:00
|
|
|
object_ptr<Ui::IconButton> _cancelSearchInChat;
|
2017-08-06 20:07:51 +00:00
|
|
|
object_ptr<Ui::IconButton> _cancelSearchFromUser;
|
2014-11-25 12:15:29 +00:00
|
|
|
|
2018-02-14 19:38:01 +00:00
|
|
|
Dialogs::Key _searchInChat;
|
|
|
|
History *_searchInMigrated = nullptr;
|
2017-08-01 15:55:51 +00:00
|
|
|
UserData *_searchFromUser = nullptr;
|
2018-02-14 19:38:01 +00:00
|
|
|
Text _searchInChatText;
|
2017-08-06 20:07:51 +00:00
|
|
|
Text _searchFromUserText;
|
2018-12-30 08:40:25 +00:00
|
|
|
Dialogs::RowDescriptor _menuRow;
|
2015-12-02 17:17:53 +00:00
|
|
|
|
2018-06-04 15:35:11 +00:00
|
|
|
Fn<void()> _loadMoreCallback;
|
2018-12-29 13:09:45 +00:00
|
|
|
rpl::event_stream<> _listBottomReached;
|
2016-12-05 11:01:08 +00:00
|
|
|
|
2017-11-07 15:12:54 +00:00
|
|
|
base::unique_qptr<Ui::PopupMenu> _menu;
|
|
|
|
|
2014-05-30 08:53:19 +00:00
|
|
|
};
|