/
erhoof
/
telegraf
Обзор
Документация
Войти
/
erhoof
/
telegraf
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/tdlib/tdlibrequestsender.h
164 строки
12 KB
Nikolay Sinyov
Добавил readAllMessageThreadReactions и readAllMessageThreadMentions для топиков в tdlib sender
11 сен 2025, 14:11
11 сен 2025, 14:11
92ef317
Код
Авторство
О чём код?
#pragma once #include <QObject> #include "tdlibstate.h" #include "tdlibrequestfactory.h" #include "tdlibrequestservice.h" #include "tdlibconstants.h" class TDLibRequestSender : public QObject { Q_OBJECT public: static QObject* getSingleton(QQmlEngine*, QJSEngine*) { return instance; } TDLibRequestSender(QObject *parent = nullptr); static TDLibRequestSender* getInstance() { return instance; }; public: Q_INVOKABLE void callAuthenticationPhoneNumber(const QString &phoneNumber) const; Q_INVOKABLE void callAuthenticationCode(const QString &authenticationCode) const; Q_INVOKABLE void callAuthenticationPassword(const QString &authenticationPassword) const; Q_INVOKABLE void callRegisterUser(const QString &firstName, const QString &lastName) const; Q_INVOKABLE void callLogout() const; Q_INVOKABLE void callGetChats(const int limit = 5) const; Q_INVOKABLE void callGetChatFolder(qlonglong folderID) const; Q_INVOKABLE void callGetChatListMain(const int limit = 5) const; Q_INVOKABLE void callGetChatListArchive(const int limit = 5) const; Q_INVOKABLE void callGetChatListInFolder (const qlonglong chatFolderId, const int limit = 5) const; Q_INVOKABLE void callDownloadFile(int fileId) const; Q_INVOKABLE void callOpenChat(const QString &chatId) const; Q_INVOKABLE void callCloseChat(const QString &chatId) const; Q_INVOKABLE void callJoinChat(const QString &chatId) const; Q_INVOKABLE void callLeaveChat(const QString &chatId) const; Q_INVOKABLE void callDeleteChat(qlonglong chatId) const; Q_INVOKABLE void callGetChatHistory(qlonglong chatId, qlonglong fromMessageId = 0, int offset = -1, int limit = 50, bool onlyLocal = false) const; Q_INVOKABLE void callGetMessageThreadHistory(qlonglong chatId, qlonglong messageThreadId, qlonglong fromMessageId = 0, int offset = -1, int limit = 50) const; Q_INVOKABLE void callCreateForumTopicRequest(qlonglong chatId, const QString &name, QVariantMap customEmoji = {}) const; Q_INVOKABLE void callEditForumTopicRequest(qlonglong chatId, qlonglong threadId, const QString &newName, bool isEditIconCustomEmoji = true, qlonglong iconCustomEmojiId = 0) const; Q_INVOKABLE void callDeleteForumTopicRequest(qlonglong chatId, qlonglong threadId) const; Q_INVOKABLE void callGetForumTopicRequest(qlonglong chatId, qlonglong messageThreadId) const; Q_INVOKABLE void callGetForumTopicsRequest(qlonglong chatId, QString query = 0, qint32 offsetDate = 0, qlonglong offsetMessageId = 0, qlonglong offsetThreadId = 0, qint32 limit = 20) const; Q_INVOKABLE void callGetForumTopicLinkRequest(qlonglong chatId, qlonglong messageThreadId) const; Q_INVOKABLE void callGetForumTopicDefaultIconsRequest() const; Q_INVOKABLE void callViewMessage(qlonglong chatId, qlonglong messageId, bool force) const; Q_INVOKABLE void callViewMessage(qlonglong chatId, qlonglong messageId, bool force, bool isForumTopic) const; Q_INVOKABLE void callPinMessage(const QString &chatId, const QString &messageId, bool disableNotification = false) const; Q_INVOKABLE void callUnpinMessage(const QString &chatId, const QString &messageId) const; Q_INVOKABLE void callSendTextMessage(qlonglong chatId, const QString &message, qlonglong replyToMessageId = 0, qlonglong messageThreadId = 0) const; Q_INVOKABLE void callSendPhotoMessage(qlonglong chatId, const QString &filePath, const QString &message, qlonglong replyToMessageId = 0, qlonglong messageThreadId = 0) const; Q_INVOKABLE void callSendVideoMessage(qlonglong chatId, const QString &filePath, const QString &message, qlonglong replyToMessageId = 0, qlonglong messageThreadId = 0) const; Q_INVOKABLE void callSendDocumentMessage(qlonglong chatId, const QString &filePath, const QString &message, qlonglong replyToMessageId = 0, qlonglong messageThreadId = 0) const; Q_INVOKABLE void callSendVoiceNoteMessage(qlonglong chatId, const QString &filePath, const QString &message, qlonglong replyToMessageId = 0, qlonglong messageThreadId = 0) const; Q_INVOKABLE void callSendLocationMessage(qlonglong chatId, double latitude, double longitude, double horizontalAccuracy, qlonglong replyToMessageId = 0, qlonglong messageThreadId = 0) const; Q_INVOKABLE void callSendStickerMessage(qlonglong chatId, const QString &fileId, qlonglong replyToMessageId = 0, qlonglong messageThreadId = 0) const; Q_INVOKABLE void callSendPollMessage(qlonglong chatId, const QString &question, const QVariantList &options, bool anonymous, int correctOption, bool multiple, const QString &explanation, qlonglong replyToMessageId = 0, qlonglong messageThreadId = 0) const; Q_INVOKABLE void callForwardMessages(const QString &chatId, const QString &fromChatId, const QVariantList &messageIds, bool sendCopy, bool removeCaption) const; Q_INVOKABLE void callGetMessage(qlonglong chatId, qlonglong messageId) const; Q_INVOKABLE void callGetMessageThread(qlonglong chatId, qlonglong messageId) const; Q_INVOKABLE void callGetMessageLinkInfo(const QString &url, const QString &extra = "") const; Q_INVOKABLE void callGetExternalLinkInfo(const QString &url, const QString &extra = "") const; Q_INVOKABLE void callGetCallbackQueryAnswer(const QString &chatId, const QString &messageId, const QVariantMap &payload) const; Q_INVOKABLE void callGetChatPinnedMessage(qlonglong chatId) const; Q_INVOKABLE void callSearchChatPinnedMessages(qlonglong chatId, qlonglong topicId = 0) const; Q_INVOKABLE void callGetChatSponsoredMessage(qlonglong chatId) const; Q_INVOKABLE void callSetOptionInteger(const QString &optionName, int optionValue) const; Q_INVOKABLE void callSetOptionBoolean(const QString &optionName, bool optionValue) const; Q_INVOKABLE void callSetChatNotificationSettings(const QString &chatId, const QVariantMap ¬ificationSettings) const; Q_INVOKABLE void callEditMessageText(const QString &chatId, const QString &messageId, const QString &message) const; Q_INVOKABLE void callEditMessageCaption(const QString &chatId, const QString &messageId, const QString &message) const; Q_INVOKABLE void callDeleteMessages(const QString &chatId, const QVariantList messageIds) const; Q_INVOKABLE void callGetMapThumbnailFile(const QString &chatId, double latitude, double longitude, int width, int height, const QString &extra) const; Q_INVOKABLE void callGetRecentStickers() const; Q_INVOKABLE void callGetInstalledStickerSets() const; Q_INVOKABLE void callGetStickerSet(const QString &setId) const; Q_INVOKABLE void callGetCustomEmojiStickers(const QVariantList &customEmojiIds) const; Q_INVOKABLE void callGetSupergroupMembers(const QString &groupId, int limit, int offset) const; Q_INVOKABLE void callGetGroupFullInfo(const QString &groupId, bool isSuperGroup) const; Q_INVOKABLE void callGetUser(const QString &userId) const; Q_INVOKABLE void callGetUserFullInfo(const QString &userId) const; Q_INVOKABLE void callCreatePrivateChat(const QString &userId, const QString &extra) const; Q_INVOKABLE void callCreateNewSecretChat(const QString &userId, const QString &extra) const; Q_INVOKABLE void callCreateSupergroupChat(const QString &supergroupId, const QString &extra) const; Q_INVOKABLE void callCreateBasicGroupChat(const QString &basicGroupId, const QString &extra) const; Q_INVOKABLE void callGetGroupsInCommon(const QString &userId, int limit, int offset) const; Q_INVOKABLE void callGetUserProfilePhotos(const QString &userId, int limit, int offset) const; Q_INVOKABLE void callSetChatPermissions(const QString &chatId, const QVariantMap &chatPermissions) const; Q_INVOKABLE void callSetChatSlowModeDelay(const QString &chatId, int delay) const; Q_INVOKABLE void callSetChatDescription(const QString &chatId, const QString &description) const; Q_INVOKABLE void callSetChatTitle(const QString &chatId, const QString &title) const; Q_INVOKABLE void callSetBio(const QString &bio) const; Q_INVOKABLE void callToggleSupergroupIsAllHistoryAvailable(const QString &groupId, bool isAllHistoryAvailable) const; Q_INVOKABLE void callSetPollAnswer(const QString &chatId, qlonglong messageId, QVariantList optionIds) const; Q_INVOKABLE void callStopPoll(const QString &chatId, qlonglong messageId) const; Q_INVOKABLE void callGetPollVoters(const QString &chatId, qlonglong messageId, int optionId, int limit, int offset, const QString &extra) const; Q_INVOKABLE void callSearchPublicChat(const QString &userName, bool doOpenOnFound) const; Q_INVOKABLE void callJoinChatByInviteLink(const QString &inviteLink) const; Q_INVOKABLE void callGetDeepLinkInfo(const QString &link) const; Q_INVOKABLE void callGetContacts() const; Q_INVOKABLE void callGetSecretChat(qlonglong secretChatId) const; Q_INVOKABLE void callCloseSecretChat(qlonglong secretChatId) const; Q_INVOKABLE void callImportContacts(const QVariantList &contacts) const; Q_INVOKABLE void callSearchChatMessages(qlonglong chatId, const QString &query, qlonglong fromMessageId = 0) const; Q_INVOKABLE void callSearchPublicChats(const QString &query) const; Q_INVOKABLE void callReadAllChatMentions(qlonglong chatId) const; Q_INVOKABLE void callReadAllChatReactions(qlonglong chatId) const; Q_INVOKABLE void callReadAllMessageThreadMentions(qlonglong chatId, qlonglong messageThreadId) const; Q_INVOKABLE void callReadAllMessageThreadReactions(qlonglong chatId, qlonglong messageThreadId) const; Q_INVOKABLE void callToggleChatIsMarkedAsUnread(qlonglong chatId, bool isMarkedAsUnread) const; Q_INVOKABLE void callToggleChatIsPinned(qlonglong chatId, bool isPinned, ChatFolderId::Type folderType, qlonglong folderId) const; Q_INVOKABLE void callSetChatDraftMessage(qlonglong chatId, qlonglong threadId, qlonglong replyToMessageId, const QString &draft) const; Q_INVOKABLE void callGetInlineQueryResults(qlonglong botUserId, qlonglong chatId, const QVariantMap &userLocation, const QString &query, const QString &offset, const QString &extra) const; Q_INVOKABLE void callSendInlineQueryResultMessage(qlonglong chatId, qlonglong threadId, qlonglong replyToMessageId, const QString &queryId, const QString &resultId) const; Q_INVOKABLE void callSendBotStartMessage(qlonglong botUserId, qlonglong chatId, const QString ¶meter, const QString &extra) const; Q_INVOKABLE void callCancelDownloadFile(int fileId) const; Q_INVOKABLE void callCancelUploadFile(int fileId) const; Q_INVOKABLE void callDeleteFile(int fileId) const; Q_INVOKABLE void callSetName(const QString &firstName, const QString &lastName) const; Q_INVOKABLE void callSetUsername(const QString &userName) const; Q_INVOKABLE void callSetUserPrivacySettingRule(TDLibConstants::UserPrivacySetting setting, TDLibConstants::UserPrivacySettingRule rule) const; Q_INVOKABLE void callGetUserPrivacySettingRules(TDLibConstants::UserPrivacySetting setting) const; Q_INVOKABLE void callSetProfilePhoto(const QString &filePath) const; Q_INVOKABLE void callDeleteProfilePhoto(const QString &profilePhotoId) const; Q_INVOKABLE void callChangeStickerSet(const QString &stickerSetId, bool isInstalled) const; Q_INVOKABLE void callGetActiveSessions() const; Q_INVOKABLE void callTerminateSession(const QString &sessionId) const; Q_INVOKABLE void callGetMessageAvailableReactions(qlonglong chatId, qlonglong messageId) const; Q_INVOKABLE void callGetMessageProperties(qlonglong chatId, qlonglong messageId) const; Q_INVOKABLE void callAddMessageReaction(qlonglong chatId, qlonglong messageId, const QString &reaction) const; Q_INVOKABLE void callRemoveMessageReaction(qlonglong chatId, qlonglong messageId, const QString &reaction) const; Q_INVOKABLE void callSetNetworkType(TDLibConstants::NetworkType networkType) const; Q_INVOKABLE void setInactiveSessionTtl(int days) const; Q_INVOKABLE void callGetStorageStatisticsFast() const; Q_INVOKABLE void callOptimizeStorage() const; Q_INVOKABLE void requestUserInfoIfNeeded(qlonglong userId) const; private: static TDLibRequestSender* instance; private: void callSetOption(const QString &name, const QString &type, const QVariant &value) const; };