2015-03-19 09:18: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.
|
2015-03-19 09:18: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
|
2015-03-19 09:18:19 +00:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2019-08-12 12:11:34 +00:00
|
|
|
#include "api/api_common.h"
|
2017-04-07 12:10:10 +00:00
|
|
|
#include "base/timer.h"
|
2017-08-11 07:16:07 +00:00
|
|
|
#include "base/flat_map.h"
|
|
|
|
#include "base/flat_set.h"
|
2018-01-09 17:08:31 +00:00
|
|
|
#include "mtproto/sender.h"
|
2020-06-08 17:24:36 +00:00
|
|
|
#include "data/stickers/data_stickers_set.h"
|
2018-01-09 17:08:31 +00:00
|
|
|
#include "data/data_messages.h"
|
2016-10-05 16:56:27 +00:00
|
|
|
|
2017-12-19 16:57:42 +00:00
|
|
|
class TaskQueue;
|
|
|
|
struct MessageGroupId;
|
|
|
|
struct SendingAlbum;
|
|
|
|
enum class SendMediaType;
|
2018-06-26 15:34:38 +00:00
|
|
|
struct FileLoadTo;
|
2021-07-08 10:34:06 +00:00
|
|
|
struct ChatRestrictionsInfo;
|
2018-06-26 15:34:38 +00:00
|
|
|
|
2019-07-24 11:45:24 +00:00
|
|
|
namespace Main {
|
|
|
|
class Session;
|
|
|
|
} // namespace Main
|
|
|
|
|
2019-01-04 11:09:48 +00:00
|
|
|
namespace Data {
|
|
|
|
struct UpdatedFileReferences;
|
2019-01-28 13:59:49 +00:00
|
|
|
class WallPaper;
|
2021-08-31 16:47:38 +00:00
|
|
|
struct ResolvedForwardDraft;
|
2019-01-04 11:09:48 +00:00
|
|
|
} // namespace Data
|
|
|
|
|
2018-06-26 15:34:38 +00:00
|
|
|
namespace InlineBots {
|
|
|
|
class Result;
|
|
|
|
} // namespace InlineBots
|
2017-06-05 13:33:45 +00:00
|
|
|
|
2017-08-18 19:14:31 +00:00
|
|
|
namespace Storage {
|
2018-03-09 20:48:47 +00:00
|
|
|
enum class SharedMediaType : signed char;
|
2019-12-05 08:32:33 +00:00
|
|
|
class DownloadMtprotoTask;
|
2020-06-09 16:57:05 +00:00
|
|
|
class Account;
|
2017-08-18 19:14:31 +00:00
|
|
|
} // namespace Storage
|
|
|
|
|
2018-02-21 21:17:36 +00:00
|
|
|
namespace Dialogs {
|
|
|
|
class Key;
|
|
|
|
} // namespace Dialogs
|
|
|
|
|
2020-10-13 12:07:53 +00:00
|
|
|
namespace Ui {
|
|
|
|
struct PreparedList;
|
|
|
|
} // namespace Ui
|
|
|
|
|
2016-10-23 21:03:10 +00:00
|
|
|
namespace Api {
|
2020-07-03 16:53:24 +00:00
|
|
|
|
|
|
|
class Updates;
|
2020-09-08 15:01:12 +00:00
|
|
|
class Authorizations;
|
2020-10-29 23:43:35 +00:00
|
|
|
class AttachedStickers;
|
2021-08-01 22:57:36 +00:00
|
|
|
class BlockedPeers;
|
2021-08-02 19:06:33 +00:00
|
|
|
class CloudPassword;
|
2020-07-03 16:53:24 +00:00
|
|
|
class SelfDestruct;
|
|
|
|
class SensitiveContent;
|
|
|
|
class GlobalPrivacy;
|
2021-07-31 14:11:53 +00:00
|
|
|
class UserPrivacy;
|
2021-01-14 09:05:14 +00:00
|
|
|
class InviteLinks;
|
2021-09-28 21:23:58 +00:00
|
|
|
class ViewsManager;
|
2021-10-18 19:49:42 +00:00
|
|
|
class ConfirmPhone;
|
2021-10-20 16:54:22 +00:00
|
|
|
class PeerPhoto;
|
2021-10-20 19:56:10 +00:00
|
|
|
class Polls;
|
2020-07-03 16:53:24 +00:00
|
|
|
|
2019-07-16 11:46:50 +00:00
|
|
|
namespace details {
|
|
|
|
|
|
|
|
inline QString ToString(const QString &value) {
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline QString ToString(int32 value) {
|
|
|
|
return QString::number(value);
|
|
|
|
}
|
|
|
|
|
|
|
|
inline QString ToString(uint64 value) {
|
|
|
|
return QString::number(value);
|
|
|
|
}
|
|
|
|
|
2021-04-01 21:04:10 +00:00
|
|
|
template <uchar Shift>
|
|
|
|
inline QString ToString(ChatIdType<Shift> value) {
|
|
|
|
return QString::number(value.bare);
|
|
|
|
}
|
|
|
|
|
|
|
|
inline QString ToString(PeerId value) {
|
|
|
|
return QString::number(value.value);
|
|
|
|
}
|
|
|
|
|
2019-07-16 11:46:50 +00:00
|
|
|
} // namespace details
|
2016-10-23 21:03:10 +00:00
|
|
|
|
2019-07-16 11:46:50 +00:00
|
|
|
template <
|
|
|
|
typename ...Types,
|
|
|
|
typename = std::enable_if_t<(sizeof...(Types) > 0)>>
|
|
|
|
QString RequestKey(Types &&...values) {
|
|
|
|
const auto strings = { details::ToString(values)... };
|
|
|
|
if (strings.size() == 1) {
|
|
|
|
return *strings.begin();
|
|
|
|
}
|
|
|
|
|
|
|
|
auto result = QString();
|
|
|
|
result.reserve(
|
|
|
|
ranges::accumulate(strings, 0, ranges::plus(), &QString::size));
|
|
|
|
for (const auto &string : strings) {
|
|
|
|
result.append(string);
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2016-10-23 21:03:10 +00:00
|
|
|
} // namespace Api
|
|
|
|
|
2021-07-15 11:12:38 +00:00
|
|
|
class ApiWrap final : public MTP::Sender {
|
2015-03-19 09:18:19 +00:00
|
|
|
public:
|
2019-08-12 12:11:34 +00:00
|
|
|
using SendAction = Api::SendAction;
|
|
|
|
using MessageToSend = Api::MessageToSend;
|
|
|
|
|
2019-07-24 11:45:24 +00:00
|
|
|
explicit ApiWrap(not_null<Main::Session*> session);
|
2019-12-09 12:59:08 +00:00
|
|
|
~ApiWrap();
|
2019-06-17 11:54:00 +00:00
|
|
|
|
2020-06-09 16:57:05 +00:00
|
|
|
[[nodiscard]] Main::Session &session() const;
|
|
|
|
[[nodiscard]] Storage::Account &local() const;
|
2020-06-11 09:41:03 +00:00
|
|
|
[[nodiscard]] Api::Updates &updates() const;
|
2015-03-19 09:18:19 +00:00
|
|
|
|
2019-07-16 11:46:50 +00:00
|
|
|
void applyUpdates(
|
|
|
|
const MTPUpdates &updates,
|
|
|
|
uint64 sentMessageRandomId = 0);
|
2020-02-21 10:29:48 +00:00
|
|
|
int applyAffectedHistory(
|
2021-01-21 15:57:12 +00:00
|
|
|
PeerData *peer, // May be nullptr, like for deletePhoneCallHistory.
|
2020-02-21 10:29:48 +00:00
|
|
|
const MTPmessages_AffectedHistory &result);
|
2019-07-16 11:46:50 +00:00
|
|
|
|
|
|
|
void registerModifyRequest(const QString &key, mtpRequestId requestId);
|
|
|
|
void clearModifyRequest(const QString &key);
|
|
|
|
|
2019-04-23 09:40:14 +00:00
|
|
|
void applyNotifySettings(
|
|
|
|
MTPInputNotifyPeer peer,
|
|
|
|
const MTPPeerNotifySettings &settings);
|
2017-04-13 17:59:05 +00:00
|
|
|
|
2020-06-11 09:41:03 +00:00
|
|
|
void saveCurrentDraftToCloud();
|
|
|
|
|
2019-04-22 14:22:39 +00:00
|
|
|
void savePinnedOrder(Data::Folder *folder);
|
2019-04-16 08:50:59 +00:00
|
|
|
void toggleHistoryArchived(
|
|
|
|
not_null<History*> history,
|
|
|
|
bool archived,
|
|
|
|
Fn<void()> callback);
|
2018-01-03 18:00:11 +00:00
|
|
|
|
2018-06-04 15:35:11 +00:00
|
|
|
using RequestMessageDataCallback = Fn<void(ChannelData*, MsgId)>;
|
2018-01-03 18:00:11 +00:00
|
|
|
void requestMessageData(
|
|
|
|
ChannelData *channel,
|
|
|
|
MsgId msgId,
|
|
|
|
RequestMessageDataCallback callback);
|
2020-09-22 15:28:49 +00:00
|
|
|
QString exportDirectMessageLink(
|
|
|
|
not_null<HistoryItem*> item,
|
|
|
|
bool inRepliesContext);
|
2015-03-19 09:18:19 +00:00
|
|
|
|
2018-01-03 17:06:43 +00:00
|
|
|
void requestContacts();
|
2019-04-22 14:22:39 +00:00
|
|
|
void requestDialogs(Data::Folder *folder = nullptr);
|
|
|
|
void requestPinnedDialogs(Data::Folder *folder = nullptr);
|
2019-04-16 16:28:41 +00:00
|
|
|
void requestMoreBlockedByDateDialogs();
|
2020-03-18 14:37:04 +00:00
|
|
|
void requestMoreDialogsIfNeeded();
|
2019-04-16 16:28:41 +00:00
|
|
|
rpl::producer<bool> dialogsLoadMayBlockByDate() const;
|
|
|
|
rpl::producer<bool> dialogsLoadBlockedByDate() const;
|
|
|
|
|
2019-01-17 08:18:23 +00:00
|
|
|
void requestWallPaper(
|
|
|
|
const QString &slug,
|
|
|
|
Fn<void(const Data::WallPaper &)> done,
|
2021-03-12 12:48:00 +00:00
|
|
|
Fn<void(const MTP::Error &)> fail);
|
2019-01-17 08:18:23 +00:00
|
|
|
|
2019-01-08 13:57:22 +00:00
|
|
|
void requestFullPeer(not_null<PeerData*> peer);
|
|
|
|
void requestPeer(not_null<PeerData*> peer);
|
2015-08-07 12:11:50 +00:00
|
|
|
void requestPeers(const QList<PeerData*> &peers);
|
2019-06-07 11:32:58 +00:00
|
|
|
void requestPeerSettings(not_null<PeerData*> peer);
|
2017-12-03 16:43:42 +00:00
|
|
|
void requestLastParticipants(not_null<ChannelData*> channel);
|
|
|
|
void requestBots(not_null<ChannelData*> channel);
|
|
|
|
void requestAdmins(not_null<ChannelData*> channel);
|
|
|
|
void requestParticipantsCountDelayed(not_null<ChannelData*> channel);
|
2015-03-19 09:18:19 +00:00
|
|
|
|
2018-07-16 17:31:07 +00:00
|
|
|
using UpdatedFileReferences = Data::UpdatedFileReferences;
|
|
|
|
using FileReferencesHandler = FnMut<void(const UpdatedFileReferences&)>;
|
|
|
|
void refreshFileReference(
|
|
|
|
Data::FileOrigin origin,
|
|
|
|
FileReferencesHandler &&handler);
|
2018-07-15 16:36:19 +00:00
|
|
|
void refreshFileReference(
|
|
|
|
Data::FileOrigin origin,
|
2019-12-05 08:32:33 +00:00
|
|
|
not_null<Storage::DownloadMtprotoTask*> task,
|
2018-07-15 16:36:19 +00:00
|
|
|
int requestId,
|
|
|
|
const QByteArray ¤t);
|
|
|
|
|
2017-12-29 18:17:07 +00:00
|
|
|
void requestChangelog(
|
|
|
|
const QString &sinceVersion,
|
2018-06-04 15:35:11 +00:00
|
|
|
Fn<void(const MTPUpdates &result)> callback);
|
2020-04-24 10:31:28 +00:00
|
|
|
void refreshTopPromotion();
|
2018-04-18 15:42:02 +00:00
|
|
|
void requestDeepLinkInfo(
|
|
|
|
const QString &path,
|
2018-06-04 15:35:11 +00:00
|
|
|
Fn<void(const MTPDhelp_deepLinkInfo &result)> callback);
|
2018-06-03 13:30:40 +00:00
|
|
|
void requestTermsUpdate();
|
|
|
|
void acceptTerms(bytes::const_span termsId);
|
2017-12-29 18:17:07 +00:00
|
|
|
|
2018-11-26 11:55:02 +00:00
|
|
|
void checkChatInvite(
|
|
|
|
const QString &hash,
|
|
|
|
FnMut<void(const MTPChatInvite &)> done,
|
2021-03-12 12:48:00 +00:00
|
|
|
Fn<void(const MTP::Error &)> fail);
|
2021-10-12 12:50:18 +00:00
|
|
|
void importChatInvite(const QString &hash, bool isGroup);
|
2018-11-26 11:55:02 +00:00
|
|
|
|
2017-11-19 14:41:52 +00:00
|
|
|
void requestChannelMembersForAdd(
|
|
|
|
not_null<ChannelData*> channel,
|
2018-06-04 15:35:11 +00:00
|
|
|
Fn<void(const MTPchannels_ChannelParticipants&)> callback);
|
2019-01-08 13:57:22 +00:00
|
|
|
void processFullPeer(
|
|
|
|
not_null<PeerData*> peer,
|
|
|
|
const MTPmessages_ChatFull &result);
|
|
|
|
void processFullPeer(
|
|
|
|
not_null<UserData*> user,
|
|
|
|
const MTPUserFull &result);
|
2015-10-30 15:57:22 +00:00
|
|
|
|
2019-01-13 13:28:05 +00:00
|
|
|
void migrateChat(
|
|
|
|
not_null<ChatData*> chat,
|
|
|
|
FnMut<void(not_null<ChannelData*>)> done,
|
2021-03-12 12:48:00 +00:00
|
|
|
Fn<void(const MTP::Error &)> fail = nullptr);
|
2019-01-13 13:28:05 +00:00
|
|
|
|
2018-01-17 16:21:01 +00:00
|
|
|
void markMediaRead(const base::flat_set<not_null<HistoryItem*>> &items);
|
|
|
|
void markMediaRead(not_null<HistoryItem*> item);
|
|
|
|
|
2019-01-16 09:01:38 +00:00
|
|
|
void requestSelfParticipant(not_null<ChannelData*> channel);
|
2021-03-19 14:01:21 +00:00
|
|
|
void kickParticipant(
|
|
|
|
not_null<ChatData*> chat,
|
|
|
|
not_null<PeerData*> participant);
|
2017-12-26 16:12:10 +00:00
|
|
|
void kickParticipant(
|
|
|
|
not_null<ChannelData*> channel,
|
2021-03-19 14:01:21 +00:00
|
|
|
not_null<PeerData*> participant,
|
2021-07-08 10:34:06 +00:00
|
|
|
ChatRestrictionsInfo currentRights);
|
2017-12-26 16:12:10 +00:00
|
|
|
void unblockParticipant(
|
|
|
|
not_null<ChannelData*> channel,
|
2021-03-19 14:01:21 +00:00
|
|
|
not_null<PeerData*> participant);
|
2018-01-31 17:10:29 +00:00
|
|
|
void deleteAllFromUser(
|
|
|
|
not_null<ChannelData*> channel,
|
|
|
|
not_null<UserData*> from);
|
2015-09-21 20:57:42 +00:00
|
|
|
|
2015-04-04 20:01:34 +00:00
|
|
|
void requestWebPageDelayed(WebPageData *page);
|
|
|
|
void clearWebPageRequest(WebPageData *page);
|
|
|
|
void clearWebPageRequests();
|
|
|
|
|
2015-06-28 12:37:10 +00:00
|
|
|
void scheduleStickerSetRequest(uint64 setId, uint64 access);
|
|
|
|
void requestStickerSets();
|
2018-01-23 16:51:12 +00:00
|
|
|
void saveStickerSets(
|
2020-06-08 17:24:36 +00:00
|
|
|
const Data::StickersSetsOrder &localOrder,
|
2021-03-29 20:26:14 +00:00
|
|
|
const Data::StickersSetsOrder &localRemoved,
|
|
|
|
bool setsMasks);
|
2017-08-02 15:07:28 +00:00
|
|
|
void updateStickers();
|
2021-03-25 11:05:33 +00:00
|
|
|
void updateMasks();
|
|
|
|
void requestRecentStickersForce(bool attached = false);
|
2018-01-23 16:51:12 +00:00
|
|
|
void setGroupStickerSet(
|
|
|
|
not_null<ChannelData*> megagroup,
|
2021-07-08 16:42:57 +00:00
|
|
|
const StickerSetIdentifier &set);
|
2018-03-07 13:53:12 +00:00
|
|
|
std::vector<not_null<DocumentData*>> *stickersByEmoji(
|
|
|
|
not_null<EmojiPtr> emoji);
|
2015-06-28 12:37:10 +00:00
|
|
|
|
2018-03-16 16:56:07 +00:00
|
|
|
void joinChannel(not_null<ChannelData*> channel);
|
|
|
|
void leaveChannel(not_null<ChannelData*> channel);
|
2016-05-25 17:59:21 +00:00
|
|
|
|
2018-04-09 17:48:29 +00:00
|
|
|
void requestNotifySettings(const MTPInputNotifyPeer &peer);
|
|
|
|
void updateNotifySettingsDelayed(not_null<const PeerData*> peer);
|
|
|
|
void saveDraftToCloudDelayed(not_null<History*> history);
|
2016-06-07 19:59:39 +00:00
|
|
|
|
2018-09-11 12:50:40 +00:00
|
|
|
static int OnlineTillFromStatus(
|
|
|
|
const MTPUserStatus &status,
|
|
|
|
int currentOnlineTill);
|
2017-03-17 17:19:46 +00:00
|
|
|
|
2019-03-21 12:07:32 +00:00
|
|
|
void clearHistory(not_null<PeerData*> peer, bool revoke);
|
|
|
|
void deleteConversation(not_null<PeerData*> peer, bool revoke);
|
2017-11-21 16:38:17 +00:00
|
|
|
|
2017-04-29 20:06:32 +00:00
|
|
|
bool isQuitPrevent();
|
|
|
|
|
2018-02-21 21:17:36 +00:00
|
|
|
void jumpToDate(Dialogs::Key chat, const QDate &date);
|
2017-08-01 11:43:50 +00:00
|
|
|
|
2017-08-17 08:31:24 +00:00
|
|
|
void preloadEnoughUnreadMentions(not_null<History*> history);
|
2019-01-10 06:26:08 +00:00
|
|
|
void checkForUnreadMentions(
|
|
|
|
const base::flat_set<MsgId> &possiblyReadMentions,
|
|
|
|
ChannelData *channel = nullptr);
|
2017-08-14 12:48:11 +00:00
|
|
|
|
2018-01-09 17:08:31 +00:00
|
|
|
using SliceType = Data::LoadDirection;
|
2017-08-18 19:14:31 +00:00
|
|
|
void requestSharedMedia(
|
|
|
|
not_null<PeerData*> peer,
|
|
|
|
Storage::SharedMediaType type,
|
|
|
|
MsgId messageId,
|
|
|
|
SliceType slice);
|
|
|
|
void requestSharedMediaCount(
|
|
|
|
not_null<PeerData*> peer,
|
2017-10-29 15:32:01 +00:00
|
|
|
Storage::SharedMediaType type);
|
2017-08-18 19:14:31 +00:00
|
|
|
|
2017-08-29 19:52:52 +00:00
|
|
|
void requestUserPhotos(
|
|
|
|
not_null<UserData*> user,
|
|
|
|
PhotoId afterId);
|
|
|
|
|
2017-11-05 17:07:27 +00:00
|
|
|
void readFeaturedSetDelayed(uint64 setId);
|
2017-09-16 16:53:41 +00:00
|
|
|
|
2017-11-20 19:54:05 +00:00
|
|
|
void parseChannelParticipants(
|
2017-12-01 18:38:44 +00:00
|
|
|
not_null<ChannelData*> channel,
|
2017-11-20 19:54:05 +00:00
|
|
|
const MTPchannels_ChannelParticipants &result,
|
2018-06-04 15:35:11 +00:00
|
|
|
Fn<void(
|
2017-11-28 18:30:01 +00:00
|
|
|
int availableCount,
|
|
|
|
const QVector<MTPChannelParticipant> &list)> callbackList,
|
2018-06-04 15:35:11 +00:00
|
|
|
Fn<void()> callbackNotModified = nullptr);
|
2017-11-22 09:56:00 +00:00
|
|
|
void parseRecentChannelParticipants(
|
|
|
|
not_null<ChannelData*> channel,
|
|
|
|
const MTPchannels_ChannelParticipants &result,
|
2018-06-04 15:35:11 +00:00
|
|
|
Fn<void(
|
2017-11-28 18:30:01 +00:00
|
|
|
int availableCount,
|
2019-06-14 16:04:45 +00:00
|
|
|
const QVector<MTPChannelParticipant> &list)> callbackList = nullptr,
|
2018-06-04 15:35:11 +00:00
|
|
|
Fn<void()> callbackNotModified = nullptr);
|
2018-12-28 11:42:58 +00:00
|
|
|
void addChatParticipants(
|
|
|
|
not_null<PeerData*> peer,
|
2020-12-21 19:43:23 +00:00
|
|
|
const std::vector<not_null<UserData*>> &users,
|
|
|
|
Fn<void(bool)> done = nullptr);
|
2017-11-20 19:54:05 +00:00
|
|
|
|
2019-08-12 12:11:34 +00:00
|
|
|
rpl::producer<SendAction> sendActions() const {
|
2017-12-07 13:02:24 +00:00
|
|
|
return _sendActions.events();
|
|
|
|
}
|
2019-08-12 12:11:34 +00:00
|
|
|
void sendAction(const SendAction &action);
|
2020-06-12 12:12:34 +00:00
|
|
|
void finishForwarding(const SendAction &action);
|
2017-12-06 13:56:40 +00:00
|
|
|
void forwardMessages(
|
2021-08-31 16:47:38 +00:00
|
|
|
Data::ResolvedForwardDraft &&draft,
|
2019-08-12 12:11:34 +00:00
|
|
|
const SendAction &action,
|
2018-06-04 15:35:11 +00:00
|
|
|
FnMut<void()> &&successCallback = nullptr);
|
2017-12-07 13:02:24 +00:00
|
|
|
void shareContact(
|
|
|
|
const QString &phone,
|
|
|
|
const QString &firstName,
|
|
|
|
const QString &lastName,
|
2019-08-12 12:11:34 +00:00
|
|
|
const SendAction &action);
|
|
|
|
void shareContact(not_null<UserData*> user, const SendAction &action);
|
2020-02-18 11:39:24 +00:00
|
|
|
void applyAffectedMessages(
|
|
|
|
not_null<PeerData*> peer,
|
|
|
|
const MTPmessages_AffectedMessages &result);
|
2017-12-06 13:56:40 +00:00
|
|
|
|
2017-12-19 16:57:42 +00:00
|
|
|
void sendVoiceMessage(
|
|
|
|
QByteArray result,
|
|
|
|
VoiceWaveform waveform,
|
|
|
|
int duration,
|
2019-08-12 12:11:34 +00:00
|
|
|
const SendAction &action);
|
2017-12-19 16:57:42 +00:00
|
|
|
void sendFiles(
|
2020-10-13 12:07:53 +00:00
|
|
|
Ui::PreparedList &&list,
|
2017-12-19 16:57:42 +00:00
|
|
|
SendMediaType type,
|
2018-05-24 13:03:21 +00:00
|
|
|
TextWithTags &&caption,
|
2017-12-19 16:57:42 +00:00
|
|
|
std::shared_ptr<SendingAlbum> album,
|
2019-08-12 12:11:34 +00:00
|
|
|
const SendAction &action);
|
2017-12-19 16:57:42 +00:00
|
|
|
void sendFile(
|
|
|
|
const QByteArray &fileContent,
|
|
|
|
SendMediaType type,
|
2019-08-12 12:11:34 +00:00
|
|
|
const SendAction &action);
|
2017-12-19 16:57:42 +00:00
|
|
|
|
2019-03-24 12:39:19 +00:00
|
|
|
void editMedia(
|
2020-10-13 12:07:53 +00:00
|
|
|
Ui::PreparedList &&list,
|
2019-03-24 12:39:19 +00:00
|
|
|
SendMediaType type,
|
|
|
|
TextWithTags &&caption,
|
2021-03-09 09:11:40 +00:00
|
|
|
const SendAction &action);
|
2019-03-24 12:39:19 +00:00
|
|
|
|
2017-12-19 16:57:42 +00:00
|
|
|
void sendUploadedPhoto(
|
|
|
|
FullMsgId localId,
|
|
|
|
const MTPInputFile &file,
|
2021-03-14 09:46:17 +00:00
|
|
|
Api::SendOptions options,
|
|
|
|
std::vector<MTPInputDocument> attachedStickers);
|
2017-12-19 16:57:42 +00:00
|
|
|
void sendUploadedDocument(
|
|
|
|
FullMsgId localId,
|
|
|
|
const MTPInputFile &file,
|
2018-09-21 16:28:46 +00:00
|
|
|
const std::optional<MTPInputFile> &thumb,
|
2021-03-14 09:46:17 +00:00
|
|
|
Api::SendOptions options,
|
|
|
|
std::vector<MTPInputDocument> attachedStickers);
|
2019-03-24 12:39:19 +00:00
|
|
|
|
2017-12-25 14:17:00 +00:00
|
|
|
void cancelLocalItem(not_null<HistoryItem*> item);
|
2017-12-19 16:57:42 +00:00
|
|
|
|
2018-06-26 15:34:38 +00:00
|
|
|
void sendMessage(MessageToSend &&message);
|
2018-12-28 11:42:58 +00:00
|
|
|
void sendBotStart(not_null<UserData*> bot, PeerData *chat = nullptr);
|
2018-06-26 15:34:38 +00:00
|
|
|
void sendInlineResult(
|
|
|
|
not_null<UserData*> bot,
|
|
|
|
not_null<InlineBots::Result*> data,
|
2019-08-12 12:11:34 +00:00
|
|
|
const SendAction &action);
|
2019-07-17 14:34:39 +00:00
|
|
|
void sendMessageFail(
|
2021-03-12 12:48:00 +00:00
|
|
|
const MTP::Error &error,
|
2019-07-17 14:34:39 +00:00
|
|
|
not_null<PeerData*> peer,
|
2019-09-09 08:13:41 +00:00
|
|
|
uint64 randomId = 0,
|
2019-07-17 14:34:39 +00:00
|
|
|
FullMsgId itemId = FullMsgId());
|
2018-06-26 15:34:38 +00:00
|
|
|
|
2019-01-18 09:24:10 +00:00
|
|
|
void reloadContactSignupSilent();
|
|
|
|
rpl::producer<bool> contactSignupSilent() const;
|
|
|
|
std::optional<bool> contactSignupSilentCurrent() const;
|
|
|
|
void saveContactSignupSilent(bool silent);
|
|
|
|
|
2021-10-18 13:05:43 +00:00
|
|
|
void saveSelfBio(const QString &text);
|
2018-09-09 17:38:08 +00:00
|
|
|
|
2020-09-08 15:01:12 +00:00
|
|
|
[[nodiscard]] Api::Authorizations &authorizations();
|
2020-10-29 23:43:35 +00:00
|
|
|
[[nodiscard]] Api::AttachedStickers &attachedStickers();
|
2021-08-01 22:57:36 +00:00
|
|
|
[[nodiscard]] Api::BlockedPeers &blockedPeers();
|
2021-08-02 19:06:33 +00:00
|
|
|
[[nodiscard]] Api::CloudPassword &cloudPassword();
|
2019-12-09 12:59:08 +00:00
|
|
|
[[nodiscard]] Api::SelfDestruct &selfDestruct();
|
|
|
|
[[nodiscard]] Api::SensitiveContent &sensitiveContent();
|
2020-07-03 16:53:24 +00:00
|
|
|
[[nodiscard]] Api::GlobalPrivacy &globalPrivacy();
|
2021-07-31 14:11:53 +00:00
|
|
|
[[nodiscard]] Api::UserPrivacy &userPrivacy();
|
2021-01-14 09:05:14 +00:00
|
|
|
[[nodiscard]] Api::InviteLinks &inviteLinks();
|
2021-09-28 21:23:58 +00:00
|
|
|
[[nodiscard]] Api::ViewsManager &views();
|
2021-10-18 19:49:42 +00:00
|
|
|
[[nodiscard]] Api::ConfirmPhone &confirmPhone();
|
2021-10-20 16:54:22 +00:00
|
|
|
[[nodiscard]] Api::PeerPhoto &peerPhoto();
|
2021-10-20 19:56:10 +00:00
|
|
|
[[nodiscard]] Api::Polls &polls();
|
2018-12-19 11:20:04 +00:00
|
|
|
|
2021-07-31 14:11:53 +00:00
|
|
|
void updatePrivacyLastSeens();
|
|
|
|
|
2015-03-19 09:18:19 +00:00
|
|
|
private:
|
2016-03-10 10:15:21 +00:00
|
|
|
struct MessageDataRequest {
|
2021-09-03 11:09:57 +00:00
|
|
|
using Callbacks = std::vector<RequestMessageDataCallback>;
|
|
|
|
|
2017-04-06 19:02:40 +00:00
|
|
|
mtpRequestId requestId = 0;
|
2016-03-10 10:15:21 +00:00
|
|
|
Callbacks callbacks;
|
2015-03-19 09:18:19 +00:00
|
|
|
};
|
2021-09-03 11:09:57 +00:00
|
|
|
using MessageDataRequests = base::flat_map<MsgId, MessageDataRequest>;
|
2017-08-18 19:14:31 +00:00
|
|
|
using SharedMediaType = Storage::SharedMediaType;
|
2017-04-06 19:02:40 +00:00
|
|
|
|
2018-03-07 13:53:12 +00:00
|
|
|
struct StickersByEmoji {
|
|
|
|
std::vector<not_null<DocumentData*>> list;
|
2021-08-25 08:15:05 +00:00
|
|
|
uint64 hash = 0;
|
2019-02-19 06:57:53 +00:00
|
|
|
crl::time received = 0;
|
2018-03-07 13:53:12 +00:00
|
|
|
};
|
|
|
|
|
2019-04-17 12:08:02 +00:00
|
|
|
struct DialogsLoadState {
|
|
|
|
TimeId offsetDate = 0;
|
|
|
|
MsgId offsetId = 0;
|
|
|
|
PeerData *offsetPeer = nullptr;
|
|
|
|
mtpRequestId requestId = 0;
|
2019-04-19 08:47:49 +00:00
|
|
|
bool listReceived = false;
|
|
|
|
|
|
|
|
mtpRequestId pinnedRequestId = 0;
|
|
|
|
bool pinnedReceived = false;
|
2019-04-17 12:08:02 +00:00
|
|
|
};
|
|
|
|
|
2019-04-16 16:28:41 +00:00
|
|
|
void setupSupportMode();
|
|
|
|
void refreshDialogsLoadBlocked();
|
|
|
|
void updateDialogsOffset(
|
2019-04-22 14:22:39 +00:00
|
|
|
Data::Folder *folder,
|
2019-04-16 16:28:41 +00:00
|
|
|
const QVector<MTPDialog> &dialogs,
|
|
|
|
const QVector<MTPMessage> &messages);
|
2019-04-22 14:22:39 +00:00
|
|
|
void requestMoreDialogs(Data::Folder *folder);
|
|
|
|
DialogsLoadState *dialogsLoadState(Data::Folder *folder);
|
|
|
|
void dialogsLoadFinish(Data::Folder *folder);
|
2019-04-16 16:28:41 +00:00
|
|
|
|
2017-04-29 20:06:32 +00:00
|
|
|
void checkQuitPreventFinished();
|
|
|
|
|
|
|
|
void saveDraftsToCloud();
|
2017-04-06 19:02:40 +00:00
|
|
|
|
|
|
|
void resolveMessageDatas();
|
2017-11-23 15:41:13 +00:00
|
|
|
void finalizeMessageDataRequest(
|
|
|
|
ChannelData *channel,
|
|
|
|
mtpRequestId requestId);
|
2017-04-06 19:02:40 +00:00
|
|
|
|
2021-09-03 11:09:57 +00:00
|
|
|
[[nodiscard]] QVector<MTPInputMessage> collectMessageIds(
|
|
|
|
const MessageDataRequests &requests);
|
|
|
|
[[nodiscard]] MessageDataRequests *messageDataRequests(
|
|
|
|
ChannelData *channel,
|
|
|
|
bool onlyExisting = false);
|
2015-03-19 09:18:19 +00:00
|
|
|
|
2019-01-08 13:57:22 +00:00
|
|
|
void gotChatFull(
|
|
|
|
not_null<PeerData*> peer,
|
|
|
|
const MTPmessages_ChatFull &result,
|
|
|
|
mtpRequestId req);
|
|
|
|
void gotUserFull(
|
|
|
|
not_null<UserData*> user,
|
|
|
|
const MTPUserFull &result,
|
|
|
|
mtpRequestId req);
|
2017-11-20 19:54:05 +00:00
|
|
|
void applyLastParticipantsList(
|
2017-12-03 16:43:42 +00:00
|
|
|
not_null<ChannelData*> channel,
|
|
|
|
int availableCount,
|
|
|
|
const QVector<MTPChannelParticipant> &list);
|
|
|
|
void applyBotsList(
|
|
|
|
not_null<ChannelData*> channel,
|
|
|
|
int availableCount,
|
|
|
|
const QVector<MTPChannelParticipant> &list);
|
2017-04-06 19:02:40 +00:00
|
|
|
void resolveWebPages();
|
2018-01-31 17:10:29 +00:00
|
|
|
void gotWebPages(
|
|
|
|
ChannelData *channel,
|
|
|
|
const MTPmessages_Messages &result,
|
|
|
|
mtpRequestId req);
|
2017-04-06 19:02:40 +00:00
|
|
|
void gotStickerSet(uint64 setId, const MTPmessages_StickerSet &result);
|
2016-03-05 21:12:55 +00:00
|
|
|
|
2021-08-25 08:15:05 +00:00
|
|
|
void requestStickers(TimeId now);
|
|
|
|
void requestMasks(TimeId now);
|
2021-03-25 11:05:33 +00:00
|
|
|
void requestRecentStickers(TimeId now, bool attached = false);
|
2021-08-25 08:15:05 +00:00
|
|
|
void requestRecentStickersWithHash(uint64 hash, bool attached = false);
|
2017-08-02 20:57:49 +00:00
|
|
|
void requestFavedStickers(TimeId now);
|
|
|
|
void requestFeaturedStickers(TimeId now);
|
|
|
|
void requestSavedGifs(TimeId now);
|
2017-11-05 17:07:27 +00:00
|
|
|
void readFeaturedSets();
|
2017-08-02 15:07:28 +00:00
|
|
|
|
2017-12-01 18:38:44 +00:00
|
|
|
void refreshChannelAdmins(
|
|
|
|
not_null<ChannelData*> channel,
|
|
|
|
const QVector<MTPChannelParticipant> &participants);
|
2017-08-14 12:48:11 +00:00
|
|
|
|
2018-02-21 21:17:36 +00:00
|
|
|
void jumpToHistoryDate(not_null<PeerData*> peer, const QDate &date);
|
2017-11-30 12:50:13 +00:00
|
|
|
template <typename Callback>
|
|
|
|
void requestMessageAfterDate(
|
|
|
|
not_null<PeerData*> peer,
|
|
|
|
const QDate &date,
|
|
|
|
Callback &&callback);
|
|
|
|
|
2017-08-18 19:14:31 +00:00
|
|
|
void sharedMediaDone(
|
|
|
|
not_null<PeerData*> peer,
|
|
|
|
SharedMediaType type,
|
|
|
|
MsgId messageId,
|
|
|
|
SliceType slice,
|
|
|
|
const MTPmessages_Messages &result);
|
|
|
|
|
2017-08-29 19:52:52 +00:00
|
|
|
void userPhotosDone(
|
|
|
|
not_null<UserData*> user,
|
|
|
|
PhotoId photoId,
|
|
|
|
const MTPphotos_Photos &result);
|
|
|
|
|
2017-12-07 13:02:24 +00:00
|
|
|
void sendSharedContact(
|
|
|
|
const QString &phone,
|
|
|
|
const QString &firstName,
|
|
|
|
const QString &lastName,
|
|
|
|
UserId userId,
|
2019-08-12 12:11:34 +00:00
|
|
|
const SendAction &action);
|
2017-12-07 13:02:24 +00:00
|
|
|
|
2019-03-21 12:07:32 +00:00
|
|
|
void deleteHistory(
|
|
|
|
not_null<PeerData*> peer,
|
|
|
|
bool justClear,
|
|
|
|
bool revoke);
|
2017-12-07 13:02:24 +00:00
|
|
|
void applyAffectedMessages(const MTPmessages_AffectedMessages &result);
|
2018-01-31 17:10:29 +00:00
|
|
|
|
|
|
|
void deleteAllFromUserSend(
|
|
|
|
not_null<ChannelData*> channel,
|
|
|
|
not_null<UserData*> from);
|
|
|
|
|
2017-12-19 16:57:42 +00:00
|
|
|
void uploadAlbumMedia(
|
|
|
|
not_null<HistoryItem*> item,
|
|
|
|
const MessageGroupId &groupId,
|
2017-12-25 14:17:00 +00:00
|
|
|
const MTPInputMedia &media);
|
|
|
|
void sendAlbumWithUploaded(
|
2017-12-19 16:57:42 +00:00
|
|
|
not_null<HistoryItem*> item,
|
|
|
|
const MessageGroupId &groupId,
|
2017-12-25 14:17:00 +00:00
|
|
|
const MTPInputMedia &media);
|
|
|
|
void sendAlbumWithCancelled(
|
|
|
|
not_null<HistoryItem*> item,
|
|
|
|
const MessageGroupId &groupId);
|
|
|
|
void sendAlbumIfReady(not_null<SendingAlbum*> album);
|
2017-12-19 16:57:42 +00:00
|
|
|
void sendMedia(
|
|
|
|
not_null<HistoryItem*> item,
|
|
|
|
const MTPInputMedia &media,
|
2019-08-12 12:11:34 +00:00
|
|
|
Api::SendOptions options);
|
2017-12-25 14:17:00 +00:00
|
|
|
void sendMediaWithRandomId(
|
|
|
|
not_null<HistoryItem*> item,
|
|
|
|
const MTPInputMedia &media,
|
2019-08-12 12:11:34 +00:00
|
|
|
Api::SendOptions options,
|
2017-12-25 14:17:00 +00:00
|
|
|
uint64 randomId);
|
2019-08-12 12:11:34 +00:00
|
|
|
FileLoadTo fileLoadTaskOptions(const SendAction &action) const;
|
2017-12-07 13:02:24 +00:00
|
|
|
|
2020-04-24 10:31:28 +00:00
|
|
|
void getTopPromotionDelayed(TimeId now, TimeId next);
|
|
|
|
void topPromotionDone(const MTPhelp_PromoData &proxy);
|
2018-05-11 14:03:53 +00:00
|
|
|
|
2018-04-09 17:48:29 +00:00
|
|
|
void sendNotifySettingsUpdates();
|
|
|
|
|
2018-07-15 16:36:19 +00:00
|
|
|
template <typename Request>
|
|
|
|
void requestFileReference(
|
|
|
|
Data::FileOrigin origin,
|
2018-07-16 17:31:07 +00:00
|
|
|
FileReferencesHandler &&handler,
|
2018-07-15 16:36:19 +00:00
|
|
|
Request &&data);
|
|
|
|
|
2019-01-14 06:34:51 +00:00
|
|
|
void migrateDone(
|
|
|
|
not_null<PeerData*> peer,
|
|
|
|
not_null<ChannelData*> channel);
|
2021-03-12 12:48:00 +00:00
|
|
|
void migrateFail(not_null<PeerData*> peer, const MTP::Error &error);
|
2019-01-14 06:34:51 +00:00
|
|
|
|
2019-07-24 11:45:24 +00:00
|
|
|
not_null<Main::Session*> _session;
|
2017-06-05 13:33:45 +00:00
|
|
|
|
2019-07-16 11:46:50 +00:00
|
|
|
base::flat_map<QString, int> _modifyRequests;
|
|
|
|
|
2017-04-06 19:02:40 +00:00
|
|
|
MessageDataRequests _messageDataRequests;
|
2021-09-03 11:09:57 +00:00
|
|
|
base::flat_map<
|
|
|
|
ChannelData*,
|
|
|
|
MessageDataRequests> _channelMessageDataRequests;
|
2017-04-06 19:02:40 +00:00
|
|
|
SingleQueuedInvokation _messageDataResolveDelayed;
|
|
|
|
|
|
|
|
using PeerRequests = QMap<PeerData*, mtpRequestId>;
|
|
|
|
PeerRequests _fullPeerRequests;
|
2015-06-29 22:09:23 +00:00
|
|
|
PeerRequests _peerRequests;
|
2019-06-07 11:32:58 +00:00
|
|
|
base::flat_set<not_null<PeerData*>> _requestedPeerSettings;
|
2015-03-19 09:18:19 +00:00
|
|
|
|
2017-04-06 19:02:40 +00:00
|
|
|
PeerRequests _participantsRequests;
|
|
|
|
PeerRequests _botsRequests;
|
2017-12-03 16:43:42 +00:00
|
|
|
PeerRequests _adminsRequests;
|
2017-04-07 12:10:10 +00:00
|
|
|
base::DelayedCallTimer _participantsCountRequestTimer;
|
2015-11-09 09:51:22 +00:00
|
|
|
|
2017-11-19 14:41:52 +00:00
|
|
|
ChannelData *_channelMembersForAdd = nullptr;
|
|
|
|
mtpRequestId _channelMembersForAddRequestId = 0;
|
2018-06-04 15:35:11 +00:00
|
|
|
Fn<void(
|
2018-01-23 16:51:12 +00:00
|
|
|
const MTPchannels_ChannelParticipants&)> _channelMembersForAddCallback;
|
|
|
|
base::flat_map<
|
2019-04-16 08:50:59 +00:00
|
|
|
not_null<History*>,
|
|
|
|
std::pair<mtpRequestId,Fn<void()>>> _historyArchivedRequests;
|
2017-11-19 14:41:52 +00:00
|
|
|
|
2017-12-26 16:12:10 +00:00
|
|
|
using KickRequest = std::pair<
|
|
|
|
not_null<ChannelData*>,
|
2021-03-19 14:01:21 +00:00
|
|
|
not_null<PeerData*>>;
|
2017-12-26 16:12:10 +00:00
|
|
|
base::flat_map<KickRequest, mtpRequestId> _kickRequests;
|
2015-11-09 09:51:22 +00:00
|
|
|
|
2019-01-16 09:01:38 +00:00
|
|
|
base::flat_set<not_null<ChannelData*>> _selfParticipantRequests;
|
2015-09-21 20:57:42 +00:00
|
|
|
|
2017-04-06 19:02:40 +00:00
|
|
|
QMap<WebPageData*, mtpRequestId> _webPagesPending;
|
2017-04-07 12:10:10 +00:00
|
|
|
base::Timer _webPagesTimer;
|
2015-04-04 20:01:34 +00:00
|
|
|
|
2015-06-28 12:37:10 +00:00
|
|
|
QMap<uint64, QPair<uint64, mtpRequestId> > _stickerSetRequests;
|
|
|
|
|
2016-05-25 17:59:21 +00:00
|
|
|
QMap<ChannelData*, mtpRequestId> _channelAmInRequests;
|
2018-06-06 19:56:35 +00:00
|
|
|
base::flat_map<PeerId, mtpRequestId> _notifySettingRequests;
|
|
|
|
base::flat_map<not_null<History*>, mtpRequestId> _draftsSaveRequestIds;
|
2017-04-07 12:10:10 +00:00
|
|
|
base::Timer _draftsSaveTimer;
|
2016-06-01 13:07:03 +00:00
|
|
|
|
2017-11-05 17:07:27 +00:00
|
|
|
base::flat_set<mtpRequestId> _stickerSetDisenableRequests;
|
2021-03-29 20:26:14 +00:00
|
|
|
base::flat_set<mtpRequestId> _maskSetDisenableRequests;
|
|
|
|
mtpRequestId _masksReorderRequestId = 0;
|
2016-11-22 09:48:13 +00:00
|
|
|
mtpRequestId _stickersReorderRequestId = 0;
|
|
|
|
mtpRequestId _stickersClearRecentRequestId = 0;
|
2021-03-25 11:05:33 +00:00
|
|
|
mtpRequestId _stickersClearRecentAttachedRequestId = 0;
|
2016-11-22 09:48:13 +00:00
|
|
|
|
2017-08-02 15:07:28 +00:00
|
|
|
mtpRequestId _stickersUpdateRequest = 0;
|
2021-03-25 11:05:33 +00:00
|
|
|
mtpRequestId _masksUpdateRequest = 0;
|
2017-08-02 15:07:28 +00:00
|
|
|
mtpRequestId _recentStickersUpdateRequest = 0;
|
2021-03-25 11:05:33 +00:00
|
|
|
mtpRequestId _recentAttachedStickersUpdateRequest = 0;
|
2017-08-02 15:07:28 +00:00
|
|
|
mtpRequestId _favedStickersUpdateRequest = 0;
|
|
|
|
mtpRequestId _featuredStickersUpdateRequest = 0;
|
|
|
|
mtpRequestId _savedGifsUpdateRequest = 0;
|
|
|
|
|
2017-11-05 17:07:27 +00:00
|
|
|
base::Timer _featuredSetsReadTimer;
|
|
|
|
base::flat_set<uint64> _featuredSetsRead;
|
|
|
|
|
2018-03-07 13:53:12 +00:00
|
|
|
base::flat_map<not_null<EmojiPtr>, StickersByEmoji> _stickersByEmoji;
|
|
|
|
|
2018-01-03 17:06:43 +00:00
|
|
|
mtpRequestId _contactsRequestId = 0;
|
2017-03-17 17:19:46 +00:00
|
|
|
mtpRequestId _contactsStatusesRequestId = 0;
|
|
|
|
|
2017-08-17 08:31:24 +00:00
|
|
|
base::flat_map<not_null<History*>, mtpRequestId> _unreadMentionsRequests;
|
2017-08-11 07:16:07 +00:00
|
|
|
|
2020-02-21 11:51:37 +00:00
|
|
|
base::flat_set<std::tuple<
|
2017-08-18 19:14:31 +00:00
|
|
|
not_null<PeerData*>,
|
|
|
|
SharedMediaType,
|
|
|
|
MsgId,
|
2020-02-21 11:51:37 +00:00
|
|
|
SliceType>> _sharedMediaRequests;
|
2017-08-14 12:48:11 +00:00
|
|
|
|
2017-08-29 19:52:52 +00:00
|
|
|
base::flat_map<not_null<UserData*>, mtpRequestId> _userPhotosRequests;
|
|
|
|
|
2019-04-17 12:08:02 +00:00
|
|
|
std::unique_ptr<DialogsLoadState> _dialogsLoadState;
|
2019-04-16 16:28:41 +00:00
|
|
|
TimeId _dialogsLoadTill = 0;
|
|
|
|
rpl::variable<bool> _dialogsLoadMayBlockByDate = false;
|
|
|
|
rpl::variable<bool> _dialogsLoadBlockedByDate = false;
|
|
|
|
|
2019-04-22 14:22:39 +00:00
|
|
|
base::flat_map<
|
|
|
|
not_null<Data::Folder*>,
|
|
|
|
DialogsLoadState> _foldersLoadState;
|
2019-04-17 12:08:02 +00:00
|
|
|
|
2019-08-12 12:11:34 +00:00
|
|
|
rpl::event_stream<SendAction> _sendActions;
|
2017-12-07 13:02:24 +00:00
|
|
|
|
2017-12-19 16:57:42 +00:00
|
|
|
std::unique_ptr<TaskQueue> _fileLoader;
|
|
|
|
base::flat_map<uint64, std::shared_ptr<SendingAlbum>> _sendingAlbums;
|
2017-12-07 13:02:24 +00:00
|
|
|
|
2020-04-24 10:31:28 +00:00
|
|
|
mtpRequestId _topPromotionRequestId = 0;
|
|
|
|
std::pair<QString, uint32> _topPromotionKey;
|
|
|
|
TimeId _topPromotionNextRequestTime = TimeId(0);
|
|
|
|
base::Timer _topPromotionTimer;
|
2018-05-11 14:03:53 +00:00
|
|
|
|
2018-04-09 17:48:29 +00:00
|
|
|
base::flat_set<not_null<const PeerData*>> _updateNotifySettingsPeers;
|
|
|
|
base::Timer _updateNotifySettingsTimer;
|
2018-05-11 14:03:53 +00:00
|
|
|
|
2018-07-15 16:36:19 +00:00
|
|
|
std::map<
|
|
|
|
Data::FileOrigin,
|
|
|
|
std::vector<FileReferencesHandler>> _fileReferenceHandlers;
|
|
|
|
|
2018-04-18 15:42:02 +00:00
|
|
|
mtpRequestId _deepLinkInfoRequestId = 0;
|
|
|
|
|
2019-02-19 06:57:53 +00:00
|
|
|
crl::time _termsUpdateSendAt = 0;
|
2018-06-03 13:30:40 +00:00
|
|
|
mtpRequestId _termsUpdateRequestId = 0;
|
|
|
|
|
2018-11-26 11:55:02 +00:00
|
|
|
mtpRequestId _checkInviteRequestId = 0;
|
|
|
|
FnMut<void(const MTPChatInvite &result)> _checkInviteDone;
|
2021-03-12 12:48:00 +00:00
|
|
|
Fn<void(const MTP::Error &error)> _checkInviteFail;
|
2018-11-26 11:55:02 +00:00
|
|
|
|
2019-01-13 13:28:05 +00:00
|
|
|
struct MigrateCallbacks {
|
|
|
|
FnMut<void(not_null<ChannelData*>)> done;
|
2021-03-12 12:48:00 +00:00
|
|
|
Fn<void(const MTP::Error&)> fail;
|
2019-01-13 13:28:05 +00:00
|
|
|
};
|
|
|
|
base::flat_map<
|
2019-01-14 06:34:51 +00:00
|
|
|
not_null<PeerData*>,
|
2019-01-13 13:28:05 +00:00
|
|
|
std::vector<MigrateCallbacks>> _migrateCallbacks;
|
|
|
|
|
2018-09-06 10:18:49 +00:00
|
|
|
std::vector<FnMut<void(const MTPUser &)>> _supportContactCallbacks;
|
|
|
|
|
2021-10-18 13:05:43 +00:00
|
|
|
struct {
|
|
|
|
mtpRequestId requestId = 0;
|
|
|
|
QString requestedText;
|
|
|
|
} _bio;
|
2018-09-09 17:38:08 +00:00
|
|
|
|
2020-09-08 15:01:12 +00:00
|
|
|
const std::unique_ptr<Api::Authorizations> _authorizations;
|
2020-10-29 23:43:35 +00:00
|
|
|
const std::unique_ptr<Api::AttachedStickers> _attachedStickers;
|
2021-08-01 22:57:36 +00:00
|
|
|
const std::unique_ptr<Api::BlockedPeers> _blockedPeers;
|
2021-08-02 19:06:33 +00:00
|
|
|
const std::unique_ptr<Api::CloudPassword> _cloudPassword;
|
2019-12-09 12:59:08 +00:00
|
|
|
const std::unique_ptr<Api::SelfDestruct> _selfDestruct;
|
|
|
|
const std::unique_ptr<Api::SensitiveContent> _sensitiveContent;
|
2020-07-03 16:53:24 +00:00
|
|
|
const std::unique_ptr<Api::GlobalPrivacy> _globalPrivacy;
|
2021-07-31 14:11:53 +00:00
|
|
|
const std::unique_ptr<Api::UserPrivacy> _userPrivacy;
|
2021-01-14 09:05:14 +00:00
|
|
|
const std::unique_ptr<Api::InviteLinks> _inviteLinks;
|
2021-09-28 21:23:58 +00:00
|
|
|
const std::unique_ptr<Api::ViewsManager> _views;
|
2021-10-18 19:49:42 +00:00
|
|
|
const std::unique_ptr<Api::ConfirmPhone> _confirmPhone;
|
2021-10-20 16:54:22 +00:00
|
|
|
const std::unique_ptr<Api::PeerPhoto> _peerPhoto;
|
2021-10-20 19:56:10 +00:00
|
|
|
const std::unique_ptr<Api::Polls> _polls;
|
2018-12-19 11:20:04 +00:00
|
|
|
|
2019-01-17 08:18:23 +00:00
|
|
|
mtpRequestId _wallPaperRequestId = 0;
|
|
|
|
QString _wallPaperSlug;
|
|
|
|
Fn<void(const Data::WallPaper &)> _wallPaperDone;
|
2021-03-12 12:48:00 +00:00
|
|
|
Fn<void(const MTP::Error &)> _wallPaperFail;
|
2019-01-17 08:18:23 +00:00
|
|
|
|
2019-01-18 09:24:10 +00:00
|
|
|
mtpRequestId _contactSignupSilentRequestId = 0;
|
|
|
|
std::optional<bool> _contactSignupSilent;
|
|
|
|
rpl::event_stream<bool> _contactSignupSilentChanges;
|
|
|
|
|
2019-04-05 11:50:16 +00:00
|
|
|
base::flat_map<FullMsgId, QString> _unlikelyMessageLinks;
|
|
|
|
|
2015-03-19 09:18:19 +00:00
|
|
|
};
|