2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Move chats / contacts lists to Data::Session.

This commit is contained in:
John Preston
2019-04-16 18:05:56 +04:00
parent 2862070348
commit 0c0d6bc411
25 changed files with 441 additions and 496 deletions

View File

@@ -11,6 +11,12 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "dialogs/dialogs_key.h"
class AuthSession;
namespace Data {
class Session;
} // namespace Data
namespace Dialogs {
class Row;
@@ -29,17 +35,20 @@ enum class Mode {
};
struct PositionChange {
int movedFrom;
int movedTo;
int from = -1;
int to = -1;
};
class Entry {
public:
Entry(const Key &key);
Entry(not_null<Data::Session*> owner, const Key &key);
Entry(const Entry &other) = delete;
Entry &operator=(const Entry &other) = delete;
virtual ~Entry() = default;
Data::Session &owner() const;
AuthSession &session() const;
PositionChange adjustByPosInChatList(
Mode list,
not_null<IndexedList*> indexed);
@@ -116,6 +125,7 @@ private:
const RowsByLetter &chatListLinks(Mode list) const;
Row *mainChatListLink(Mode list) const;
not_null<Data::Session*> _owner;
Dialogs::Key _key;
RowsByLetter _chatListLinks[2];
uint64 _sortKeyInChatList = 0;