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;
|
2022-04-06 15:23:41 +00:00
|
|
|
enum class DefaultNotify;
|
2022-07-08 17:04:31 +00:00
|
|
|
enum class StickersType : uchar;
|
2022-11-08 13:57:54 +00:00
|
|
|
class Forum;
|
2022-10-12 20:23:14 +00:00
|
|
|
class ForumTopic;
|
2022-10-13 17:34:04 +00:00
|
|
|
class Thread;
|
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
|
|
|
|
2022-05-16 09:20:31 +00:00
|
|
|
struct SearchResult;
|
|
|
|
|
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;
|
2021-11-24 04:25:05 +00:00
|
|
|
class ChatParticipants;
|
2022-01-26 16:01:40 +00:00
|
|
|
class UnreadThings;
|
2022-04-04 18:43:23 +00:00
|
|
|
class Ringtones;
|
2022-05-24 15:38:46 +00:00
|
|
|
class Transcribes;
|
2022-05-31 17:11:59 +00:00
|
|
|
class Premium;
|
2022-10-09 11:25:41 +00:00
|
|
|
class Usernames;
|
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);
|
|
|
|
|
2020-06-11 09:41:03 +00:00
|
|
|
void saveCurrentDraftToCloud();
|
|
|
|
|
2019-04-22 14:22:39 +00:00
|
|
|
void savePinnedOrder(Data::Folder *folder);
|
2022-11-08 13:57:54 +00:00
|
|
|
void savePinnedOrder(not_null<Data::Forum*> forum);
|
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
|
|
|
|
2021-12-09 07:32:54 +00:00
|
|
|
void requestMessageData(PeerData *peer, MsgId msgId, Fn<void()> done);
|
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,
|
2022-08-10 12:24:42 +00:00
|
|
|
Fn<void()> fail);
|
2019-01-17 08:18:23 +00:00
|
|
|
|
2019-01-08 13:57:22 +00:00
|
|
|
void requestFullPeer(not_null<PeerData*> peer);
|
2022-08-11 06:57:46 +00:00
|
|
|
void requestPeerSettings(not_null<PeerData*> peer);
|
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,
|
2022-08-10 12:27:41 +00:00
|
|
|
Fn<void(TextWithEntities message, bool updateRequired)> 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);
|
2023-03-28 14:14:53 +00:00
|
|
|
void checkFilterInvite(
|
|
|
|
const QString &slug,
|
2023-04-03 07:58:30 +00:00
|
|
|
FnMut<void(const MTPchatlists_ChatlistInvite &)> done,
|
2023-03-28 14:14:53 +00:00
|
|
|
Fn<void(const MTP::Error &)> fail);
|
2018-11-26 11:55:02 +00:00
|
|
|
|
2019-01-08 13:57:22 +00:00
|
|
|
void processFullPeer(
|
|
|
|
not_null<PeerData*> peer,
|
|
|
|
const MTPmessages_ChatFull &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-11-28 04:51:34 +00:00
|
|
|
Fn<void(const QString &)> fail = nullptr);
|
2019-01-13 13:28:05 +00:00
|
|
|
|
2022-01-26 16:01:40 +00:00
|
|
|
void markContentsRead(
|
|
|
|
const base::flat_set<not_null<HistoryItem*>> &items);
|
|
|
|
void markContentsRead(not_null<HistoryItem*> item);
|
2018-01-17 16:21:01 +00:00
|
|
|
|
2021-11-22 17:12:00 +00:00
|
|
|
void deleteAllFromParticipant(
|
2018-01-31 17:10:29 +00:00
|
|
|
not_null<ChannelData*> channel,
|
2021-11-22 17:12:00 +00:00
|
|
|
not_null<PeerData*> from);
|
2015-09-21 20:57:42 +00:00
|
|
|
|
2022-10-12 20:23:14 +00:00
|
|
|
void requestWebPageDelayed(not_null<WebPageData*> page);
|
|
|
|
void clearWebPageRequest(not_null<WebPageData*> page);
|
2015-04-04 20:01:34 +00:00
|
|
|
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,
|
2022-07-08 17:04:31 +00:00
|
|
|
Data::StickersType type);
|
2017-08-02 15:07:28 +00:00
|
|
|
void updateStickers();
|
2022-07-27 09:26:22 +00:00
|
|
|
void updateSavedGifs();
|
2021-03-25 11:05:33 +00:00
|
|
|
void updateMasks();
|
2022-07-08 17:04:31 +00:00
|
|
|
void updateCustomEmoji();
|
2021-03-25 11:05:33 +00:00
|
|
|
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);
|
2023-01-24 14:46:16 +00:00
|
|
|
[[nodiscard]] std::vector<not_null<DocumentData*>> *stickersByEmoji(
|
|
|
|
const QString &key);
|
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);
|
2022-10-13 17:34:04 +00:00
|
|
|
void updateNotifySettingsDelayed(not_null<const Data::Thread*> thread);
|
2018-04-09 17:48:29 +00:00
|
|
|
void updateNotifySettingsDelayed(not_null<const PeerData*> peer);
|
2022-10-12 20:23:14 +00:00
|
|
|
void updateNotifySettingsDelayed(Data::DefaultNotify type);
|
2022-10-17 16:29:48 +00:00
|
|
|
void saveDraftToCloudDelayed(not_null<Data::Thread*> thread);
|
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();
|
|
|
|
|
2022-07-19 11:29:04 +00:00
|
|
|
void resolveJumpToDate(
|
|
|
|
Dialogs::Key chat,
|
|
|
|
const QDate &date,
|
|
|
|
Fn<void(not_null<PeerData*>, MsgId)> callback);
|
2017-08-01 11:43:50 +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,
|
2022-10-11 15:08:19 +00:00
|
|
|
MsgId topicRootId,
|
2017-08-18 19:14:31 +00:00
|
|
|
Storage::SharedMediaType type,
|
|
|
|
MsgId messageId,
|
|
|
|
SliceType slice);
|
|
|
|
|
2017-11-05 17:07:27 +00:00
|
|
|
void readFeaturedSetDelayed(uint64 setId);
|
2017-09-16 16:53:41 +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,
|
2021-11-16 12:38:31 +00:00
|
|
|
Api::RemoteFileInfo info,
|
|
|
|
Api::SendOptions options);
|
2017-12-19 16:57:42 +00:00
|
|
|
void sendUploadedDocument(
|
|
|
|
FullMsgId localId,
|
2021-11-16 12:38:31 +00:00
|
|
|
Api::RemoteFileInfo file,
|
|
|
|
Api::SendOptions options);
|
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);
|
2022-03-24 09:46:44 +00:00
|
|
|
void sendBotStart(
|
|
|
|
not_null<UserData*> bot,
|
|
|
|
PeerData *chat = nullptr,
|
|
|
|
const QString &startTokenForChat = QString());
|
2018-06-26 15:34:38 +00:00
|
|
|
void sendInlineResult(
|
|
|
|
not_null<UserData*> bot,
|
|
|
|
not_null<InlineBots::Result*> data,
|
2022-02-11 04:40:11 +00:00
|
|
|
const SendAction &action,
|
|
|
|
std::optional<MsgId> localMessageId);
|
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());
|
2022-08-05 10:37:30 +00:00
|
|
|
void sendMessageFail(
|
|
|
|
const QString &error,
|
|
|
|
not_null<PeerData*> peer,
|
|
|
|
uint64 randomId = 0,
|
|
|
|
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);
|
|
|
|
|
2023-01-31 13:40:44 +00:00
|
|
|
[[nodiscard]] auto botCommonGroups(not_null<UserData*> bot) const
|
|
|
|
-> std::optional<std::vector<not_null<PeerData*>>>;
|
|
|
|
void requestBotCommonGroups(not_null<UserData*> bot, Fn<void()> done);
|
|
|
|
|
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();
|
2021-11-24 04:25:05 +00:00
|
|
|
[[nodiscard]] Api::ChatParticipants &chatParticipants();
|
2022-01-26 16:01:40 +00:00
|
|
|
[[nodiscard]] Api::UnreadThings &unreadThings();
|
2022-04-04 18:43:23 +00:00
|
|
|
[[nodiscard]] Api::Ringtones &ringtones();
|
2022-05-24 15:38:46 +00:00
|
|
|
[[nodiscard]] Api::Transcribes &transcribes();
|
2022-05-31 17:11:59 +00:00
|
|
|
[[nodiscard]] Api::Premium &premium();
|
2022-10-09 11:25:41 +00:00
|
|
|
[[nodiscard]] Api::Usernames &usernames();
|
2018-12-19 11:20:04 +00:00
|
|
|
|
2021-07-31 14:11:53 +00:00
|
|
|
void updatePrivacyLastSeens();
|
|
|
|
|
2022-02-20 22:41:51 +00:00
|
|
|
static constexpr auto kJoinErrorDuration = 5 * crl::time(1000);
|
|
|
|
|
2015-03-19 09:18:19 +00:00
|
|
|
private:
|
2016-03-10 10:15:21 +00:00
|
|
|
struct MessageDataRequest {
|
2021-12-09 07:32:54 +00:00
|
|
|
using Callbacks = std::vector<Fn<void()>>;
|
2021-09-03 11:09:57 +00:00
|
|
|
|
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,
|
2022-05-16 06:21:40 +00:00
|
|
|
const MTPmessages_ChatFull &result);
|
2019-01-08 13:57:22 +00:00
|
|
|
void gotUserFull(
|
|
|
|
not_null<UserData*> user,
|
2022-05-16 06:21:40 +00:00
|
|
|
const MTPusers_UserFull &result);
|
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);
|
2022-07-08 17:04:31 +00:00
|
|
|
void requestCustomEmoji(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);
|
2022-07-22 13:08:10 +00:00
|
|
|
void requestFeaturedEmoji(TimeId now);
|
2017-08-02 20:57:49 +00:00
|
|
|
void requestSavedGifs(TimeId now);
|
2017-11-05 17:07:27 +00:00
|
|
|
void readFeaturedSets();
|
2017-08-02 15:07:28 +00:00
|
|
|
|
2022-07-19 11:29:04 +00:00
|
|
|
void resolveJumpToHistoryDate(
|
|
|
|
not_null<PeerData*> peer,
|
2022-10-27 07:14:49 +00:00
|
|
|
MsgId topicRootId,
|
2022-07-19 11:29:04 +00:00
|
|
|
const QDate &date,
|
|
|
|
Fn<void(not_null<PeerData*>, MsgId)> callback);
|
2017-11-30 12:50:13 +00:00
|
|
|
template <typename Callback>
|
|
|
|
void requestMessageAfterDate(
|
|
|
|
not_null<PeerData*> peer,
|
2022-10-27 07:14:49 +00:00
|
|
|
MsgId topicRootId,
|
2017-11-30 12:50:13 +00:00
|
|
|
const QDate &date,
|
|
|
|
Callback &&callback);
|
|
|
|
|
2017-08-18 19:14:31 +00:00
|
|
|
void sharedMediaDone(
|
|
|
|
not_null<PeerData*> peer,
|
2022-10-11 15:08:19 +00:00
|
|
|
MsgId topicRootId,
|
2017-08-18 19:14:31 +00:00
|
|
|
SharedMediaType type,
|
2022-05-16 09:20:31 +00:00
|
|
|
Api::SearchResult &&parsed);
|
2017-08-18 19:14:31 +00:00
|
|
|
|
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
|
|
|
|
2021-11-22 17:12:00 +00:00
|
|
|
void deleteAllFromParticipantSend(
|
2018-01-31 17:10:29 +00:00
|
|
|
not_null<ChannelData*> channel,
|
2021-11-22 17:12:00 +00:00
|
|
|
not_null<PeerData*> from);
|
2018-01-31 17:10:29 +00:00
|
|
|
|
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-11-28 04:51:34 +00:00
|
|
|
void migrateFail(not_null<PeerData*> peer, const QString &error);
|
2019-01-14 06:34:51 +00:00
|
|
|
|
2022-10-12 20:23:14 +00:00
|
|
|
const 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<
|
2021-12-09 07:32:54 +00:00
|
|
|
not_null<ChannelData*>,
|
2021-09-03 11:09:57 +00:00
|
|
|
MessageDataRequests> _channelMessageDataRequests;
|
2017-04-06 19:02:40 +00:00
|
|
|
SingleQueuedInvokation _messageDataResolveDelayed;
|
|
|
|
|
2022-05-16 06:21:40 +00:00
|
|
|
using PeerRequests = base::flat_map<PeerData*, mtpRequestId>;
|
2017-04-06 19:02:40 +00:00
|
|
|
PeerRequests _fullPeerRequests;
|
2022-08-11 06:57:46 +00:00
|
|
|
base::flat_set<not_null<PeerData*>> _requestedPeerSettings;
|
2015-03-19 09:18:19 +00:00
|
|
|
|
2018-01-23 16:51:12 +00:00
|
|
|
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
|
|
|
|
2022-10-12 20:23:14 +00:00
|
|
|
base::flat_map<not_null<WebPageData*>, mtpRequestId> _webPagesPending;
|
2017-04-07 12:10:10 +00:00
|
|
|
base::Timer _webPagesTimer;
|
2015-04-04 20:01:34 +00:00
|
|
|
|
2022-10-12 20:23:14 +00:00
|
|
|
struct StickerSetRequest {
|
|
|
|
uint64 accessHash = 0;
|
|
|
|
mtpRequestId id = 0;
|
|
|
|
};
|
|
|
|
base::flat_map<uint64, StickerSetRequest> _stickerSetRequests;
|
|
|
|
|
|
|
|
base::flat_map<
|
|
|
|
not_null<ChannelData*>,
|
|
|
|
mtpRequestId> _channelAmInRequests;
|
|
|
|
|
|
|
|
struct NotifySettingsKey {
|
|
|
|
PeerId peerId = 0;
|
|
|
|
MsgId topicRootId = 0;
|
|
|
|
|
|
|
|
friend inline constexpr auto operator<=>(
|
|
|
|
NotifySettingsKey,
|
|
|
|
NotifySettingsKey) = default;
|
|
|
|
};
|
|
|
|
base::flat_map<NotifySettingsKey, mtpRequestId> _notifySettingRequests;
|
2015-06-28 12:37:10 +00:00
|
|
|
|
2022-10-17 16:29:48 +00:00
|
|
|
base::flat_map<
|
|
|
|
base::weak_ptr<Data::Thread>,
|
|
|
|
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;
|
2022-07-08 17:04:31 +00:00
|
|
|
base::flat_set<mtpRequestId> _customEmojiSetDisenableRequests;
|
2021-03-29 20:26:14 +00:00
|
|
|
mtpRequestId _masksReorderRequestId = 0;
|
2022-07-08 17:04:31 +00:00
|
|
|
mtpRequestId _customEmojiReorderRequestId = 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;
|
2022-07-08 17:04:31 +00:00
|
|
|
mtpRequestId _customEmojiUpdateRequest = 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;
|
2022-07-22 13:08:10 +00:00
|
|
|
mtpRequestId _featuredEmojiUpdateRequest = 0;
|
2017-08-02 15:07:28 +00:00
|
|
|
mtpRequestId _savedGifsUpdateRequest = 0;
|
|
|
|
|
2017-11-05 17:07:27 +00:00
|
|
|
base::Timer _featuredSetsReadTimer;
|
|
|
|
base::flat_set<uint64> _featuredSetsRead;
|
|
|
|
|
2023-01-24 14:46:16 +00:00
|
|
|
base::flat_map<QString, StickersByEmoji> _stickersByEmoji;
|
2018-03-07 13:53:12 +00:00
|
|
|
|
2018-01-03 17:06:43 +00:00
|
|
|
mtpRequestId _contactsRequestId = 0;
|
2017-03-17 17:19:46 +00:00
|
|
|
mtpRequestId _contactsStatusesRequestId = 0;
|
|
|
|
|
2022-10-11 15:08:19 +00:00
|
|
|
struct SharedMediaRequest {
|
|
|
|
not_null<PeerData*> peer;
|
|
|
|
MsgId topicRootId = 0;
|
|
|
|
SharedMediaType mediaType = {};
|
|
|
|
MsgId aroundId = 0;
|
|
|
|
SliceType sliceType = {};
|
|
|
|
|
2022-10-11 19:35:00 +00:00
|
|
|
friend inline auto operator<=>(
|
2022-10-11 15:08:19 +00:00
|
|
|
const SharedMediaRequest&,
|
|
|
|
const SharedMediaRequest&) = default;
|
|
|
|
};
|
|
|
|
base::flat_set<SharedMediaRequest> _sharedMediaRequests;
|
2017-08-14 12:48:11 +00:00
|
|
|
|
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
|
|
|
|
2022-10-12 20:23:14 +00:00
|
|
|
base::flat_set<not_null<const Data::ForumTopic*>> _updateNotifyTopics;
|
|
|
|
base::flat_set<not_null<const PeerData*>> _updateNotifyPeers;
|
|
|
|
base::flat_set<Data::DefaultNotify> _updateNotifyDefaults;
|
|
|
|
base::Timer _updateNotifyTimer;
|
|
|
|
rpl::lifetime _updateNotifyQueueLifetime;
|
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;
|
2023-03-28 14:14:53 +00:00
|
|
|
mtpRequestId _checkFilterInviteRequestId = 0;
|
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-11-28 04:51:34 +00:00
|
|
|
Fn<void(const QString&)> 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;
|
|
|
|
|
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;
|
2021-11-24 04:25:05 +00:00
|
|
|
const std::unique_ptr<Api::ChatParticipants> _chatParticipants;
|
2022-01-26 16:01:40 +00:00
|
|
|
const std::unique_ptr<Api::UnreadThings> _unreadThings;
|
2022-04-04 18:43:23 +00:00
|
|
|
const std::unique_ptr<Api::Ringtones> _ringtones;
|
2022-05-24 15:38:46 +00:00
|
|
|
const std::unique_ptr<Api::Transcribes> _transcribes;
|
2022-05-31 17:11:59 +00:00
|
|
|
const std::unique_ptr<Api::Premium> _premium;
|
2022-10-09 11:25:41 +00:00
|
|
|
const std::unique_ptr<Api::Usernames> _usernames;
|
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;
|
2022-08-10 12:24:42 +00:00
|
|
|
Fn<void()> _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;
|
|
|
|
|
2023-01-31 13:40:44 +00:00
|
|
|
base::flat_map<
|
|
|
|
not_null<UserData*>,
|
|
|
|
std::vector<not_null<PeerData*>>> _botCommonGroups;
|
|
|
|
base::flat_map<not_null<UserData*>, Fn<void()>> _botCommonGroupsRequests;
|
|
|
|
|
2019-04-05 11:50:16 +00:00
|
|
|
base::flat_map<FullMsgId, QString> _unlikelyMessageLinks;
|
|
|
|
|
2015-03-19 09:18:19 +00:00
|
|
|
};
|