2018-01-04 10:22:53 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
|
|
|
the official desktop application for the Telegram messaging service.
|
|
|
|
|
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2018-08-29 13:23:16 +00:00
|
|
|
#include "storage/storage_databases.h"
|
2018-01-04 19:54:35 +00:00
|
|
|
#include "dialogs/dialogs_key.h"
|
2019-04-16 14:05:56 +00:00
|
|
|
#include "dialogs/dialogs_indexed_list.h"
|
2019-04-22 14:22:39 +00:00
|
|
|
#include "dialogs/dialogs_main_list.h"
|
2018-01-14 16:02:25 +00:00
|
|
|
#include "data/data_groups.h"
|
2020-06-08 17:24:36 +00:00
|
|
|
#include "data/data_cloud_file.h"
|
2018-10-11 15:54:57 +00:00
|
|
|
#include "history/history_location_manager.h"
|
2018-04-09 17:48:29 +00:00
|
|
|
#include "base/timer.h"
|
2019-08-09 19:19:23 +00:00
|
|
|
#include "base/flags.h"
|
2018-01-04 10:22:53 +00:00
|
|
|
|
2019-01-16 12:25:29 +00:00
|
|
|
class Image;
|
2018-01-14 16:02:25 +00:00
|
|
|
class HistoryItem;
|
2018-10-24 11:52:31 +00:00
|
|
|
struct WebPageCollage;
|
2023-10-19 07:05:39 +00:00
|
|
|
enum class WebPageType : uint8;
|
2019-04-25 12:45:15 +00:00
|
|
|
enum class NewMessageType;
|
2018-01-14 16:02:25 +00:00
|
|
|
|
|
|
|
namespace HistoryView {
|
|
|
|
struct Group;
|
|
|
|
class Element;
|
2019-05-14 09:50:44 +00:00
|
|
|
class ElementDelegate;
|
2018-01-14 16:02:25 +00:00
|
|
|
} // namespace HistoryView
|
2018-01-11 19:33:26 +00:00
|
|
|
|
2019-07-24 11:45:24 +00:00
|
|
|
namespace Main {
|
|
|
|
class Session;
|
|
|
|
} // namespace Main
|
2018-01-17 16:21:01 +00:00
|
|
|
|
2019-09-18 11:19:05 +00:00
|
|
|
namespace Ui {
|
|
|
|
class BoxContent;
|
|
|
|
} // namespace Ui
|
|
|
|
|
2018-07-10 16:41:11 +00:00
|
|
|
namespace Passport {
|
|
|
|
struct SavedCredentials;
|
|
|
|
} // namespace Passport
|
|
|
|
|
2018-01-04 10:22:53 +00:00
|
|
|
namespace Data {
|
|
|
|
|
2019-04-15 11:54:03 +00:00
|
|
|
class Folder;
|
2019-06-21 12:27:46 +00:00
|
|
|
class LocationPoint;
|
2019-01-28 13:59:49 +00:00
|
|
|
class WallPaper;
|
2019-08-08 14:13:26 +00:00
|
|
|
class ScheduledMessages;
|
2021-08-30 19:35:16 +00:00
|
|
|
class SendActionManager;
|
2021-09-26 18:24:47 +00:00
|
|
|
class SponsoredMessages;
|
2021-12-07 11:11:27 +00:00
|
|
|
class Reactions;
|
2022-08-30 15:21:14 +00:00
|
|
|
class EmojiStatuses;
|
2022-10-21 17:13:13 +00:00
|
|
|
class ForumIcons;
|
2020-02-07 16:07:21 +00:00
|
|
|
class ChatFilters;
|
2019-09-03 15:24:51 +00:00
|
|
|
class CloudThemes;
|
2019-12-28 14:56:06 +00:00
|
|
|
class Streaming;
|
2020-02-05 15:27:53 +00:00
|
|
|
class MediaRotation;
|
2020-02-18 11:39:24 +00:00
|
|
|
class Histories;
|
2020-05-26 14:32:38 +00:00
|
|
|
class DocumentMedia;
|
|
|
|
class PhotoMedia;
|
2020-06-08 17:24:36 +00:00
|
|
|
class Stickers;
|
2020-11-24 11:56:46 +00:00
|
|
|
class GroupCall;
|
2022-04-01 10:18:07 +00:00
|
|
|
class NotifySettings;
|
2022-06-23 13:52:15 +00:00
|
|
|
class CustomEmojiManager;
|
2023-05-03 18:30:37 +00:00
|
|
|
class Stories;
|
2019-01-03 12:36:01 +00:00
|
|
|
|
2022-10-07 11:46:27 +00:00
|
|
|
struct RepliesReadTillUpdate {
|
|
|
|
FullMsgId id;
|
|
|
|
MsgId readTillId;
|
|
|
|
bool out = false;
|
|
|
|
};
|
|
|
|
|
2018-01-04 10:22:53 +00:00
|
|
|
class Session final {
|
|
|
|
public:
|
2018-01-14 16:02:25 +00:00
|
|
|
using ViewElement = HistoryView::Element;
|
|
|
|
|
2019-04-25 12:45:15 +00:00
|
|
|
struct SentData {
|
|
|
|
PeerId peerId = 0;
|
|
|
|
QString text;
|
|
|
|
};
|
|
|
|
|
2019-07-24 11:45:24 +00:00
|
|
|
explicit Session(not_null<Main::Session*> session);
|
2018-01-04 10:22:53 +00:00
|
|
|
~Session();
|
|
|
|
|
2019-07-24 11:45:24 +00:00
|
|
|
[[nodiscard]] Main::Session &session() const {
|
2018-01-23 16:51:12 +00:00
|
|
|
return *_session;
|
|
|
|
}
|
|
|
|
|
2021-02-19 11:54:27 +00:00
|
|
|
[[nodiscard]] QString nameSortKey(const QString &name) const;
|
|
|
|
|
2019-08-08 14:13:26 +00:00
|
|
|
[[nodiscard]] Groups &groups() {
|
|
|
|
return _groups;
|
|
|
|
}
|
|
|
|
[[nodiscard]] const Groups &groups() const {
|
|
|
|
return _groups;
|
|
|
|
}
|
2020-02-07 16:07:21 +00:00
|
|
|
[[nodiscard]] ChatFilters &chatsFilters() const {
|
|
|
|
return *_chatsFilters;
|
|
|
|
}
|
2019-08-08 17:07:55 +00:00
|
|
|
[[nodiscard]] ScheduledMessages &scheduledMessages() const {
|
|
|
|
return *_scheduledMessages;
|
2019-08-08 14:13:26 +00:00
|
|
|
}
|
2021-08-30 19:35:16 +00:00
|
|
|
[[nodiscard]] SendActionManager &sendActionManager() const {
|
|
|
|
return *_sendActionManager;
|
|
|
|
}
|
2019-09-03 15:24:51 +00:00
|
|
|
[[nodiscard]] CloudThemes &cloudThemes() const {
|
|
|
|
return *_cloudThemes;
|
|
|
|
}
|
2019-12-28 14:56:06 +00:00
|
|
|
[[nodiscard]] Streaming &streaming() const {
|
|
|
|
return *_streaming;
|
|
|
|
}
|
2020-02-05 15:27:53 +00:00
|
|
|
[[nodiscard]] MediaRotation &mediaRotation() const {
|
|
|
|
return *_mediaRotation;
|
|
|
|
}
|
2020-02-18 11:39:24 +00:00
|
|
|
[[nodiscard]] Histories &histories() const {
|
|
|
|
return *_histories;
|
|
|
|
}
|
2020-06-08 17:24:36 +00:00
|
|
|
[[nodiscard]] Stickers &stickers() const {
|
|
|
|
return *_stickers;
|
|
|
|
}
|
2021-09-26 18:24:47 +00:00
|
|
|
[[nodiscard]] SponsoredMessages &sponsoredMessages() const {
|
|
|
|
return *_sponsoredMessages;
|
|
|
|
}
|
2021-12-07 11:11:27 +00:00
|
|
|
[[nodiscard]] Reactions &reactions() const {
|
|
|
|
return *_reactions;
|
|
|
|
}
|
2022-08-30 15:21:14 +00:00
|
|
|
[[nodiscard]] EmojiStatuses &emojiStatuses() const {
|
|
|
|
return *_emojiStatuses;
|
|
|
|
}
|
2022-10-21 17:13:13 +00:00
|
|
|
[[nodiscard]] ForumIcons &forumIcons() const {
|
|
|
|
return *_forumIcons;
|
|
|
|
}
|
2022-04-01 10:18:07 +00:00
|
|
|
[[nodiscard]] NotifySettings ¬ifySettings() const {
|
|
|
|
return *_notifySettings;
|
|
|
|
}
|
2022-06-23 13:52:15 +00:00
|
|
|
[[nodiscard]] CustomEmojiManager &customEmojiManager() const {
|
|
|
|
return *_customEmojiManager;
|
|
|
|
}
|
2023-05-03 18:30:37 +00:00
|
|
|
[[nodiscard]] Stories &stories() const {
|
|
|
|
return *_stories;
|
|
|
|
}
|
2021-12-07 11:11:27 +00:00
|
|
|
|
2019-08-28 18:20:49 +00:00
|
|
|
[[nodiscard]] MsgId nextNonHistoryEntryId() {
|
|
|
|
return ++_nonHistoryEntryId;
|
|
|
|
}
|
2019-08-08 14:13:26 +00:00
|
|
|
|
2022-11-02 16:59:12 +00:00
|
|
|
void subscribeForTopicRepliesLists();
|
2019-01-03 12:36:01 +00:00
|
|
|
void clear();
|
|
|
|
|
2020-05-26 14:32:38 +00:00
|
|
|
void keepAlive(std::shared_ptr<PhotoMedia> media);
|
|
|
|
void keepAlive(std::shared_ptr<DocumentMedia> media);
|
|
|
|
|
2018-06-22 23:18:43 +00:00
|
|
|
void suggestStartExport(TimeId availableAt);
|
2018-06-28 17:44:07 +00:00
|
|
|
void clearExportSuggestion();
|
2018-06-20 00:02:36 +00:00
|
|
|
|
2019-02-25 17:26:08 +00:00
|
|
|
[[nodiscard]] auto passportCredentials() const
|
|
|
|
-> const Passport::SavedCredentials*;
|
2018-07-10 16:41:11 +00:00
|
|
|
void rememberPassportCredentials(
|
|
|
|
Passport::SavedCredentials data,
|
2019-02-19 06:57:53 +00:00
|
|
|
crl::time rememberFor);
|
2018-07-10 16:41:11 +00:00
|
|
|
void forgetPassportCredentials();
|
|
|
|
|
2019-02-25 17:26:08 +00:00
|
|
|
[[nodiscard]] Storage::Cache::Database &cache();
|
|
|
|
[[nodiscard]] Storage::Cache::Database &cacheBigFile();
|
2018-08-27 11:35:58 +00:00
|
|
|
|
2019-01-03 12:36:01 +00:00
|
|
|
[[nodiscard]] not_null<PeerData*> peer(PeerId id);
|
2019-01-18 12:27:37 +00:00
|
|
|
[[nodiscard]] not_null<PeerData*> peer(UserId id) = delete;
|
2019-01-03 12:36:01 +00:00
|
|
|
[[nodiscard]] not_null<UserData*> user(UserId id);
|
|
|
|
[[nodiscard]] not_null<ChatData*> chat(ChatId id);
|
|
|
|
[[nodiscard]] not_null<ChannelData*> channel(ChannelId id);
|
2019-01-18 12:27:37 +00:00
|
|
|
[[nodiscard]] not_null<UserData*> user(PeerId id) = delete;
|
|
|
|
[[nodiscard]] not_null<ChatData*> chat(PeerId id) = delete;
|
|
|
|
[[nodiscard]] not_null<ChannelData*> channel(PeerId id) = delete;
|
2019-01-03 12:36:01 +00:00
|
|
|
|
|
|
|
[[nodiscard]] PeerData *peerLoaded(PeerId id) const;
|
2019-01-18 12:27:37 +00:00
|
|
|
[[nodiscard]] PeerData *peerLoaded(UserId id) const = delete;
|
2019-01-03 12:36:01 +00:00
|
|
|
[[nodiscard]] UserData *userLoaded(UserId id) const;
|
|
|
|
[[nodiscard]] ChatData *chatLoaded(ChatId id) const;
|
|
|
|
[[nodiscard]] ChannelData *channelLoaded(ChannelId id) const;
|
2019-01-18 12:27:37 +00:00
|
|
|
[[nodiscard]] UserData *userLoaded(PeerId id) const = delete;
|
|
|
|
[[nodiscard]] ChatData *chatLoaded(PeerId id) const = delete;
|
|
|
|
[[nodiscard]] ChannelData *channelLoaded(PeerId id) const = delete;
|
2019-01-03 12:36:01 +00:00
|
|
|
|
2019-01-18 12:27:37 +00:00
|
|
|
not_null<UserData*> processUser(const MTPUser &data);
|
|
|
|
not_null<PeerData*> processChat(const MTPChat &data);
|
2019-01-03 12:36:01 +00:00
|
|
|
|
|
|
|
// Returns last user, if there were any.
|
|
|
|
UserData *processUsers(const MTPVector<MTPUser> &data);
|
|
|
|
PeerData *processChats(const MTPVector<MTPChat> &data);
|
|
|
|
|
2019-01-13 08:03:34 +00:00
|
|
|
void applyMaximumChatVersions(const MTPVector<MTPChat> &data);
|
|
|
|
|
2020-11-24 11:56:46 +00:00
|
|
|
void registerGroupCall(not_null<GroupCall*> call);
|
|
|
|
void unregisterGroupCall(not_null<GroupCall*> call);
|
2021-10-24 21:33:53 +00:00
|
|
|
GroupCall *groupCall(CallId callId) const;
|
2020-11-24 11:56:46 +00:00
|
|
|
|
2022-10-24 07:22:26 +00:00
|
|
|
void watchForOffline(not_null<UserData*> user, TimeId now = 0);
|
|
|
|
void maybeStopWatchForOffline(not_null<UserData*> user);
|
|
|
|
|
2021-10-24 21:33:53 +00:00
|
|
|
[[nodiscard]] auto invitedToCallUsers(CallId callId) const
|
2020-11-28 18:17:13 +00:00
|
|
|
-> const base::flat_set<not_null<UserData*>> &;
|
|
|
|
void registerInvitedToCallUser(
|
2021-10-24 21:33:53 +00:00
|
|
|
CallId callId,
|
2020-12-14 12:52:18 +00:00
|
|
|
not_null<PeerData*> peer,
|
2020-11-28 18:17:13 +00:00
|
|
|
not_null<UserData*> user);
|
2021-10-24 21:33:53 +00:00
|
|
|
void unregisterInvitedToCallUser(CallId callId, not_null<UserData*> user);
|
2020-11-28 18:17:13 +00:00
|
|
|
|
2020-12-16 11:58:53 +00:00
|
|
|
struct InviteToCall {
|
2021-10-24 21:33:53 +00:00
|
|
|
CallId id = 0;
|
2020-12-16 11:58:53 +00:00
|
|
|
not_null<UserData*> user;
|
|
|
|
};
|
|
|
|
[[nodiscard]] rpl::producer<InviteToCall> invitesToCalls() const {
|
|
|
|
return _invitesToCalls.events();
|
|
|
|
}
|
|
|
|
|
2019-01-03 12:36:01 +00:00
|
|
|
void enumerateUsers(Fn<void(not_null<UserData*>)> action) const;
|
|
|
|
void enumerateGroups(Fn<void(not_null<PeerData*>)> action) const;
|
2022-04-06 15:23:41 +00:00
|
|
|
void enumerateBroadcasts(Fn<void(not_null<ChannelData*>)> action) const;
|
2022-03-01 11:44:29 +00:00
|
|
|
[[nodiscard]] UserData *userByPhone(const QString &phone) const;
|
2019-01-03 12:36:01 +00:00
|
|
|
[[nodiscard]] PeerData *peerByUsername(const QString &username) const;
|
|
|
|
|
2019-01-18 12:27:37 +00:00
|
|
|
[[nodiscard]] not_null<History*> history(PeerId peerId);
|
|
|
|
[[nodiscard]] History *historyLoaded(PeerId peerId) const;
|
|
|
|
[[nodiscard]] not_null<History*> history(UserId userId) = delete;
|
|
|
|
[[nodiscard]] History *historyLoaded(UserId userId) const = delete;
|
|
|
|
[[nodiscard]] not_null<History*> history(not_null<const PeerData*> peer);
|
|
|
|
[[nodiscard]] History *historyLoaded(const PeerData *peer);
|
2019-01-03 12:36:01 +00:00
|
|
|
|
2019-03-25 11:49:57 +00:00
|
|
|
void deleteConversationLocally(not_null<PeerData*> peer);
|
|
|
|
|
2019-04-18 08:28:43 +00:00
|
|
|
[[nodiscard]] rpl::variable<bool> &contactsLoaded() {
|
2018-01-04 10:22:53 +00:00
|
|
|
return _contactsLoaded;
|
|
|
|
}
|
2022-11-08 13:57:54 +00:00
|
|
|
[[nodiscard]] rpl::producer<Folder*> chatsListChanges() const {
|
2019-04-18 08:28:43 +00:00
|
|
|
return _chatsListChanged.events();
|
2018-01-04 10:22:53 +00:00
|
|
|
}
|
2022-11-08 13:57:54 +00:00
|
|
|
[[nodiscard]] bool chatsListLoaded(Folder *folder = nullptr);
|
|
|
|
[[nodiscard]] rpl::producer<Folder*> chatsListLoadedEvents() const {
|
2019-04-18 08:28:43 +00:00
|
|
|
return _chatsListLoadedEvents.events();
|
2018-01-04 10:22:53 +00:00
|
|
|
}
|
2019-04-18 08:28:43 +00:00
|
|
|
void chatsListChanged(FolderId folderId);
|
2022-11-08 13:57:54 +00:00
|
|
|
void chatsListChanged(Folder *folder);
|
|
|
|
void chatsListDone(Folder *folder);
|
2018-01-14 16:02:25 +00:00
|
|
|
|
2020-06-10 18:08:17 +00:00
|
|
|
void userIsBotChanged(not_null<UserData*> user);
|
|
|
|
[[nodiscard]] rpl::producer<not_null<UserData*>> userIsBotChanges() const;
|
2021-07-01 11:05:15 +00:00
|
|
|
void botCommandsChanged(not_null<PeerData*> peer);
|
|
|
|
[[nodiscard]] rpl::producer<not_null<PeerData*>> botCommandsChanges() const;
|
2020-06-10 18:08:17 +00:00
|
|
|
|
2018-01-04 10:22:53 +00:00
|
|
|
struct ItemVisibilityQuery {
|
|
|
|
not_null<HistoryItem*> item;
|
|
|
|
not_null<bool*> isVisible;
|
|
|
|
};
|
2022-03-09 10:52:44 +00:00
|
|
|
[[nodiscard]] bool queryItemVisibility(not_null<HistoryItem*> item) const;
|
|
|
|
[[nodiscard]] rpl::producer<ItemVisibilityQuery> itemVisibilityQueries() const;
|
|
|
|
void itemVisibilitiesUpdated();
|
|
|
|
|
2018-01-14 16:02:25 +00:00
|
|
|
struct IdChange {
|
2022-10-04 15:34:45 +00:00
|
|
|
FullMsgId newId;
|
2018-01-14 16:02:25 +00:00
|
|
|
MsgId oldId = 0;
|
|
|
|
};
|
2018-01-17 18:20:55 +00:00
|
|
|
void notifyItemIdChange(IdChange event);
|
2018-03-07 13:53:12 +00:00
|
|
|
[[nodiscard]] rpl::producer<IdChange> itemIdChanged() const;
|
2018-01-21 19:52:44 +00:00
|
|
|
void notifyItemLayoutChange(not_null<const HistoryItem*> item);
|
2018-03-07 13:53:12 +00:00
|
|
|
[[nodiscard]] rpl::producer<not_null<const HistoryItem*>> itemLayoutChanged() const;
|
2018-01-17 18:20:55 +00:00
|
|
|
void notifyViewLayoutChange(not_null<const ViewElement*> view);
|
2018-03-07 13:53:12 +00:00
|
|
|
[[nodiscard]] rpl::producer<not_null<const ViewElement*>> viewLayoutChanged() const;
|
2021-07-19 10:02:36 +00:00
|
|
|
void notifyNewItemAdded(not_null<HistoryItem*> item);
|
|
|
|
[[nodiscard]] rpl::producer<not_null<HistoryItem*>> newItemAdded() const;
|
2018-01-18 11:46:45 +00:00
|
|
|
void requestItemRepaint(not_null<const HistoryItem*> item);
|
2018-03-07 13:53:12 +00:00
|
|
|
[[nodiscard]] rpl::producer<not_null<const HistoryItem*>> itemRepaintRequest() const;
|
2018-01-14 16:02:25 +00:00
|
|
|
void requestViewRepaint(not_null<const ViewElement*> view);
|
2018-03-07 13:53:12 +00:00
|
|
|
[[nodiscard]] rpl::producer<not_null<const ViewElement*>> viewRepaintRequest() const;
|
2018-01-18 11:46:45 +00:00
|
|
|
void requestItemResize(not_null<const HistoryItem*> item);
|
2018-03-07 13:53:12 +00:00
|
|
|
[[nodiscard]] rpl::producer<not_null<const HistoryItem*>> itemResizeRequest() const;
|
2018-01-18 11:46:45 +00:00
|
|
|
void requestViewResize(not_null<ViewElement*> view);
|
2018-03-07 13:53:12 +00:00
|
|
|
[[nodiscard]] rpl::producer<not_null<ViewElement*>> viewResizeRequest() const;
|
2018-01-18 13:59:22 +00:00
|
|
|
void requestItemViewRefresh(not_null<HistoryItem*> item);
|
2018-03-07 13:53:12 +00:00
|
|
|
[[nodiscard]] rpl::producer<not_null<HistoryItem*>> itemViewRefreshRequest() const;
|
2018-03-13 10:19:06 +00:00
|
|
|
void requestItemTextRefresh(not_null<HistoryItem*> item);
|
2022-01-28 11:44:33 +00:00
|
|
|
void requestUnreadReactionsAnimation(not_null<HistoryItem*> item);
|
2018-01-17 18:20:55 +00:00
|
|
|
void notifyHistoryUnloaded(not_null<const History*> history);
|
2018-03-07 13:53:12 +00:00
|
|
|
[[nodiscard]] rpl::producer<not_null<const History*>> historyUnloaded() const;
|
2019-09-12 10:35:04 +00:00
|
|
|
void notifyItemDataChange(not_null<HistoryItem*> item);
|
|
|
|
[[nodiscard]] rpl::producer<not_null<HistoryItem*>> itemDataChanges() const;
|
2018-01-14 16:02:25 +00:00
|
|
|
|
2018-03-07 13:53:12 +00:00
|
|
|
[[nodiscard]] rpl::producer<not_null<const HistoryItem*>> itemRemoved() const;
|
2020-10-20 20:25:42 +00:00
|
|
|
[[nodiscard]] rpl::producer<not_null<const HistoryItem*>> itemRemoved(
|
|
|
|
FullMsgId itemId) const;
|
2018-03-09 11:44:42 +00:00
|
|
|
void notifyViewRemoved(not_null<const ViewElement*> view);
|
|
|
|
[[nodiscard]] rpl::producer<not_null<const ViewElement*>> viewRemoved() const;
|
2018-01-17 18:20:55 +00:00
|
|
|
void notifyHistoryCleared(not_null<const History*> history);
|
2018-03-07 13:53:12 +00:00
|
|
|
[[nodiscard]] rpl::producer<not_null<const History*>> historyCleared() const;
|
2018-01-18 11:46:45 +00:00
|
|
|
void notifyHistoryChangeDelayed(not_null<History*> history);
|
2018-03-07 13:53:12 +00:00
|
|
|
[[nodiscard]] rpl::producer<not_null<History*>> historyChanged() const;
|
2018-01-18 09:53:49 +00:00
|
|
|
void sendHistoryChangeNotifications();
|
2018-01-17 18:20:55 +00:00
|
|
|
|
2020-06-08 17:24:36 +00:00
|
|
|
void notifyPinnedDialogsOrderUpdated();
|
|
|
|
[[nodiscard]] rpl::producer<> pinnedDialogsOrderUpdated() const;
|
|
|
|
|
2023-10-03 14:22:59 +00:00
|
|
|
void registerHighlightProcess(
|
|
|
|
uint64 processId,
|
|
|
|
not_null<HistoryItem*> item);
|
|
|
|
|
2019-05-14 09:50:44 +00:00
|
|
|
void registerHeavyViewPart(not_null<ViewElement*> view);
|
|
|
|
void unregisterHeavyViewPart(not_null<ViewElement*> view);
|
|
|
|
void unloadHeavyViewParts(
|
|
|
|
not_null<HistoryView::ElementDelegate*> delegate);
|
|
|
|
void unloadHeavyViewParts(
|
|
|
|
not_null<HistoryView::ElementDelegate*> delegate,
|
|
|
|
int from,
|
|
|
|
int till);
|
|
|
|
|
2022-09-21 14:55:27 +00:00
|
|
|
void registerShownSpoiler(not_null<ViewElement*> view);
|
2021-12-29 15:26:25 +00:00
|
|
|
void hideShownSpoilers();
|
|
|
|
|
2018-01-04 10:22:53 +00:00
|
|
|
using MegagroupParticipant = std::tuple<
|
|
|
|
not_null<ChannelData*>,
|
|
|
|
not_null<UserData*>>;
|
|
|
|
void removeMegagroupParticipant(
|
|
|
|
not_null<ChannelData*> channel,
|
|
|
|
not_null<UserData*> user);
|
2018-03-07 13:53:12 +00:00
|
|
|
[[nodiscard]] rpl::producer<MegagroupParticipant> megagroupParticipantRemoved() const;
|
|
|
|
[[nodiscard]] rpl::producer<not_null<UserData*>> megagroupParticipantRemoved(
|
2018-01-04 10:22:53 +00:00
|
|
|
not_null<ChannelData*> channel) const;
|
|
|
|
void addNewMegagroupParticipant(
|
|
|
|
not_null<ChannelData*> channel,
|
|
|
|
not_null<UserData*> user);
|
2018-03-07 13:53:12 +00:00
|
|
|
[[nodiscard]] rpl::producer<MegagroupParticipant> megagroupParticipantAdded() const;
|
|
|
|
[[nodiscard]] rpl::producer<not_null<UserData*>> megagroupParticipantAdded(
|
2018-01-04 10:22:53 +00:00
|
|
|
not_null<ChannelData*> channel) const;
|
|
|
|
|
|
|
|
HistoryItemsList idsToItems(const MessageIdsList &ids) const;
|
|
|
|
MessageIdsList itemsToIds(const HistoryItemsList &items) const;
|
2018-01-11 15:51:59 +00:00
|
|
|
MessageIdsList itemOrItsGroup(not_null<HistoryItem*> item) const;
|
2018-01-04 10:22:53 +00:00
|
|
|
|
2019-01-13 08:03:34 +00:00
|
|
|
void applyUpdate(const MTPDupdateMessagePoll &update);
|
|
|
|
void applyUpdate(const MTPDupdateChatParticipants &update);
|
|
|
|
void applyUpdate(const MTPDupdateChatParticipantAdd &update);
|
|
|
|
void applyUpdate(const MTPDupdateChatParticipantDelete &update);
|
|
|
|
void applyUpdate(const MTPDupdateChatParticipantAdmin &update);
|
|
|
|
void applyUpdate(const MTPDupdateChatDefaultBannedRights &update);
|
|
|
|
|
2019-04-16 16:28:41 +00:00
|
|
|
void applyDialogs(
|
2022-11-08 13:57:54 +00:00
|
|
|
Folder *requestFolder,
|
2019-04-16 16:28:41 +00:00
|
|
|
const QVector<MTPMessage> &messages,
|
2019-04-23 12:29:23 +00:00
|
|
|
const QVector<MTPDialog> &dialogs,
|
|
|
|
std::optional<int> count = std::nullopt);
|
2019-04-16 16:28:41 +00:00
|
|
|
|
2022-11-08 13:57:54 +00:00
|
|
|
[[nodiscard]] bool pinnedCanPin(not_null<Thread*> thread) const;
|
|
|
|
[[nodiscard]] bool pinnedCanPin(
|
2022-03-14 07:11:14 +00:00
|
|
|
FilterId filterId,
|
|
|
|
not_null<History*> history) const;
|
2022-11-08 13:57:54 +00:00
|
|
|
[[nodiscard]] int pinnedChatsLimit(Folder *folder) const;
|
|
|
|
[[nodiscard]] int pinnedChatsLimit(FilterId filterId) const;
|
|
|
|
[[nodiscard]] int pinnedChatsLimit(not_null<Forum*> forum) const;
|
|
|
|
[[nodiscard]] rpl::producer<int> maxPinnedChatsLimitValue(
|
|
|
|
Folder *folder) const;
|
|
|
|
[[nodiscard]] rpl::producer<int> maxPinnedChatsLimitValue(
|
2022-05-09 13:09:46 +00:00
|
|
|
FilterId filterId) const;
|
2022-11-08 13:57:54 +00:00
|
|
|
[[nodiscard]] rpl::producer<int> maxPinnedChatsLimitValue(
|
|
|
|
not_null<Forum*> forum) const;
|
|
|
|
[[nodiscard]] const std::vector<Dialogs::Key> &pinnedChatsOrder(
|
|
|
|
Folder *folder) const;
|
|
|
|
[[nodiscard]] const std::vector<Dialogs::Key> &pinnedChatsOrder(
|
|
|
|
not_null<Forum*> forum) const;
|
|
|
|
[[nodiscard]] const std::vector<Dialogs::Key> &pinnedChatsOrder(
|
2020-03-17 13:04:30 +00:00
|
|
|
FilterId filterId) const;
|
2022-11-11 06:23:23 +00:00
|
|
|
void setChatPinned(Dialogs::Key key, FilterId filterId, bool pinned);
|
|
|
|
void setPinnedFromEntryList(Dialogs::Key key, bool pinned);
|
2022-11-08 13:57:54 +00:00
|
|
|
void clearPinnedChats(Folder *folder);
|
2019-04-19 08:47:49 +00:00
|
|
|
void applyPinnedChats(
|
2022-11-08 13:57:54 +00:00
|
|
|
Folder *folder,
|
2019-04-19 08:47:49 +00:00
|
|
|
const QVector<MTPDialogPeer> &list);
|
2022-11-08 13:57:54 +00:00
|
|
|
void applyPinnedTopics(
|
|
|
|
not_null<Data::Forum*> forum,
|
|
|
|
const QVector<MTPint> &list);
|
2019-04-19 08:47:49 +00:00
|
|
|
void reorderTwoPinnedChats(
|
2020-03-17 13:04:30 +00:00
|
|
|
FilterId filterId,
|
2022-11-11 06:23:23 +00:00
|
|
|
Dialogs::Key key1,
|
|
|
|
Dialogs::Key key2);
|
2018-01-04 19:54:35 +00:00
|
|
|
|
2021-02-19 13:53:20 +00:00
|
|
|
void setSuggestToGigagroup(not_null<ChannelData*> group, bool suggest);
|
|
|
|
[[nodiscard]] bool suggestToGigagroup(
|
|
|
|
not_null<ChannelData*> group) const;
|
|
|
|
|
2020-02-20 08:45:25 +00:00
|
|
|
void registerMessage(not_null<HistoryItem*> item);
|
|
|
|
void unregisterMessage(not_null<HistoryItem*> item);
|
2019-04-25 12:45:15 +00:00
|
|
|
|
2021-02-02 14:42:26 +00:00
|
|
|
void registerMessageTTL(TimeId when, not_null<HistoryItem*> item);
|
|
|
|
void unregisterMessageTTL(TimeId when, not_null<HistoryItem*> item);
|
|
|
|
|
2019-04-25 12:45:15 +00:00
|
|
|
// Returns true if item found and it is not detached.
|
2019-09-12 10:35:04 +00:00
|
|
|
bool updateExistingMessage(const MTPDmessage &data);
|
2019-04-25 12:45:15 +00:00
|
|
|
void updateEditedMessage(const MTPMessage &data);
|
|
|
|
void processMessages(
|
|
|
|
const QVector<MTPMessage> &data,
|
|
|
|
NewMessageType type);
|
|
|
|
void processMessages(
|
|
|
|
const MTPVector<MTPMessage> &data,
|
|
|
|
NewMessageType type);
|
2021-10-04 19:37:55 +00:00
|
|
|
void processExistingMessages(
|
|
|
|
ChannelData *channel,
|
|
|
|
const MTPmessages_Messages &data);
|
2021-12-09 07:32:54 +00:00
|
|
|
void processNonChannelMessagesDeleted(const QVector<MTPint> &data);
|
2019-04-25 12:45:15 +00:00
|
|
|
void processMessagesDeleted(
|
2021-12-09 07:32:54 +00:00
|
|
|
PeerId peerId,
|
2019-04-25 12:45:15 +00:00
|
|
|
const QVector<MTPint> &data);
|
|
|
|
|
2019-08-12 16:33:36 +00:00
|
|
|
[[nodiscard]] MsgId nextLocalMessageId();
|
2019-04-25 12:45:15 +00:00
|
|
|
[[nodiscard]] HistoryItem *message(
|
2021-12-09 07:32:54 +00:00
|
|
|
PeerId peerId,
|
2019-04-25 12:45:15 +00:00
|
|
|
MsgId itemId) const;
|
|
|
|
[[nodiscard]] HistoryItem *message(
|
2021-12-09 07:32:54 +00:00
|
|
|
not_null<const PeerData*> peer,
|
2019-04-25 12:45:15 +00:00
|
|
|
MsgId itemId) const;
|
|
|
|
[[nodiscard]] HistoryItem *message(FullMsgId itemId) const;
|
|
|
|
|
2021-12-09 07:32:54 +00:00
|
|
|
[[nodiscard]] HistoryItem *nonChannelMessage(MsgId itemId) const;
|
|
|
|
|
2019-04-25 12:45:15 +00:00
|
|
|
void updateDependentMessages(not_null<HistoryItem*> item);
|
|
|
|
void registerDependentMessage(
|
|
|
|
not_null<HistoryItem*> dependent,
|
|
|
|
not_null<HistoryItem*> dependency);
|
|
|
|
void unregisterDependentMessage(
|
|
|
|
not_null<HistoryItem*> dependent,
|
|
|
|
not_null<HistoryItem*> dependency);
|
|
|
|
|
2021-01-21 15:57:12 +00:00
|
|
|
void destroyAllCallItems();
|
|
|
|
|
2019-04-25 12:45:15 +00:00
|
|
|
void registerMessageRandomId(uint64 randomId, FullMsgId itemId);
|
|
|
|
void unregisterMessageRandomId(uint64 randomId);
|
|
|
|
[[nodiscard]] FullMsgId messageIdByRandomId(uint64 randomId) const;
|
|
|
|
void registerMessageSentData(
|
|
|
|
uint64 randomId,
|
|
|
|
PeerId peerId,
|
|
|
|
const QString &text);
|
|
|
|
void unregisterMessageSentData(uint64 randomId);
|
|
|
|
[[nodiscard]] SentData messageSentData(uint64 randomId) const;
|
|
|
|
|
2018-01-17 16:21:01 +00:00
|
|
|
void photoLoadSettingsChanged();
|
2018-12-06 15:47:28 +00:00
|
|
|
void documentLoadSettingsChanged();
|
2018-01-17 16:21:01 +00:00
|
|
|
|
|
|
|
void notifyPhotoLayoutChanged(not_null<const PhotoData*> photo);
|
2020-05-25 14:16:04 +00:00
|
|
|
void requestPhotoViewRepaint(not_null<const PhotoData*> photo);
|
2018-01-17 16:21:01 +00:00
|
|
|
void notifyDocumentLayoutChanged(
|
|
|
|
not_null<const DocumentData*> document);
|
|
|
|
void requestDocumentViewRepaint(not_null<const DocumentData*> document);
|
|
|
|
void markMediaRead(not_null<const DocumentData*> document);
|
2018-12-18 05:43:11 +00:00
|
|
|
void requestPollViewRepaint(not_null<const PollData*> poll);
|
2018-01-17 16:21:01 +00:00
|
|
|
|
2020-05-25 14:16:04 +00:00
|
|
|
void photoLoadProgress(not_null<PhotoData*> photo);
|
|
|
|
void photoLoadDone(not_null<PhotoData*> photo);
|
|
|
|
void photoLoadFail(not_null<PhotoData*> photo, bool started);
|
|
|
|
|
2020-04-10 11:17:10 +00:00
|
|
|
void documentLoadProgress(not_null<DocumentData*> document);
|
|
|
|
void documentLoadDone(not_null<DocumentData*> document);
|
|
|
|
void documentLoadFail(not_null<DocumentData*> document, bool started);
|
|
|
|
|
2022-03-01 14:32:39 +00:00
|
|
|
[[nodiscard]] auto documentLoadProgress() const
|
|
|
|
-> rpl::producer<not_null<DocumentData*>> {
|
|
|
|
return _documentLoadProgress.events();
|
|
|
|
}
|
|
|
|
|
2019-08-09 19:19:23 +00:00
|
|
|
HistoryItem *addNewMessage(
|
|
|
|
const MTPMessage &data,
|
2021-07-28 11:55:02 +00:00
|
|
|
MessageFlags localFlags,
|
2019-08-09 19:19:23 +00:00
|
|
|
NewMessageType type);
|
2021-09-30 11:30:39 +00:00
|
|
|
HistoryItem *addNewMessage( // Override message id.
|
|
|
|
MsgId id,
|
|
|
|
const MTPMessage &data,
|
|
|
|
MessageFlags localFlags,
|
|
|
|
NewMessageType type);
|
2019-01-03 12:36:01 +00:00
|
|
|
|
2020-06-18 11:17:58 +00:00
|
|
|
[[nodiscard]] int unreadBadge() const;
|
|
|
|
[[nodiscard]] bool unreadBadgeMuted() const;
|
2022-11-11 06:23:23 +00:00
|
|
|
[[nodiscard]] int unreadBadgeIgnoreOne(Dialogs::Key key) const;
|
|
|
|
[[nodiscard]] bool unreadBadgeMutedIgnoreOne(Dialogs::Key key) const;
|
2020-06-18 11:17:58 +00:00
|
|
|
[[nodiscard]] int unreadOnlyMutedBadge() const;
|
|
|
|
[[nodiscard]] rpl::producer<> unreadBadgeChanges() const;
|
|
|
|
void notifyUnreadBadgeChanged();
|
2019-01-03 12:36:01 +00:00
|
|
|
|
2022-10-07 11:46:27 +00:00
|
|
|
void updateRepliesReadTill(RepliesReadTillUpdate update);
|
|
|
|
[[nodiscard]] auto repliesReadTillUpdates() const
|
|
|
|
-> rpl::producer<RepliesReadTillUpdate>;
|
2021-08-30 16:22:16 +00:00
|
|
|
|
2019-02-19 06:57:53 +00:00
|
|
|
void selfDestructIn(not_null<HistoryItem*> item, crl::time delay);
|
2019-01-03 12:36:01 +00:00
|
|
|
|
2019-01-18 12:27:37 +00:00
|
|
|
[[nodiscard]] not_null<PhotoData*> photo(PhotoId id);
|
|
|
|
not_null<PhotoData*> processPhoto(const MTPPhoto &data);
|
|
|
|
not_null<PhotoData*> processPhoto(const MTPDphoto &data);
|
|
|
|
not_null<PhotoData*> processPhoto(
|
2018-01-17 16:21:01 +00:00
|
|
|
const MTPPhoto &data,
|
|
|
|
const PreparedPhotoThumbs &thumbs);
|
2019-01-18 12:27:37 +00:00
|
|
|
[[nodiscard]] not_null<PhotoData*> photo(
|
2018-01-17 16:21:01 +00:00
|
|
|
PhotoId id,
|
|
|
|
const uint64 &access,
|
2018-07-13 16:49:46 +00:00
|
|
|
const QByteArray &fileReference,
|
2018-01-17 16:21:01 +00:00
|
|
|
TimeId date,
|
2019-03-22 14:19:43 +00:00
|
|
|
int32 dc,
|
2020-10-30 00:07:59 +00:00
|
|
|
bool hasStickers,
|
2020-05-25 14:16:04 +00:00
|
|
|
const QByteArray &inlineThumbnailBytes,
|
|
|
|
const ImageWithLocation &small,
|
|
|
|
const ImageWithLocation &thumbnail,
|
2020-07-03 08:42:09 +00:00
|
|
|
const ImageWithLocation &large,
|
2022-06-03 11:58:02 +00:00
|
|
|
const ImageWithLocation &videoSmall,
|
|
|
|
const ImageWithLocation &videoLarge,
|
2020-07-03 10:48:55 +00:00
|
|
|
crl::time videoStartTime);
|
2018-01-17 16:21:01 +00:00
|
|
|
void photoConvert(
|
|
|
|
not_null<PhotoData*> original,
|
|
|
|
const MTPPhoto &data);
|
2019-01-18 12:27:37 +00:00
|
|
|
[[nodiscard]] PhotoData *photoFromWeb(
|
2018-10-23 09:08:50 +00:00
|
|
|
const MTPWebDocument &data,
|
2020-05-26 10:13:32 +00:00
|
|
|
const ImageLocation &thumbnailLocation);
|
2018-01-17 16:21:01 +00:00
|
|
|
|
2019-01-18 12:27:37 +00:00
|
|
|
[[nodiscard]] not_null<DocumentData*> document(DocumentId id);
|
|
|
|
not_null<DocumentData*> processDocument(const MTPDocument &data);
|
|
|
|
not_null<DocumentData*> processDocument(const MTPDdocument &data);
|
|
|
|
not_null<DocumentData*> processDocument(
|
2018-01-17 16:21:01 +00:00
|
|
|
const MTPdocument &data,
|
2020-04-16 12:37:26 +00:00
|
|
|
const ImageWithLocation &thumbnail);
|
2019-01-18 12:27:37 +00:00
|
|
|
[[nodiscard]] not_null<DocumentData*> document(
|
2018-01-17 16:21:01 +00:00
|
|
|
DocumentId id,
|
|
|
|
const uint64 &access,
|
2018-07-13 16:49:46 +00:00
|
|
|
const QByteArray &fileReference,
|
2018-01-17 16:21:01 +00:00
|
|
|
TimeId date,
|
|
|
|
const QVector<MTPDocumentAttribute> &attributes,
|
|
|
|
const QString &mime,
|
2021-07-02 10:13:48 +00:00
|
|
|
const InlineImageLocation &inlineThumbnail,
|
2020-04-16 12:37:26 +00:00
|
|
|
const ImageWithLocation &thumbnail,
|
2020-05-22 11:15:09 +00:00
|
|
|
const ImageWithLocation &videoThumbnail,
|
2022-04-21 11:06:50 +00:00
|
|
|
bool isPremiumSticker,
|
2018-01-17 16:21:01 +00:00
|
|
|
int32 dc,
|
2022-05-10 14:22:28 +00:00
|
|
|
int64 size);
|
2018-01-17 16:21:01 +00:00
|
|
|
void documentConvert(
|
|
|
|
not_null<DocumentData*> original,
|
|
|
|
const MTPDocument &data);
|
2019-01-18 12:27:37 +00:00
|
|
|
[[nodiscard]] DocumentData *documentFromWeb(
|
2018-03-04 20:04:13 +00:00
|
|
|
const MTPWebDocument &data,
|
2020-05-22 15:23:19 +00:00
|
|
|
const ImageLocation &thumbnailLocation,
|
|
|
|
const ImageLocation &videoThumbnailLocation);
|
2018-01-17 16:21:01 +00:00
|
|
|
|
2019-01-18 12:27:37 +00:00
|
|
|
[[nodiscard]] not_null<WebPageData*> webpage(WebPageId id);
|
|
|
|
not_null<WebPageData*> processWebpage(const MTPWebPage &data);
|
|
|
|
not_null<WebPageData*> processWebpage(const MTPDwebPage &data);
|
|
|
|
not_null<WebPageData*> processWebpage(const MTPDwebPagePending &data);
|
|
|
|
[[nodiscard]] not_null<WebPageData*> webpage(
|
2018-01-17 16:21:01 +00:00
|
|
|
WebPageId id,
|
|
|
|
const QString &siteName,
|
|
|
|
const TextWithEntities &content);
|
2019-01-18 12:27:37 +00:00
|
|
|
[[nodiscard]] not_null<WebPageData*> webpage(
|
2018-01-17 16:21:01 +00:00
|
|
|
WebPageId id,
|
2018-10-31 10:11:01 +00:00
|
|
|
WebPageType type,
|
2023-10-19 07:05:39 +00:00
|
|
|
bool hasLargeMedia,
|
2018-01-17 16:21:01 +00:00
|
|
|
const QString &url,
|
|
|
|
const QString &displayUrl,
|
|
|
|
const QString &siteName,
|
|
|
|
const QString &title,
|
|
|
|
const TextWithEntities &description,
|
|
|
|
PhotoData *photo,
|
|
|
|
DocumentData *document,
|
2018-10-24 11:52:31 +00:00
|
|
|
WebPageCollage &&collage,
|
2018-01-17 16:21:01 +00:00
|
|
|
int duration,
|
|
|
|
const QString &author,
|
|
|
|
TimeId pendingTill);
|
|
|
|
|
2019-01-18 12:27:37 +00:00
|
|
|
[[nodiscard]] not_null<GameData*> game(GameId id);
|
|
|
|
not_null<GameData*> processGame(const MTPDgame &data);
|
|
|
|
[[nodiscard]] not_null<GameData*> game(
|
2018-01-17 16:21:01 +00:00
|
|
|
GameId id,
|
|
|
|
const uint64 &accessHash,
|
|
|
|
const QString &shortName,
|
|
|
|
const QString &title,
|
|
|
|
const QString &description,
|
|
|
|
PhotoData *photo,
|
|
|
|
DocumentData *document);
|
|
|
|
void gameConvert(
|
|
|
|
not_null<GameData*> original,
|
|
|
|
const MTPGame &data);
|
|
|
|
|
2023-03-03 08:35:49 +00:00
|
|
|
[[nodiscard]] not_null<BotAppData*> botApp(BotAppId id);
|
|
|
|
BotAppData *findBotApp(PeerId botId, const QString &appName) const;
|
|
|
|
BotAppData *processBotApp(
|
|
|
|
PeerId botId,
|
|
|
|
const MTPBotApp &data);
|
|
|
|
|
2019-01-18 12:27:37 +00:00
|
|
|
[[nodiscard]] not_null<PollData*> poll(PollId id);
|
|
|
|
not_null<PollData*> processPoll(const MTPPoll &data);
|
|
|
|
not_null<PollData*> processPoll(const MTPDmessageMediaPoll &data);
|
2018-12-18 05:43:11 +00:00
|
|
|
|
2022-11-08 13:57:54 +00:00
|
|
|
[[nodiscard]] not_null<CloudImage*> location(
|
2019-06-21 12:27:46 +00:00
|
|
|
const LocationPoint &point);
|
2018-10-11 15:54:57 +00:00
|
|
|
|
2018-01-21 19:52:44 +00:00
|
|
|
void registerPhotoItem(
|
2018-01-17 16:21:01 +00:00
|
|
|
not_null<const PhotoData*> photo,
|
2018-01-21 19:52:44 +00:00
|
|
|
not_null<HistoryItem*> item);
|
|
|
|
void unregisterPhotoItem(
|
2018-01-17 16:21:01 +00:00
|
|
|
not_null<const PhotoData*> photo,
|
2018-01-21 19:52:44 +00:00
|
|
|
not_null<HistoryItem*> item);
|
2018-01-17 16:21:01 +00:00
|
|
|
void registerDocumentItem(
|
|
|
|
not_null<const DocumentData*> document,
|
|
|
|
not_null<HistoryItem*> item);
|
|
|
|
void unregisterDocumentItem(
|
|
|
|
not_null<const DocumentData*> document,
|
|
|
|
not_null<HistoryItem*> item);
|
|
|
|
void registerWebPageView(
|
|
|
|
not_null<const WebPageData*> page,
|
2018-01-17 18:20:55 +00:00
|
|
|
not_null<ViewElement*> view);
|
2018-01-17 16:21:01 +00:00
|
|
|
void unregisterWebPageView(
|
|
|
|
not_null<const WebPageData*> page,
|
2018-01-17 18:20:55 +00:00
|
|
|
not_null<ViewElement*> view);
|
2018-01-17 16:21:01 +00:00
|
|
|
void registerWebPageItem(
|
|
|
|
not_null<const WebPageData*> page,
|
|
|
|
not_null<HistoryItem*> item);
|
|
|
|
void unregisterWebPageItem(
|
|
|
|
not_null<const WebPageData*> page,
|
|
|
|
not_null<HistoryItem*> item);
|
|
|
|
void registerGameView(
|
|
|
|
not_null<const GameData*> game,
|
2018-01-17 18:20:55 +00:00
|
|
|
not_null<ViewElement*> view);
|
2018-01-17 16:21:01 +00:00
|
|
|
void unregisterGameView(
|
|
|
|
not_null<const GameData*> game,
|
2018-01-17 18:20:55 +00:00
|
|
|
not_null<ViewElement*> view);
|
2018-12-18 05:43:11 +00:00
|
|
|
void registerPollView(
|
|
|
|
not_null<const PollData*> poll,
|
|
|
|
not_null<ViewElement*> view);
|
|
|
|
void unregisterPollView(
|
|
|
|
not_null<const PollData*> poll,
|
|
|
|
not_null<ViewElement*> view);
|
2018-01-17 16:21:01 +00:00
|
|
|
void registerContactView(
|
|
|
|
UserId contactId,
|
2018-01-17 18:20:55 +00:00
|
|
|
not_null<ViewElement*> view);
|
2018-01-17 16:21:01 +00:00
|
|
|
void unregisterContactView(
|
|
|
|
UserId contactId,
|
2018-01-17 18:20:55 +00:00
|
|
|
not_null<ViewElement*> view);
|
2018-01-17 16:21:01 +00:00
|
|
|
void registerContactItem(
|
|
|
|
UserId contactId,
|
|
|
|
not_null<HistoryItem*> item);
|
|
|
|
void unregisterContactItem(
|
|
|
|
UserId contactId,
|
|
|
|
not_null<HistoryItem*> item);
|
2021-01-21 15:57:12 +00:00
|
|
|
void registerCallItem(not_null<HistoryItem*> item);
|
|
|
|
void unregisterCallItem(not_null<HistoryItem*> item);
|
2023-06-30 07:48:18 +00:00
|
|
|
void registerStoryItem(FullStoryId id, not_null<HistoryItem*> item);
|
|
|
|
void unregisterStoryItem(FullStoryId id, not_null<HistoryItem*> item);
|
|
|
|
void refreshStoryItemViews(FullStoryId id);
|
2019-07-30 15:46:13 +00:00
|
|
|
|
2020-10-23 12:22:38 +00:00
|
|
|
void documentMessageRemoved(not_null<DocumentData*> document);
|
|
|
|
|
2020-06-04 13:26:06 +00:00
|
|
|
void checkPlayingAnimations();
|
2018-01-17 16:21:01 +00:00
|
|
|
|
|
|
|
HistoryItem *findWebPageItem(not_null<WebPageData*> page) const;
|
|
|
|
QString findContactPhone(not_null<UserData*> contact) const;
|
|
|
|
QString findContactPhone(UserId contactId) const;
|
|
|
|
|
|
|
|
void notifyWebPageUpdateDelayed(not_null<WebPageData*> page);
|
|
|
|
void notifyGameUpdateDelayed(not_null<GameData*> game);
|
2018-12-18 05:43:11 +00:00
|
|
|
void notifyPollUpdateDelayed(not_null<PollData*> poll);
|
2020-06-11 09:41:03 +00:00
|
|
|
[[nodiscard]] bool hasPendingWebPageGamePollNotification() const;
|
2018-12-18 05:43:11 +00:00
|
|
|
void sendWebPageGamePollNotifications();
|
2020-06-11 09:41:03 +00:00
|
|
|
[[nodiscard]] rpl::producer<not_null<WebPageData*>> webPageUpdates() const;
|
|
|
|
|
|
|
|
void channelDifferenceTooLong(not_null<ChannelData*> channel);
|
|
|
|
[[nodiscard]] rpl::producer<not_null<ChannelData*>> channelDifferenceTooLong() const;
|
|
|
|
|
2018-01-17 16:21:01 +00:00
|
|
|
void registerItemView(not_null<ViewElement*> view);
|
|
|
|
void unregisterItemView(not_null<ViewElement*> view);
|
|
|
|
|
2019-04-15 11:54:03 +00:00
|
|
|
[[nodiscard]] not_null<Folder*> folder(FolderId id);
|
2019-04-19 08:47:49 +00:00
|
|
|
[[nodiscard]] Folder *folderLoaded(FolderId id) const;
|
2019-04-15 11:54:03 +00:00
|
|
|
not_null<Folder*> processFolder(const MTPFolder &data);
|
|
|
|
not_null<Folder*> processFolder(const MTPDfolder &data);
|
2018-01-04 10:22:53 +00:00
|
|
|
|
2022-10-07 11:46:27 +00:00
|
|
|
[[nodiscard]] not_null<Dialogs::MainList*> chatsListFor(
|
|
|
|
not_null<Dialogs::Entry*> entry);
|
2020-02-07 11:34:05 +00:00
|
|
|
[[nodiscard]] not_null<Dialogs::MainList*> chatsList(
|
2022-11-08 13:57:54 +00:00
|
|
|
Folder *folder = nullptr);
|
2020-02-07 11:34:05 +00:00
|
|
|
[[nodiscard]] not_null<const Dialogs::MainList*> chatsList(
|
2022-11-08 13:57:54 +00:00
|
|
|
Folder *folder = nullptr) const;
|
2020-02-07 11:34:05 +00:00
|
|
|
[[nodiscard]] not_null<Dialogs::IndexedList*> contactsList();
|
|
|
|
[[nodiscard]] not_null<Dialogs::IndexedList*> contactsNoChatsList();
|
2019-04-16 14:05:56 +00:00
|
|
|
|
2020-06-12 14:09:04 +00:00
|
|
|
struct ChatListEntryRefresh {
|
|
|
|
Dialogs::Key key;
|
2019-04-16 14:05:56 +00:00
|
|
|
Dialogs::PositionChange moved;
|
2020-06-12 14:09:04 +00:00
|
|
|
FilterId filterId = 0;
|
|
|
|
bool existenceChanged = false;
|
|
|
|
|
|
|
|
explicit operator bool() const {
|
|
|
|
return existenceChanged || (moved.from != moved.to);
|
|
|
|
}
|
2019-04-16 14:05:56 +00:00
|
|
|
};
|
2020-06-12 14:09:04 +00:00
|
|
|
void refreshChatListEntry(Dialogs::Key key);
|
2019-04-16 14:05:56 +00:00
|
|
|
void removeChatListEntry(Dialogs::Key key);
|
2020-06-12 14:09:04 +00:00
|
|
|
[[nodiscard]] auto chatListEntryRefreshes() const
|
|
|
|
-> rpl::producer<ChatListEntryRefresh>;
|
2019-04-16 14:05:56 +00:00
|
|
|
|
|
|
|
struct DialogsRowReplacement {
|
|
|
|
not_null<Dialogs::Row*> old;
|
|
|
|
Dialogs::Row *now = nullptr;
|
|
|
|
};
|
|
|
|
void dialogsRowReplaced(DialogsRowReplacement replacement);
|
|
|
|
rpl::producer<DialogsRowReplacement> dialogsRowReplacements() const;
|
|
|
|
|
2018-09-27 20:31:48 +00:00
|
|
|
void serviceNotification(
|
|
|
|
const TextWithEntities &message,
|
2018-10-05 08:14:00 +00:00
|
|
|
const MTPMessageMedia &media = MTP_messageMediaEmpty());
|
2018-09-27 20:31:48 +00:00
|
|
|
|
2018-01-11 15:51:59 +00:00
|
|
|
void setMimeForwardIds(MessageIdsList &&list);
|
|
|
|
MessageIdsList takeMimeForwardIds();
|
|
|
|
|
2020-04-24 12:40:20 +00:00
|
|
|
void setTopPromoted(
|
2020-06-12 12:12:34 +00:00
|
|
|
History *promoted,
|
2020-04-24 12:40:20 +00:00
|
|
|
const QString &type,
|
|
|
|
const QString &message);
|
2018-05-11 14:03:53 +00:00
|
|
|
|
2019-01-16 12:25:29 +00:00
|
|
|
bool updateWallpapers(const MTPaccount_WallPapers &data);
|
2019-02-09 13:36:07 +00:00
|
|
|
void removeWallpaper(const WallPaper &paper);
|
2019-01-16 12:25:29 +00:00
|
|
|
const std::vector<WallPaper> &wallpapers() const;
|
2021-08-25 08:15:05 +00:00
|
|
|
uint64 wallpapersHash() const;
|
2019-01-03 12:36:01 +00:00
|
|
|
|
2022-03-28 20:14:10 +00:00
|
|
|
struct WebViewResultSent {
|
|
|
|
uint64 queryId = 0;
|
|
|
|
};
|
|
|
|
void webViewResultSent(WebViewResultSent &&sent);
|
|
|
|
[[nodiscard]] rpl::producer<WebViewResultSent> webViewResultSent() const;
|
|
|
|
|
2019-01-03 12:36:01 +00:00
|
|
|
void clearLocalStorage();
|
|
|
|
|
2018-01-04 10:22:53 +00:00
|
|
|
private:
|
2020-02-20 08:45:25 +00:00
|
|
|
using Messages = std::unordered_map<MsgId, not_null<HistoryItem*>>;
|
2019-04-25 12:45:15 +00:00
|
|
|
|
2018-06-22 23:18:43 +00:00
|
|
|
void suggestStartExport();
|
|
|
|
|
2020-06-12 14:09:04 +00:00
|
|
|
void setupMigrationViewer();
|
2018-02-08 09:20:14 +00:00
|
|
|
void setupChannelLeavingViewer();
|
2019-04-16 14:05:56 +00:00
|
|
|
void setupPeerNameViewer();
|
|
|
|
void setupUserIsContactViewer();
|
2019-01-03 12:36:01 +00:00
|
|
|
|
|
|
|
void checkSelfDestructItems();
|
2022-10-24 07:22:26 +00:00
|
|
|
void checkLocalUsersWentOffline();
|
2019-04-22 14:22:39 +00:00
|
|
|
|
2021-02-02 14:42:26 +00:00
|
|
|
void scheduleNextTTLs();
|
|
|
|
void checkTTLs();
|
|
|
|
|
2019-04-24 15:28:01 +00:00
|
|
|
int computeUnreadBadge(const Dialogs::UnreadState &state) const;
|
|
|
|
bool computeUnreadBadgeMuted(const Dialogs::UnreadState &state) const;
|
2019-01-03 12:36:01 +00:00
|
|
|
|
2022-11-08 13:57:54 +00:00
|
|
|
void applyDialog(Folder *requestFolder, const MTPDdialog &data);
|
2019-04-22 14:22:39 +00:00
|
|
|
void applyDialog(
|
2022-11-08 13:57:54 +00:00
|
|
|
Folder *requestFolder,
|
2019-04-22 14:22:39 +00:00
|
|
|
const MTPDdialogFolder &data);
|
2019-04-16 16:28:41 +00:00
|
|
|
|
2021-12-09 07:32:54 +00:00
|
|
|
const Messages *messagesList(PeerId peerId) const;
|
|
|
|
not_null<Messages*> messagesListForInsert(PeerId peerId);
|
2020-02-20 08:45:25 +00:00
|
|
|
not_null<HistoryItem*> registerMessage(
|
|
|
|
std::unique_ptr<HistoryItem> item);
|
2022-10-04 15:34:45 +00:00
|
|
|
HistoryItem *changeMessageId(PeerId peerId, MsgId wasId, MsgId nowId);
|
2019-04-30 08:04:42 +00:00
|
|
|
void removeDependencyMessage(not_null<HistoryItem*> item);
|
2019-04-25 12:45:15 +00:00
|
|
|
|
2018-01-17 16:21:01 +00:00
|
|
|
void photoApplyFields(
|
|
|
|
not_null<PhotoData*> photo,
|
|
|
|
const MTPPhoto &data);
|
|
|
|
void photoApplyFields(
|
|
|
|
not_null<PhotoData*> photo,
|
|
|
|
const MTPDphoto &data);
|
|
|
|
void photoApplyFields(
|
|
|
|
not_null<PhotoData*> photo,
|
|
|
|
const uint64 &access,
|
2018-07-13 16:49:46 +00:00
|
|
|
const QByteArray &fileReference,
|
2018-01-17 16:21:01 +00:00
|
|
|
TimeId date,
|
2019-03-22 14:19:43 +00:00
|
|
|
int32 dc,
|
2020-10-30 00:07:59 +00:00
|
|
|
bool hasStickers,
|
2020-05-25 14:16:04 +00:00
|
|
|
const QByteArray &inlineThumbnailBytes,
|
|
|
|
const ImageWithLocation &small,
|
|
|
|
const ImageWithLocation &thumbnail,
|
2020-07-03 08:42:09 +00:00
|
|
|
const ImageWithLocation &large,
|
2022-06-03 11:58:02 +00:00
|
|
|
const ImageWithLocation &videoSmall,
|
|
|
|
const ImageWithLocation &videoLarge,
|
2020-07-03 10:48:55 +00:00
|
|
|
crl::time videoStartTime);
|
2018-01-17 16:21:01 +00:00
|
|
|
|
|
|
|
void documentApplyFields(
|
|
|
|
not_null<DocumentData*> document,
|
|
|
|
const MTPDocument &data);
|
|
|
|
void documentApplyFields(
|
|
|
|
not_null<DocumentData*> document,
|
|
|
|
const MTPDdocument &data);
|
|
|
|
void documentApplyFields(
|
|
|
|
not_null<DocumentData*> document,
|
|
|
|
const uint64 &access,
|
2018-07-13 16:49:46 +00:00
|
|
|
const QByteArray &fileReference,
|
2018-01-17 16:21:01 +00:00
|
|
|
TimeId date,
|
|
|
|
const QVector<MTPDocumentAttribute> &attributes,
|
|
|
|
const QString &mime,
|
2021-07-02 10:13:48 +00:00
|
|
|
const InlineImageLocation &inlineThumbnail,
|
2020-04-16 12:37:26 +00:00
|
|
|
const ImageWithLocation &thumbnail,
|
2020-05-22 11:15:09 +00:00
|
|
|
const ImageWithLocation &videoThumbnail,
|
2022-04-21 11:06:50 +00:00
|
|
|
bool isPremiumSticker,
|
2018-01-17 16:21:01 +00:00
|
|
|
int32 dc,
|
2022-05-10 14:22:28 +00:00
|
|
|
int64 size);
|
2018-03-04 20:04:13 +00:00
|
|
|
DocumentData *documentFromWeb(
|
|
|
|
const MTPDwebDocument &data,
|
2020-05-22 15:23:19 +00:00
|
|
|
const ImageLocation &thumbnailLocation,
|
|
|
|
const ImageLocation &videoThumbnailLocation);
|
2018-03-04 20:04:13 +00:00
|
|
|
DocumentData *documentFromWeb(
|
|
|
|
const MTPDwebDocumentNoProxy &data,
|
2020-05-22 15:23:19 +00:00
|
|
|
const ImageLocation &thumbnailLocation,
|
|
|
|
const ImageLocation &videoThumbnailLocation);
|
2018-01-17 16:21:01 +00:00
|
|
|
|
|
|
|
void webpageApplyFields(
|
|
|
|
not_null<WebPageData*> page,
|
|
|
|
const MTPDwebPage &data);
|
|
|
|
void webpageApplyFields(
|
|
|
|
not_null<WebPageData*> page,
|
2018-10-31 10:11:01 +00:00
|
|
|
WebPageType type,
|
2023-10-19 07:05:39 +00:00
|
|
|
bool hasLargeMedia,
|
2018-01-17 16:21:01 +00:00
|
|
|
const QString &url,
|
|
|
|
const QString &displayUrl,
|
|
|
|
const QString &siteName,
|
|
|
|
const QString &title,
|
|
|
|
const TextWithEntities &description,
|
2023-06-23 12:04:53 +00:00
|
|
|
FullStoryId storyId,
|
2018-01-17 16:21:01 +00:00
|
|
|
PhotoData *photo,
|
|
|
|
DocumentData *document,
|
2018-10-24 11:52:31 +00:00
|
|
|
WebPageCollage &&collage,
|
2018-01-17 16:21:01 +00:00
|
|
|
int duration,
|
|
|
|
const QString &author,
|
|
|
|
TimeId pendingTill);
|
|
|
|
|
|
|
|
void gameApplyFields(
|
|
|
|
not_null<GameData*> game,
|
|
|
|
const MTPDgame &data);
|
|
|
|
void gameApplyFields(
|
|
|
|
not_null<GameData*> game,
|
|
|
|
const uint64 &accessHash,
|
|
|
|
const QString &shortName,
|
|
|
|
const QString &title,
|
|
|
|
const QString &description,
|
|
|
|
PhotoData *photo,
|
|
|
|
DocumentData *document);
|
|
|
|
|
|
|
|
template <typename Method>
|
2018-01-18 11:46:45 +00:00
|
|
|
void enumerateItemViews(
|
|
|
|
not_null<const HistoryItem*> item,
|
|
|
|
Method method);
|
2018-01-17 16:21:01 +00:00
|
|
|
|
2018-09-27 20:31:48 +00:00
|
|
|
void insertCheckedServiceNotification(
|
|
|
|
const TextWithEntities &message,
|
|
|
|
const MTPMessageMedia &media,
|
|
|
|
TimeId date);
|
|
|
|
|
2021-08-25 08:15:05 +00:00
|
|
|
void setWallpapers(const QVector<MTPWallPaper> &data, uint64 hash);
|
2023-10-03 14:22:59 +00:00
|
|
|
void highlightProcessDone(uint64 processId);
|
2019-01-16 12:25:29 +00:00
|
|
|
|
2020-04-07 12:10:34 +00:00
|
|
|
void checkPollsClosings();
|
|
|
|
|
2020-06-25 07:14:05 +00:00
|
|
|
const not_null<Main::Session*> _session;
|
2018-01-17 16:21:01 +00:00
|
|
|
|
2018-08-29 13:23:16 +00:00
|
|
|
Storage::DatabasePointer _cache;
|
2019-02-25 17:26:08 +00:00
|
|
|
Storage::DatabasePointer _bigFileCache;
|
2018-08-27 11:35:58 +00:00
|
|
|
|
2018-06-22 23:18:43 +00:00
|
|
|
TimeId _exportAvailableAt = 0;
|
2019-09-18 11:19:05 +00:00
|
|
|
QPointer<Ui::BoxContent> _exportSuggestion;
|
2018-06-20 00:02:36 +00:00
|
|
|
|
2019-04-18 08:28:43 +00:00
|
|
|
rpl::variable<bool> _contactsLoaded = false;
|
2022-11-08 13:57:54 +00:00
|
|
|
rpl::event_stream<Folder*> _chatsListLoadedEvents;
|
|
|
|
rpl::event_stream<Folder*> _chatsListChanged;
|
2020-06-10 18:08:17 +00:00
|
|
|
rpl::event_stream<not_null<UserData*>> _userIsBotChanges;
|
2021-07-01 11:05:15 +00:00
|
|
|
rpl::event_stream<not_null<PeerData*>> _botCommandsChanges;
|
2022-03-09 10:52:44 +00:00
|
|
|
rpl::event_stream<ItemVisibilityQuery> _itemVisibilityQueries;
|
2018-01-14 16:02:25 +00:00
|
|
|
rpl::event_stream<IdChange> _itemIdChanges;
|
2018-01-21 19:52:44 +00:00
|
|
|
rpl::event_stream<not_null<const HistoryItem*>> _itemLayoutChanges;
|
2018-01-14 16:02:25 +00:00
|
|
|
rpl::event_stream<not_null<const ViewElement*>> _viewLayoutChanges;
|
2021-07-19 10:02:36 +00:00
|
|
|
rpl::event_stream<not_null<HistoryItem*>> _newItemAdded;
|
2018-01-18 11:46:45 +00:00
|
|
|
rpl::event_stream<not_null<const HistoryItem*>> _itemRepaintRequest;
|
2018-01-14 16:02:25 +00:00
|
|
|
rpl::event_stream<not_null<const ViewElement*>> _viewRepaintRequest;
|
2018-01-18 11:46:45 +00:00
|
|
|
rpl::event_stream<not_null<const HistoryItem*>> _itemResizeRequest;
|
|
|
|
rpl::event_stream<not_null<ViewElement*>> _viewResizeRequest;
|
2018-01-18 13:59:22 +00:00
|
|
|
rpl::event_stream<not_null<HistoryItem*>> _itemViewRefreshRequest;
|
2018-03-13 10:19:06 +00:00
|
|
|
rpl::event_stream<not_null<HistoryItem*>> _itemTextRefreshRequest;
|
2019-09-12 10:35:04 +00:00
|
|
|
rpl::event_stream<not_null<HistoryItem*>> _itemDataChanges;
|
2018-01-04 10:22:53 +00:00
|
|
|
rpl::event_stream<not_null<const HistoryItem*>> _itemRemoved;
|
2018-03-09 11:44:42 +00:00
|
|
|
rpl::event_stream<not_null<const ViewElement*>> _viewRemoved;
|
2018-01-04 10:22:53 +00:00
|
|
|
rpl::event_stream<not_null<const History*>> _historyUnloaded;
|
|
|
|
rpl::event_stream<not_null<const History*>> _historyCleared;
|
2018-01-18 11:46:45 +00:00
|
|
|
base::flat_set<not_null<History*>> _historiesChanged;
|
|
|
|
rpl::event_stream<not_null<History*>> _historyChanged;
|
2018-01-04 10:22:53 +00:00
|
|
|
rpl::event_stream<MegagroupParticipant> _megagroupParticipantRemoved;
|
|
|
|
rpl::event_stream<MegagroupParticipant> _megagroupParticipantAdded;
|
2019-04-16 14:05:56 +00:00
|
|
|
rpl::event_stream<DialogsRowReplacement> _dialogsRowReplacements;
|
2020-06-12 14:09:04 +00:00
|
|
|
rpl::event_stream<ChatListEntryRefresh> _chatListEntryRefreshes;
|
2020-06-18 11:17:58 +00:00
|
|
|
rpl::event_stream<> _unreadBadgeChanges;
|
2022-10-07 11:46:27 +00:00
|
|
|
rpl::event_stream<RepliesReadTillUpdate> _repliesReadTillUpdates;
|
2018-01-04 10:22:53 +00:00
|
|
|
|
2019-04-22 14:22:39 +00:00
|
|
|
Dialogs::MainList _chatsList;
|
2019-04-16 14:05:56 +00:00
|
|
|
Dialogs::IndexedList _contactsList;
|
|
|
|
Dialogs::IndexedList _contactsNoChatsList;
|
|
|
|
|
2019-08-12 16:33:36 +00:00
|
|
|
MsgId _localMessageIdCounter = StartClientMsgId;
|
2021-12-09 07:32:54 +00:00
|
|
|
std::unordered_map<PeerId, Messages> _messages;
|
2019-04-25 12:45:15 +00:00
|
|
|
std::map<
|
|
|
|
not_null<HistoryItem*>,
|
|
|
|
base::flat_set<not_null<HistoryItem*>>> _dependentMessages;
|
2021-02-02 14:42:26 +00:00
|
|
|
std::map<TimeId, base::flat_set<not_null<HistoryItem*>>> _ttlMessages;
|
|
|
|
base::Timer _ttlCheckTimer;
|
2019-04-25 12:45:15 +00:00
|
|
|
|
2021-12-09 07:32:54 +00:00
|
|
|
std::unordered_map<MsgId, not_null<HistoryItem*>> _nonChannelMessages;
|
|
|
|
|
2019-04-25 12:45:15 +00:00
|
|
|
base::flat_map<uint64, FullMsgId> _messageByRandomId;
|
|
|
|
base::flat_map<uint64, SentData> _sentMessagesData;
|
|
|
|
|
2019-01-03 12:36:01 +00:00
|
|
|
base::Timer _selfDestructTimer;
|
|
|
|
std::vector<FullMsgId> _selfDestructItems;
|
|
|
|
|
2018-01-17 16:21:01 +00:00
|
|
|
std::unordered_map<
|
|
|
|
PhotoId,
|
|
|
|
std::unique_ptr<PhotoData>> _photos;
|
2019-01-03 12:36:01 +00:00
|
|
|
std::unordered_map<
|
2018-01-17 16:21:01 +00:00
|
|
|
not_null<const PhotoData*>,
|
2018-01-21 19:52:44 +00:00
|
|
|
base::flat_set<not_null<HistoryItem*>>> _photoItems;
|
2018-01-17 16:21:01 +00:00
|
|
|
std::unordered_map<
|
|
|
|
DocumentId,
|
|
|
|
std::unique_ptr<DocumentData>> _documents;
|
2019-01-03 12:36:01 +00:00
|
|
|
std::unordered_map<
|
2018-01-17 16:21:01 +00:00
|
|
|
not_null<const DocumentData*>,
|
|
|
|
base::flat_set<not_null<HistoryItem*>>> _documentItems;
|
|
|
|
std::unordered_map<
|
|
|
|
WebPageId,
|
|
|
|
std::unique_ptr<WebPageData>> _webpages;
|
2019-01-03 12:36:01 +00:00
|
|
|
std::unordered_map<
|
2018-01-17 16:21:01 +00:00
|
|
|
not_null<const WebPageData*>,
|
|
|
|
base::flat_set<not_null<HistoryItem*>>> _webpageItems;
|
2019-01-03 12:36:01 +00:00
|
|
|
std::unordered_map<
|
2018-01-17 16:21:01 +00:00
|
|
|
not_null<const WebPageData*>,
|
2018-01-17 18:20:55 +00:00
|
|
|
base::flat_set<not_null<ViewElement*>>> _webpageViews;
|
2018-12-18 05:43:11 +00:00
|
|
|
std::unordered_map<
|
2019-06-21 12:27:46 +00:00
|
|
|
LocationPoint,
|
2022-11-08 13:57:54 +00:00
|
|
|
std::unique_ptr<CloudImage>> _locations;
|
2018-12-18 05:43:11 +00:00
|
|
|
std::unordered_map<
|
|
|
|
PollId,
|
|
|
|
std::unique_ptr<PollData>> _polls;
|
2018-01-17 16:21:01 +00:00
|
|
|
std::unordered_map<
|
|
|
|
GameId,
|
|
|
|
std::unique_ptr<GameData>> _games;
|
2023-03-03 08:35:49 +00:00
|
|
|
std::unordered_map<
|
|
|
|
BotAppId,
|
|
|
|
std::unique_ptr<BotAppData>> _botApps;
|
2019-01-03 12:36:01 +00:00
|
|
|
std::unordered_map<
|
2018-01-17 16:21:01 +00:00
|
|
|
not_null<const GameData*>,
|
2018-01-17 18:20:55 +00:00
|
|
|
base::flat_set<not_null<ViewElement*>>> _gameViews;
|
2019-01-03 12:36:01 +00:00
|
|
|
std::unordered_map<
|
2018-12-18 05:43:11 +00:00
|
|
|
not_null<const PollData*>,
|
|
|
|
base::flat_set<not_null<ViewElement*>>> _pollViews;
|
2019-01-03 12:36:01 +00:00
|
|
|
std::unordered_map<
|
2018-01-17 16:21:01 +00:00
|
|
|
UserId,
|
|
|
|
base::flat_set<not_null<HistoryItem*>>> _contactItems;
|
2019-01-03 12:36:01 +00:00
|
|
|
std::unordered_map<
|
2018-01-17 16:21:01 +00:00
|
|
|
UserId,
|
2018-01-17 18:20:55 +00:00
|
|
|
base::flat_set<not_null<ViewElement*>>> _contactViews;
|
2021-01-21 15:57:12 +00:00
|
|
|
std::unordered_set<not_null<HistoryItem*>> _callItems;
|
2023-06-30 07:48:18 +00:00
|
|
|
std::unordered_map<
|
|
|
|
FullStoryId,
|
|
|
|
base::flat_set<not_null<HistoryItem*>>> _storyItems;
|
2023-10-03 14:22:59 +00:00
|
|
|
base::flat_map<uint64, not_null<HistoryItem*>> _highlightings;
|
2018-01-17 16:21:01 +00:00
|
|
|
|
|
|
|
base::flat_set<not_null<WebPageData*>> _webpagesUpdated;
|
|
|
|
base::flat_set<not_null<GameData*>> _gamesUpdated;
|
2018-12-18 05:43:11 +00:00
|
|
|
base::flat_set<not_null<PollData*>> _pollsUpdated;
|
2018-01-17 16:21:01 +00:00
|
|
|
|
2020-06-11 09:41:03 +00:00
|
|
|
rpl::event_stream<not_null<WebPageData*>> _webpageUpdates;
|
|
|
|
rpl::event_stream<not_null<ChannelData*>> _channelDifferenceTooLong;
|
2022-03-01 14:32:39 +00:00
|
|
|
rpl::event_stream<not_null<DocumentData*>> _documentLoadProgress;
|
2021-02-19 13:53:20 +00:00
|
|
|
base::flat_set<not_null<ChannelData*>> _suggestToGigagroup;
|
2020-06-11 09:41:03 +00:00
|
|
|
|
2020-04-07 12:10:34 +00:00
|
|
|
base::flat_multi_map<TimeId, not_null<PollData*>> _pollsClosings;
|
|
|
|
base::Timer _pollsClosingTimer;
|
|
|
|
|
2019-04-15 11:54:03 +00:00
|
|
|
base::flat_map<FolderId, std::unique_ptr<Folder>> _folders;
|
2019-04-10 11:26:15 +00:00
|
|
|
|
2019-01-03 12:36:01 +00:00
|
|
|
std::unordered_map<
|
2018-01-18 11:46:45 +00:00
|
|
|
not_null<const HistoryItem*>,
|
2018-01-17 18:20:55 +00:00
|
|
|
std::vector<not_null<ViewElement*>>> _views;
|
2018-01-04 10:22:53 +00:00
|
|
|
|
2020-06-08 17:24:36 +00:00
|
|
|
rpl::event_stream<> _pinnedDialogsOrderUpdated;
|
|
|
|
|
2019-05-14 09:50:44 +00:00
|
|
|
base::flat_set<not_null<ViewElement*>> _heavyViewParts;
|
|
|
|
|
2020-11-24 11:56:46 +00:00
|
|
|
base::flat_map<uint64, not_null<GroupCall*>> _groupCalls;
|
2020-12-16 11:58:53 +00:00
|
|
|
rpl::event_stream<InviteToCall> _invitesToCalls;
|
2020-11-28 18:17:13 +00:00
|
|
|
base::flat_map<uint64, base::flat_set<not_null<UserData*>>> _invitedToCallUsers;
|
2020-11-24 11:56:46 +00:00
|
|
|
|
2022-09-21 14:55:27 +00:00
|
|
|
base::flat_set<not_null<ViewElement*>> _shownSpoilers;
|
2021-12-29 15:26:25 +00:00
|
|
|
|
2020-06-12 12:12:34 +00:00
|
|
|
History *_topPromoted = nullptr;
|
2018-05-11 14:03:53 +00:00
|
|
|
|
2019-01-03 12:36:01 +00:00
|
|
|
std::unordered_map<PeerId, std::unique_ptr<PeerData>> _peers;
|
|
|
|
|
2018-01-11 15:51:59 +00:00
|
|
|
MessageIdsList _mimeForwardIds;
|
|
|
|
|
2018-07-10 16:41:11 +00:00
|
|
|
using CredentialsWithGeneration = std::pair<
|
|
|
|
const Passport::SavedCredentials,
|
|
|
|
int>;
|
|
|
|
std::unique_ptr<CredentialsWithGeneration> _passportCredentials;
|
|
|
|
|
2019-01-03 12:36:01 +00:00
|
|
|
std::vector<WallPaper> _wallpapers;
|
2021-08-25 08:15:05 +00:00
|
|
|
uint64 _wallpapersHash = 0;
|
2019-01-03 12:36:01 +00:00
|
|
|
|
2022-10-24 07:22:26 +00:00
|
|
|
base::flat_map<not_null<UserData*>, TimeId> _watchingForOffline;
|
|
|
|
base::Timer _watchForOfflineTimer;
|
|
|
|
|
2022-03-28 20:14:10 +00:00
|
|
|
rpl::event_stream<WebViewResultSent> _webViewResultSent;
|
|
|
|
|
2019-08-08 14:13:26 +00:00
|
|
|
Groups _groups;
|
2021-12-07 11:11:27 +00:00
|
|
|
const std::unique_ptr<ChatFilters> _chatsFilters;
|
2019-08-08 17:07:55 +00:00
|
|
|
std::unique_ptr<ScheduledMessages> _scheduledMessages;
|
2021-12-07 11:11:27 +00:00
|
|
|
const std::unique_ptr<CloudThemes> _cloudThemes;
|
|
|
|
const std::unique_ptr<SendActionManager> _sendActionManager;
|
|
|
|
const std::unique_ptr<Streaming> _streaming;
|
|
|
|
const std::unique_ptr<MediaRotation> _mediaRotation;
|
|
|
|
const std::unique_ptr<Histories> _histories;
|
|
|
|
const std::unique_ptr<Stickers> _stickers;
|
2021-09-26 18:24:47 +00:00
|
|
|
std::unique_ptr<SponsoredMessages> _sponsoredMessages;
|
2021-12-07 11:11:27 +00:00
|
|
|
const std::unique_ptr<Reactions> _reactions;
|
2022-08-30 15:21:14 +00:00
|
|
|
const std::unique_ptr<EmojiStatuses> _emojiStatuses;
|
2022-10-21 17:13:13 +00:00
|
|
|
const std::unique_ptr<ForumIcons> _forumIcons;
|
2022-04-01 10:18:07 +00:00
|
|
|
const std::unique_ptr<NotifySettings> _notifySettings;
|
2022-06-23 13:52:15 +00:00
|
|
|
const std::unique_ptr<CustomEmojiManager> _customEmojiManager;
|
2023-05-03 18:30:37 +00:00
|
|
|
const std::unique_ptr<Stories> _stories;
|
2021-12-07 11:11:27 +00:00
|
|
|
|
2022-03-11 07:04:46 +00:00
|
|
|
MsgId _nonHistoryEntryId = ServerMaxMsgId.bare + ScheduledMsgIdsRange;
|
2019-08-08 14:13:26 +00:00
|
|
|
|
2018-01-04 10:22:53 +00:00
|
|
|
rpl::lifetime _lifetime;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Data
|