From 0b6a2db2f1fc0671645516434a47dff398fb8b40 Mon Sep 17 00:00:00 2001 From: Slava Monich Date: Sat, 18 Nov 2023 15:45:22 +0200 Subject: [PATCH 01/12] Adapt to changes in TdLib (#524) * Adapt setTdlibParameters for TdLib > 1.8.5 For some reason tdlibParameters were inlined between 1.8.5 and 1.8.6 See https://github.com/tdlib/td/commit/f6a2ecd * sponsoredMessage => sponsoredMessages in TdLib 1.8.8 See https://github.com/tdlib/td/commit/ec1310a * Support another variant of messageReaction The reaction field has changed from string to ReactionType somewhere between 1.8.5 and 1.8.6 See https://github.com/tdlib/td/commit/b14708f * Add support for new message reactions API It has changed between 1.8.5 and 1.8.6 https://github.com/tdlib/td/commit/b14708f (ReactionType) https://github.com/tdlib/td/commit/0b8e143 (ChatAvailableReactions) https://github.com/tdlib/td/commit/6b2f6b4 (addMessageReaction) https://github.com/tdlib/td/commit/d29d367 (updateActiveEmojiReactions) etc. * Highlight chosen reaction * Support username in the new format username attribute has been replaced with usernames in 1.8.8 and now looks like this: "usernames": { "@type": "usernames", "active_usernames": [ "whatever" ], "disabled_usernames": [ ], "editable_username": "whatever" } See https://github.com/tdlib/td/commit/897032e * Support new reply_to message attribute Since 1.8.15 it replaces reply_to_message_id and reply_in_chat_id. Looks like this: "reply_to": { "@type": "messageReplyToMessage", "chat_id": -1001234567890, "is_quote_manual": false, "message_id": 234567890, "origin_send_date": 0 }, See https://github.com/tdlib/td/commit/6116573 * Added support for MessageOrigin values All of a sudden MessageForwardOrigin has been renamed into MessageOrigin in TdLib 1.8.20 just because why not: https://github.com/tdlib/td/commit/10c9e40 --- qml/components/MessageListViewItem.qml | 26 ++- qml/components/MessageOverlayFlickable.qml | 2 + .../ChatInformationTabItemMembersGroups.qml | 5 +- qml/pages/ChatPage.qml | 4 +- src/tdlibreceiver.cpp | 69 ++++++- src/tdlibreceiver.h | 3 + src/tdlibwrapper.cpp | 179 +++++++++++++----- src/tdlibwrapper.h | 8 +- 8 files changed, 235 insertions(+), 61 deletions(-) diff --git a/qml/components/MessageListViewItem.qml b/qml/components/MessageListViewItem.qml index 7ff49e9..d62808e 100644 --- a/qml/components/MessageListViewItem.qml +++ b/qml/components/MessageListViewItem.qml @@ -64,6 +64,7 @@ ListItem { readonly property bool showForwardMessageMenuItem: (baseContextMenuItemCount + 2) <= maxContextMenuItemCount // And don't count "More Options..." for "Delete Message" if "Delete Message" is the only extra option readonly property bool haveSpaceForDeleteMessageMenuItem: (baseContextMenuItemCount + 3 - (deleteMessageIsOnlyExtraOption ? 1 : 0)) <= maxContextMenuItemCount + property var chatReactions property var messageReactions highlighted: (down || isSelected || additionalOptionsOpened) && !menuOpen @@ -94,15 +95,21 @@ ListItem { } } - function getInteractionText(viewCount, reactions) { + function getInteractionText(viewCount, reactions, size, highlightColor) { var interactionText = ""; if (viewCount > 0) { - interactionText = Emoji.emojify("👁️", Theme.fontSizeTiny) + Functions.getShortenedCount(viewCount); + interactionText = Emoji.emojify("👁️ ", size) + Functions.getShortenedCount(viewCount); } for (var i = 0; i < reactions.length; i++) { - interactionText += ( " " + Emoji.emojify(reactions[i].reaction, Theme.fontSizeTiny) ); - if (!chatPage.isPrivateChat) { - interactionText += ( " " + Functions.getShortenedCount(reactions[i].total_count) ); + var reaction = reactions[i] + var reactionText = reaction.reaction ? reaction.reaction : (reaction.type && reaction.type.emoji) ? reaction.type.emoji : "" + if (reactionText) { + interactionText += ( " " + Emoji.emojify(reactionText, size) ); + if (!chatPage.isPrivateChat) { + var count = Functions.getShortenedCount(reaction.total_count) + interactionText += " " + interactionText += (reaction.is_chosen ? ( "" + count + "" ) : count) + } } } return interactionText; @@ -125,6 +132,8 @@ ListItem { if (messageListItem.messageReactions) { messageListItem.messageReactions = null; + } else if (messageListItem.chatReactions) { + messageListItem.messageReactions = chatReactions } else { tdLibWrapper.getMessageAvailableReactions(messageListItem.chatId, messageListItem.messageId); } @@ -467,11 +476,12 @@ ListItem { width: parent.width Component.onCompleted: { - if (myMessage.forward_info.origin["@type"] === "messageForwardOriginChannel") { + var originType = myMessage.forward_info.origin["@type"] + if (originType === "messageOriginChannel" || originType === "messageForwardOriginChannel") { var otherChatInformation = tdLibWrapper.getChat(myMessage.forward_info.origin.chat_id); forwardedThumbnail.photoData = (typeof otherChatInformation.photo !== "undefined") ? otherChatInformation.photo.small : {}; forwardedChannelText.text = Emoji.emojify(otherChatInformation.title, Theme.fontSizeExtraSmall); - } else if (myMessage.forward_info.origin["@type"] === "messageForwardOriginUser") { + } else if (originType === "messageOriginUser" || originType === "messageForwardOriginUser") { var otherUserInformation = tdLibWrapper.getUserInformation(myMessage.forward_info.origin.sender_user_id); forwardedThumbnail.photoData = (typeof otherUserInformation.profile_photo !== "undefined") ? otherUserInformation.profile_photo.small : {}; forwardedChannelText.text = Emoji.emojify(Functions.getUserName(otherUserInformation), Theme.fontSizeExtraSmall); @@ -625,7 +635,7 @@ ListItem { height: ( ( chatPage.isChannel && messageViewCount > 0 ) || reactions.length > 0 ) ? ( Theme.fontSizeExtraSmall + Theme.paddingSmall ) : 0 sourceComponent: Component { Label { - text: getInteractionText(messageViewCount, reactions) + text: getInteractionText(messageViewCount, reactions, font.pixelSize, Theme.highlightColor) width: parent.width font.pixelSize: Theme.fontSizeTiny color: messageListItem.isOwnMessage ? Theme.secondaryHighlightColor : Theme.secondaryColor diff --git a/qml/components/MessageOverlayFlickable.qml b/qml/components/MessageOverlayFlickable.qml index 274a284..b5d8915 100644 --- a/qml/components/MessageOverlayFlickable.qml +++ b/qml/components/MessageOverlayFlickable.qml @@ -40,9 +40,11 @@ Flickable { function getOriginalAuthor(forwardInformation, fontSize) { switch (forwardInformation.origin["@type"]) { + case "messageOriginChannel": case "messageForwardOriginChannel": var otherChatInformation = tdLibWrapper.getChat(forwardInformation.origin.chat_id); return Emoji.emojify(otherChatInformation.title, fontSize); + case "messageOriginUser": case "messageForwardOriginUser": var otherUserInformation = tdLibWrapper.getUserInformation(forwardInformation.origin.sender_id.user_id); return Emoji.emojify(Functions.getUserName(otherUserInformation), fontSize); diff --git a/qml/components/chatInformationPage/ChatInformationTabItemMembersGroups.qml b/qml/components/chatInformationPage/ChatInformationTabItemMembersGroups.qml index b4280b5..2b12c6f 100644 --- a/qml/components/chatInformationPage/ChatInformationTabItemMembersGroups.qml +++ b/qml/components/chatInformationPage/ChatInformationTabItemMembersGroups.qml @@ -79,7 +79,7 @@ ChatInformationTabItemBase { // chat title primaryText.text: Emoji.emojify(Functions.getUserName(user), primaryText.font.pixelSize) // last user - prologSecondaryText.text: "@"+(user.username !== "" ? user.username : member_id.user_id) + (member_id.user_id === chatInformationPage.myUserId ? " " + qsTr("You") : "") + prologSecondaryText.text: "@"+(user.username ? user.username : member_id.user_id) + (member_id.user_id === chatInformationPage.myUserId ? " " + qsTr("You") : "") secondaryText { horizontalAlignment: Text.AlignRight property string statusText: Functions.getChatMemberStatusText(model.status["@type"]) @@ -180,6 +180,9 @@ ChatInformationTabItemBase { for(var memberIndex in members) { var memberData = members[memberIndex]; var userInfo = tdLibWrapper.getUserInformation(memberData.member_id.user_id) || {user:{}, bot_info:{}}; + if (!userInfo.username && userInfo.usernames && userInfo.usernames.active_usernames) { + userInfo.username = userInfo.usernames.active_usernames[0] + } memberData.user = userInfo; memberData.bot_info = memberData.bot_info || {}; pageContent.membersList.append(memberData); diff --git a/qml/pages/ChatPage.qml b/qml/pages/ChatPage.qml index 7d60d2d..a4fa0da 100644 --- a/qml/pages/ChatPage.qml +++ b/qml/pages/ChatPage.qml @@ -66,6 +66,7 @@ Page { readonly property bool canSendMessages: hasSendPrivilege("can_send_messages") property bool doSendBotStartMessage property string sendBotStartMessageParameter + property var availableReactions states: [ State { @@ -184,7 +185,7 @@ Page { } tdLibWrapper.getChatPinnedMessage(chatInformation.id); tdLibWrapper.toggleChatIsMarkedAsUnread(chatInformation.id, false); - + availableReactions = tdLibWrapper.getChatReactions(chatInformation.id); } function getMessageStatusText(message, listItemIndex, lastReadSentIndex, useElapsed) { @@ -1348,6 +1349,7 @@ Page { messageId: model.message_id messageViewCount: model.view_count reactions: model.reactions + chatReactions: availableReactions messageIndex: model.index hasContentComponent: !!myMessage.content && chatView.delegateMessagesContent.indexOf(model.content_type) > -1 canReplyToMessage: chatPage.canSendMessages diff --git a/src/tdlibreceiver.cpp b/src/tdlibreceiver.cpp index 985e7b7..ba035e9 100644 --- a/src/tdlibreceiver.cpp +++ b/src/tdlibreceiver.cpp @@ -60,6 +60,10 @@ namespace { const QString CONTENT("content"); const QString NEW_CONTENT("new_content"); const QString SETS("sets"); + const QString EMOJIS("emojis"); + const QString REPLY_TO("reply_to"); + const QString REPLY_IN_CHAT_ID("reply_in_chat_id"); + const QString REPLY_TO_MESSAGE_ID("reply_to_message_id"); const QString _TYPE("@type"); const QString _EXTRA("@extra"); @@ -70,6 +74,7 @@ namespace { const QString TYPE_MESSAGE("message"); const QString TYPE_STICKER("sticker"); const QString TYPE_MESSAGE_STICKER("messageSticker"); + const QString TYPE_MESSAGE_REPLY_TO_MESSAGE("messageReplyToMessage"); const QString TYPE_MESSAGE_ANIMATED_EMOJI("messageAnimatedEmoji"); const QString TYPE_ANIMATED_EMOJI("animatedEmoji"); } @@ -119,7 +124,8 @@ TDLibReceiver::TDLibReceiver(void *tdLibClient, QObject *parent) : QThread(paren handlers.insert("updateSupergroup", &TDLibReceiver::processUpdateSuperGroup); handlers.insert("updateChatOnlineMemberCount", &TDLibReceiver::processChatOnlineMemberCountUpdated); handlers.insert("messages", &TDLibReceiver::processMessages); - handlers.insert("sponsoredMessage", &TDLibReceiver::processSponsoredMessage); + handlers.insert("sponsoredMessage", &TDLibReceiver::processSponsoredMessage); // TdLib <= 1.8.7 + handlers.insert("sponsoredMessages", &TDLibReceiver::processSponsoredMessages); // TdLib >= 1.8.8 handlers.insert("updateNewMessage", &TDLibReceiver::processUpdateNewMessage); handlers.insert("message", &TDLibReceiver::processMessage); handlers.insert("messageLinkInfo", &TDLibReceiver::processMessageLinkInfo); @@ -167,6 +173,7 @@ TDLibReceiver::TDLibReceiver(void *tdLibClient, QObject *parent) : QThread(paren handlers.insert("availableReactions", &TDLibReceiver::processAvailableReactions); handlers.insert("updateChatUnreadMentionCount", &TDLibReceiver::processUpdateChatUnreadMentionCount); handlers.insert("updateChatUnreadReactionCount", &TDLibReceiver::processUpdateChatUnreadReactionCount); + handlers.insert("updateActiveEmojiReactions", &TDLibReceiver::processUpdateActiveEmojiReactions); } void TDLibReceiver::setActive(bool active) @@ -382,11 +389,24 @@ void TDLibReceiver::processMessages(const QVariantMap &receivedInformation) void TDLibReceiver::processSponsoredMessage(const QVariantMap &receivedInformation) { + // TdLib <= 1.8.7 const qlonglong chatId = receivedInformation.value(_EXTRA).toLongLong(); // See TDLibWrapper::getChatSponsoredMessage LOG("Received sponsored message for chat" << chatId); emit sponsoredMessageReceived(chatId, receivedInformation); } +void TDLibReceiver::processSponsoredMessages(const QVariantMap &receivedInformation) +{ + // TdLib >= 1.8.8 + const qlonglong chatId = receivedInformation.value(_EXTRA).toLongLong(); // See TDLibWrapper::getChatSponsoredMessage + const QVariantList messages(receivedInformation.value(MESSAGES).toList()); + LOG("Received" << messages.count() << "sponsored messages for chat" << chatId); + QListIterator it(messages); + while (it.hasNext()) { + emit sponsoredMessageReceived(chatId, it.next().toMap()); + } +} + void TDLibReceiver::processUpdateNewMessage(const QVariantMap &receivedInformation) { const QVariantMap message = receivedInformation.value(MESSAGE).toMap(); @@ -400,7 +420,7 @@ void TDLibReceiver::processMessage(const QVariantMap &receivedInformation) const qlonglong chatId = receivedInformation.value(CHAT_ID).toLongLong(); const qlonglong messageId = receivedInformation.value(ID).toLongLong(); LOG("Received message " << chatId << messageId); - emit messageInformation(chatId, messageId, receivedInformation); + emit messageInformation(chatId, messageId, cleanupMap(receivedInformation)); } void TDLibReceiver::processMessageLinkInfo(const QVariantMap &receivedInformation) @@ -718,6 +738,13 @@ void TDLibReceiver::processUpdateChatUnreadReactionCount(const QVariantMap &rece emit chatUnreadReactionCountUpdated(chatId, unreadReactionCount); } +void TDLibReceiver::processUpdateActiveEmojiReactions(const QVariantMap &receivedInformation) +{ + // updateActiveEmojiReactions was introduced between 1.8.5 and 1.8.6 + // See https://github.com/tdlib/td/commit/d29d367 + emit activeEmojiReactionsUpdated(receivedInformation.value(EMOJIS).toStringList()); +} + // Recursively removes (some) unused entries from QVariantMaps to reduce // memory usage. QStrings allocated by QVariantMaps are the top consumers // of memory. The biggest saving is achieved by removing "outline" from @@ -747,12 +774,42 @@ const QVariantMap TDLibReceiver::cleanupMap(const QVariantMap& map, bool *update return animated_emoji; } } else if (type == TYPE_MESSAGE) { - bool cleaned = false; - const QVariantMap content(cleanupMap(map.value(CONTENT).toMap(), &cleaned)); - if (cleaned) { - QVariantMap message(map); + QVariantMap message(map); + bool messageChanged = false; + const QVariantMap content(cleanupMap(map.value(CONTENT).toMap(), &messageChanged)); + if (messageChanged) { message.remove(CONTENT); message.insert(CONTENT, content); + } + if (map.contains(REPLY_TO)) { + // In TdLib 1.8.15 reply_to_message_id and reply_in_chat_id attributes + // had been replaced with reply_to structure, e.g: + // + // "reply_to": { + // "@type": "messageReplyToMessage", + // "chat_id": -1001234567890, + // "is_quote_manual": false, + // "message_id": 234567890, + // "origin_send_date": 0 + // } + // + QVariantMap reply_to(message.value(REPLY_TO).toMap()); + if (reply_to.value(_TYPE).toString() == TYPE_MESSAGE_REPLY_TO_MESSAGE) { + if (reply_to.contains(MESSAGE_ID) && + !message.contains(REPLY_TO_MESSAGE_ID)) { + message.insert(REPLY_TO_MESSAGE_ID, reply_to.value(MESSAGE_ID)); + } + if (reply_to.contains(CHAT_ID) && + !message.contains(REPLY_IN_CHAT_ID)) { + message.insert(REPLY_IN_CHAT_ID, reply_to.value(CHAT_ID)); + } + reply_to.remove(_TYPE); + reply_to.insert(_TYPE, TYPE_MESSAGE_REPLY_TO_MESSAGE); + message.insert(REPLY_TO, reply_to); + messageChanged = true; + } + } + if (messageChanged) { message.remove(_TYPE); message.insert(_TYPE, TYPE_MESSAGE); // Replace with a shared value if (updated) *updated = true; diff --git a/src/tdlibreceiver.h b/src/tdlibreceiver.h index b033d9d..a13ae04 100644 --- a/src/tdlibreceiver.h +++ b/src/tdlibreceiver.h @@ -105,6 +105,7 @@ signals: void availableReactionsReceived(qlonglong messageId, const QStringList &reactions); void chatUnreadMentionCountUpdated(qlonglong chatId, int unreadMentionCount); void chatUnreadReactionCountUpdated(qlonglong chatId, int unreadReactionCount); + void activeEmojiReactionsUpdated(const QStringList& emojis); private: typedef void (TDLibReceiver::*Handler)(const QVariantMap &); @@ -139,6 +140,7 @@ private: void processChatOnlineMemberCountUpdated(const QVariantMap &receivedInformation); void processMessages(const QVariantMap &receivedInformation); void processSponsoredMessage(const QVariantMap &receivedInformation); + void processSponsoredMessages(const QVariantMap &receivedInformation); void processUpdateNewMessage(const QVariantMap &receivedInformation); void processMessage(const QVariantMap &receivedInformation); void processMessageLinkInfo(const QVariantMap &receivedInformation); @@ -186,6 +188,7 @@ private: void processAvailableReactions(const QVariantMap &receivedInformation); void processUpdateChatUnreadMentionCount(const QVariantMap &receivedInformation); void processUpdateChatUnreadReactionCount(const QVariantMap &receivedInformation); + void processUpdateActiveEmojiReactions(const QVariantMap &receivedInformation); }; #endif // TDLIBRECEIVER_H diff --git a/src/tdlibwrapper.cpp b/src/tdlibwrapper.cpp index 53be644..6cedc4d 100644 --- a/src/tdlibwrapper.cpp +++ b/src/tdlibwrapper.cpp @@ -36,6 +36,9 @@ #define DEBUG_MODULE TDLibWrapper #include "debuglog.h" +#define VERSION_NUMBER(x,y,z) \ + ((((x) & 0x3ff) << 20) | (((y) & 0x3ff) << 10) | ((z) & 0x3ff)) + namespace { const QString STATUS("status"); const QString ID("id"); @@ -51,20 +54,28 @@ namespace { const QString _TYPE("@type"); const QString _EXTRA("@extra"); const QString CHAT_LIST_MAIN("chatListMain"); + const QString CHAT_AVAILABLE_REACTIONS("available_reactions"); + const QString CHAT_AVAILABLE_REACTIONS_ALL("chatAvailableReactionsAll"); + const QString CHAT_AVAILABLE_REACTIONS_SOME("chatAvailableReactionsSome"); + const QString REACTIONS("reactions"); + const QString REACTION_TYPE("reaction_type"); + const QString REACTION_TYPE_EMOJI("reactionTypeEmoji"); + const QString EMOJI("emoji"); } -TDLibWrapper::TDLibWrapper(AppSettings *appSettings, MceInterface *mceInterface, QObject *parent) +TDLibWrapper::TDLibWrapper(AppSettings *settings, MceInterface *mce, QObject *parent) : QObject(parent) + , tdLibClient(td_json_client_create()) , manager(new QNetworkAccessManager(this)) , networkConfigurationManager(new QNetworkConfigurationManager(this)) + , appSettings(settings) + , mceInterface(mce) + , authorizationState(AuthorizationState::Closed) + , versionNumber(0) , joinChatRequested(false) + , isLoggingOut(false) { LOG("Initializing TD Lib..."); - this->appSettings = appSettings; - this->mceInterface = mceInterface; - this->tdLibClient = td_json_client_create(); - this->authorizationState = AuthorizationState::Closed; - this->isLoggingOut = false; initializeTDLibReceiver(); @@ -174,6 +185,7 @@ void TDLibWrapper::initializeTDLibReceiver() { connect(this->tdLibReceiver, SIGNAL(availableReactionsReceived(qlonglong, QStringList)), this, SIGNAL(availableReactionsReceived(qlonglong, QStringList))); connect(this->tdLibReceiver, SIGNAL(chatUnreadMentionCountUpdated(qlonglong, int)), this, SIGNAL(chatUnreadMentionCountUpdated(qlonglong, int))); connect(this->tdLibReceiver, SIGNAL(chatUnreadReactionCountUpdated(qlonglong, int)), this, SIGNAL(chatUnreadReactionCountUpdated(qlonglong, int))); + connect(this->tdLibReceiver, SIGNAL(activeEmojiReactionsUpdated(QStringList)), this, SLOT(handleActiveEmojiReactionsUpdated(QStringList))); this->tdLibReceiver->start(); } @@ -192,7 +204,7 @@ void TDLibWrapper::sendRequest(const QVariantMap &requestObject) QString TDLibWrapper::getVersion() { - return this->version; + return this->versionString; } TDLibWrapper::AuthorizationState TDLibWrapper::getAuthorizationState() @@ -255,7 +267,7 @@ void TDLibWrapper::logout() { LOG("Logging out"); QVariantMap requestObject; - requestObject.insert("@type", "logOut"); + requestObject.insert(_TYPE, "logOut"); this->sendRequest(requestObject); this->isLoggingOut = true; @@ -436,7 +448,7 @@ void TDLibWrapper::sendTextMessage(const QString &chatId, const QString &message QVariantMap entityType; entityType.insert(_TYPE, "textEntityTypeMentionName"); entityType.insert("user_id", nextReplacement.value("userId").toString()); - entity.insert("type", entityType); + entity.insert(TYPE, entityType); entities.append(entity); offsetCorrection += replacementLength - replacementPlainText.length(); } @@ -586,7 +598,7 @@ void TDLibWrapper::sendStickerMessage(const QString &chatId, const QString &file QVariantMap stickerInputFile; stickerInputFile.insert(_TYPE, "inputFileRemote"); - stickerInputFile.insert("id", fileId); + stickerInputFile.insert(ID, fileId); inputMessageContent.insert("sticker", stickerInputFile); @@ -620,7 +632,7 @@ void TDLibWrapper::sendPollMessage(const QString &chatId, const QString &questio pollType.insert("allow_multiple_answers", multiple); } - inputMessageContent.insert("type", pollType); + inputMessageContent.insert(TYPE, pollType); inputMessageContent.insert("question", question); inputMessageContent.insert("options", options); inputMessageContent.insert("is_anonymous", anonymous); @@ -709,7 +721,11 @@ void TDLibWrapper::getChatSponsoredMessage(qlonglong chatId) { LOG("Retrieving sponsored message" << chatId); QVariantMap requestObject; - requestObject.insert(_TYPE, "getChatSponsoredMessage"); + // getChatSponsoredMessage has been replaced with getChatSponsoredMessages + // between 1.8.7 and 1.8.8 + // See https://github.com/tdlib/td/commit/ec1310a + requestObject.insert(_TYPE, QString((versionNumber > VERSION_NUMBER(1,8,7)) ? + "getChatSponsoredMessages" : "getChatSponsoredMessage")); requestObject.insert(CHAT_ID, chatId); requestObject.insert(_EXTRA, chatId); // see TDLibReceiver::processSponsoredMessage this->sendRequest(requestObject); @@ -1433,8 +1449,8 @@ void TDLibWrapper::getMessageAvailableReactions(qlonglong chatId, qlonglong mess QVariantMap requestObject; requestObject.insert(_TYPE, "getMessageAvailableReactions"); requestObject.insert(_EXTRA, QString::number(messageId)); - requestObject.insert("chat_id", chatId); - requestObject.insert("message_id", messageId); + requestObject.insert(CHAT_ID, chatId); + requestObject.insert(MESSAGE_ID, messageId); this->sendRequest(requestObject); } @@ -1457,11 +1473,23 @@ void TDLibWrapper::setMessageReaction(qlonglong chatId, qlonglong messageId, con { LOG("Set message reaction" << chatId << messageId << reaction); QVariantMap requestObject; - requestObject.insert(_TYPE, "setMessageReaction"); - requestObject.insert("chat_id", chatId); - requestObject.insert("message_id", messageId); - requestObject.insert("reaction", reaction); + requestObject.insert(CHAT_ID, chatId); + requestObject.insert(MESSAGE_ID, messageId); requestObject.insert("is_big", false); + if (versionNumber > VERSION_NUMBER(1,8,5)) { + // "reaction_type": { + // "@type": "reactionTypeEmoji", + // "emoji": "..." + // } + QVariantMap reactionType; + reactionType.insert(_TYPE, REACTION_TYPE_EMOJI); + reactionType.insert(EMOJI, reaction); + requestObject.insert(REACTION_TYPE, reactionType); + requestObject.insert(_TYPE, "addMessageReaction"); + } else { + requestObject.insert("reaction", reaction); + requestObject.insert(_TYPE, "setMessageReaction"); + } this->sendRequest(requestObject); } @@ -1494,7 +1522,7 @@ void TDLibWrapper::setNetworkType(NetworkType networkType) break; } - requestObject.insert("type", networkTypeObject); + requestObject.insert(TYPE, networkTypeObject); this->sendRequest(requestObject); } @@ -1575,6 +1603,43 @@ QVariantMap TDLibWrapper::getChat(const QString &chatId) return this->chats.value(chatId).toMap(); } +QStringList TDLibWrapper::getChatReactions(const QString &chatId) +{ + const QVariant available_reactions(chats.value(chatId).toMap().value(CHAT_AVAILABLE_REACTIONS)); + const QVariantMap map(available_reactions.toMap()); + const QString reactions_type(map.value(_TYPE).toString()); + if (reactions_type == CHAT_AVAILABLE_REACTIONS_ALL) { + return activeEmojiReactions; + } else if (reactions_type == CHAT_AVAILABLE_REACTIONS_SOME) { + const QVariantList reactions(map.value(REACTIONS).toList()); + const int n = reactions.count(); + QStringList emojis; + + // "available_reactions": { + // "@type": "chatAvailableReactionsSome", + // "reactions": [ + // { + // "@type": "reactionTypeEmoji", + // "emoji": "..." + // }, + emojis.reserve(n); + for (int i = 0; i < n; i++) { + const QVariantMap reaction(reactions.at(i).toMap()); + if (reaction.value(_TYPE).toString() == REACTION_TYPE_EMOJI) { + const QString emoji(reaction.value(EMOJI).toString()); + if (!emoji.isEmpty()) { + emojis.append(emoji); + } + } + } + return emojis; + } else if (reactions_type.isEmpty()) { + return available_reactions.toStringList(); + } else { + return QStringList(); + } +} + QVariantMap TDLibWrapper::getSecretChatFromCache(qlonglong secretChatId) { return this->secretChats.value(secretChatId); @@ -1645,7 +1710,16 @@ DBusAdaptor *TDLibWrapper::getDBusAdaptor() void TDLibWrapper::handleVersionDetected(const QString &version) { - this->version = version; + this->versionString = version; + const QStringList parts(version.split('.')); + uint major, minor, release; + bool ok; + if (parts.count() >= 3 && + (major = parts.at(0).toInt(&ok), ok) && + (minor = parts.at(1).toInt(&ok), ok) && + (release = parts.at(2).toInt(&ok), ok)) { + versionNumber = VERSION_NUMBER(major, minor, release); + } emit versionDetected(version); } @@ -1758,7 +1832,7 @@ void TDLibWrapper::handleConnectionStateChanged(const QString &connectionState) void TDLibWrapper::handleUserUpdated(const QVariantMap &userInformation) { - QString updatedUserId = userInformation.value("id").toString(); + QString updatedUserId = userInformation.value(ID).toString(); if (updatedUserId == this->options.value("my_id").toString()) { LOG("Own user information updated :)"); this->userInformation = userInformation; @@ -1774,11 +1848,11 @@ void TDLibWrapper::handleUserStatusUpdated(const QString &userId, const QVariant { if (userId == this->options.value("my_id").toString()) { LOG("Own user status information updated :)"); - this->userInformation.insert("status", userStatusInformation); + this->userInformation.insert(STATUS, userStatusInformation); } LOG("User status information updated:" << userId << userStatusInformation.value(_TYPE).toString()); QVariantMap updatedUserInformation = this->allUsers.value(userId).toMap(); - updatedUserInformation.insert("status", userStatusInformation); + updatedUserInformation.insert(STATUS, userStatusInformation); this->allUsers.insert(userId, updatedUserInformation); this->allUserNames.insert(userInformation.value(USERNAME).toString(), userInformation); emit userUpdated(userId, updatedUserInformation); @@ -1786,12 +1860,12 @@ void TDLibWrapper::handleUserStatusUpdated(const QString &userId, const QVariant void TDLibWrapper::handleFileUpdated(const QVariantMap &fileInformation) { - emit fileUpdated(fileInformation.value("id").toInt(), fileInformation); + emit fileUpdated(fileInformation.value(ID).toInt(), fileInformation); } void TDLibWrapper::handleNewChatDiscovered(const QVariantMap &chatInformation) { - QString chatId = chatInformation.value("id").toString(); + QString chatId = chatInformation.value(ID).toString(); this->chats.insert(chatId, chatInformation); emit newChatDiscovered(chatId, chatInformation); } @@ -1856,7 +1930,7 @@ void TDLibWrapper::handleStickerSets(const QVariantList &stickerSets) QListIterator stickerSetIterator(stickerSets); while (stickerSetIterator.hasNext()) { QVariantMap stickerSet = stickerSetIterator.next().toMap(); - this->getStickerSet(stickerSet.value("id").toString()); + this->getStickerSet(stickerSet.value(ID).toString()); } emit this->stickerSetsReceived(stickerSets); } @@ -1988,6 +2062,13 @@ void TDLibWrapper::handleSponsoredMessage(qlonglong chatId, const QVariantMap &m } } +void TDLibWrapper::handleActiveEmojiReactionsUpdated(const QStringList& emojis) +{ + if (activeEmojiReactions != emojis) { + activeEmojiReactions = emojis; + LOG(emojis.count() << "reaction(s) available"); + } +} void TDLibWrapper::handleNetworkConfigurationChanged(const QNetworkConfiguration &config) { @@ -2077,28 +2158,40 @@ void TDLibWrapper::handleGetPageSourceFinished() } } +QVariantMap& TDLibWrapper::fillTdlibParameters(QVariantMap& parameters) +{ + parameters.insert("api_id", TDLIB_API_ID); + parameters.insert("api_hash", TDLIB_API_HASH); + parameters.insert("database_directory", QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/tdlib"); + bool onlineOnlyMode = this->appSettings->onlineOnlyMode(); + parameters.insert("use_file_database", !onlineOnlyMode); + parameters.insert("use_chat_info_database", !onlineOnlyMode); + parameters.insert("use_message_database", !onlineOnlyMode); + parameters.insert("use_secret_chats", true); + parameters.insert("system_language_code", QLocale::system().name()); + QSettings hardwareSettings("/etc/hw-release", QSettings::NativeFormat); + parameters.insert("device_model", hardwareSettings.value("NAME", "Unknown Mobile Device").toString()); + parameters.insert("system_version", QSysInfo::prettyProductName()); + parameters.insert("application_version", "0.17"); + parameters.insert("enable_storage_optimizer", appSettings->storageOptimizer()); + // parameters.insert("use_test_dc", true); + return parameters; +} + void TDLibWrapper::setInitialParameters() { LOG("Sending initial parameters to TD Lib"); QVariantMap requestObject; requestObject.insert(_TYPE, "setTdlibParameters"); - QVariantMap initialParameters; - initialParameters.insert("api_id", TDLIB_API_ID); - initialParameters.insert("api_hash", TDLIB_API_HASH); - initialParameters.insert("database_directory", QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/tdlib"); - bool onlineOnlyMode = this->appSettings->onlineOnlyMode(); - initialParameters.insert("use_file_database", !onlineOnlyMode); - initialParameters.insert("use_chat_info_database", !onlineOnlyMode); - initialParameters.insert("use_message_database", !onlineOnlyMode); - initialParameters.insert("use_secret_chats", true); - initialParameters.insert("system_language_code", QLocale::system().name()); - QSettings hardwareSettings("/etc/hw-release", QSettings::NativeFormat); - initialParameters.insert("device_model", hardwareSettings.value("NAME", "Unknown Mobile Device").toString()); - initialParameters.insert("system_version", QSysInfo::prettyProductName()); - initialParameters.insert("application_version", "0.17"); - initialParameters.insert("enable_storage_optimizer", appSettings->storageOptimizer()); - // initialParameters.insert("use_test_dc", true); - requestObject.insert("parameters", initialParameters); + // tdlibParameters were inlined between 1.8.5 and 1.8.6 + // See https://github.com/tdlib/td/commit/f6a2ecd + if (versionNumber > VERSION_NUMBER(1,8,5)) { + fillTdlibParameters(requestObject); + } else { + QVariantMap initialParameters; + fillTdlibParameters(initialParameters); + requestObject.insert("parameters", initialParameters); + } this->sendRequest(requestObject); } diff --git a/src/tdlibwrapper.h b/src/tdlibwrapper.h index 1d1ec6d..4caff11 100644 --- a/src/tdlibwrapper.h +++ b/src/tdlibwrapper.h @@ -148,6 +148,7 @@ public: Q_INVOKABLE QVariantMap getSuperGroup(qlonglong groupId) const; Q_INVOKABLE QVariantMap getChat(const QString &chatId); Q_INVOKABLE QVariantMap getSecretChatFromCache(qlonglong secretChatId); + Q_INVOKABLE QStringList getChatReactions(const QString &chatId); Q_INVOKABLE QString getOptionString(const QString &optionName); Q_INVOKABLE void copyFileToDownloads(const QString &filePath, bool openAfterCopy = false); Q_INVOKABLE void openFileOnDevice(const QString &filePath); @@ -364,7 +365,7 @@ public slots: void handleUpdatedUserPrivacySettingRules(const QVariantMap &updatedRules); void handleSponsoredMessage(qlonglong chatId, const QVariantMap &message); void handleNetworkConfigurationChanged(const QNetworkConfiguration &config); - + void handleActiveEmojiReactionsUpdated(const QStringList& emojis); void handleGetPageSourceFinished(); private: @@ -372,6 +373,7 @@ private: void setInitialParameters(); void setEncryptionKey(); void setLogVerbosityLevel(); + QVariantMap &fillTdlibParameters(QVariantMap ¶meters); const Group *updateGroup(qlonglong groupId, const QVariantMap &groupInfo, QHash *groups); void initializeTDLibReceiver(); @@ -383,7 +385,7 @@ private: MceInterface *mceInterface; TDLibReceiver *tdLibReceiver; DBusInterface *dbusInterface; - QString version; + QString versionString; TDLibWrapper::AuthorizationState authorizationState; QVariantMap authorizationStateData; TDLibWrapper::ConnectionState connectionState; @@ -399,7 +401,9 @@ private: QHash basicGroups; QHash superGroups; EmojiSearchWorker emojiSearchWorker; + QStringList activeEmojiReactions; + int versionNumber; QString activeChatSearchName; bool joinChatRequested; bool isLoggingOut; From 9bcc9ab6904664a170ed9e0f004ce5a8fb2d12cf Mon Sep 17 00:00:00 2001 From: Sebastian Wolf Date: Sat, 18 Nov 2023 15:35:02 +0100 Subject: [PATCH 02/12] Only expect chat partner information in private chats --- qml/pages/ChatPage.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qml/pages/ChatPage.qml b/qml/pages/ChatPage.qml index a4fa0da..13cd035 100644 --- a/qml/pages/ChatPage.qml +++ b/qml/pages/ChatPage.qml @@ -563,12 +563,12 @@ Page { } } onUserFullInfoReceived: { - if(userFullInfo["@extra"] === chatPartnerInformation.id.toString()) { + if ((isPrivateChat || isSecretChat) && userFullInfo["@extra"] === chatPartnerInformation.id.toString()) { chatPage.botInformation = userFullInfo; } } onUserFullInfoUpdated: { - if(userId === chatPartnerInformation.id) { + if ((isPrivateChat || isSecretChat) && userId === chatPartnerInformation.id) { chatPage.botInformation = userFullInfo; } } From c1c87290239160e39d2793531e45ce80eff8d3dc Mon Sep 17 00:00:00 2001 From: Slava Monich Date: Sat, 18 Nov 2023 23:14:59 +0200 Subject: [PATCH 03/12] Adapt to changes in reply message info (#525) 1.8.14: https://github.com/tdlib/td/commit/fa94aba 1.8.21: https://github.com/tdlib/td/commit/811a7c6 https://github.com/tdlib/td/commit/5216ea1 --- qml/pages/ChatPage.qml | 3 +- src/tdlibreceiver.cpp | 25 ++++++++- src/tdlibwrapper.cpp | 116 ++++++++++++++++++++--------------------- src/tdlibwrapper.h | 17 +++--- 4 files changed, 92 insertions(+), 69 deletions(-) diff --git a/qml/pages/ChatPage.qml b/qml/pages/ChatPage.qml index 13cd035..2b989a4 100644 --- a/qml/pages/ChatPage.qml +++ b/qml/pages/ChatPage.qml @@ -440,7 +440,8 @@ Page { Component.onDestruction: { if (chatPage.canSendMessages && !chatPage.isDeletedUser) { - tdLibWrapper.setChatDraftMessage(chatInformation.id, 0, newMessageColumn.replyToMessageId, newMessageTextField.text); + tdLibWrapper.setChatDraftMessage(chatInformation.id, 0, newMessageColumn.replyToMessageId, newMessageTextField.text, + newMessageInReplyToRow.inReplyToMessage ? newMessageInReplyToRow.inReplyToMessage.id : 0); } fernschreiberUtils.stopGeoLocationUpdates(); tdLibWrapper.closeChat(chatInformation.id); diff --git a/src/tdlibreceiver.cpp b/src/tdlibreceiver.cpp index ba035e9..11a46dc 100644 --- a/src/tdlibreceiver.cpp +++ b/src/tdlibreceiver.cpp @@ -64,6 +64,7 @@ namespace { const QString REPLY_TO("reply_to"); const QString REPLY_IN_CHAT_ID("reply_in_chat_id"); const QString REPLY_TO_MESSAGE_ID("reply_to_message_id"); + const QString DRAFT_MESSAGE("draft_message"); const QString _TYPE("@type"); const QString _EXTRA("@extra"); @@ -77,6 +78,8 @@ namespace { const QString TYPE_MESSAGE_REPLY_TO_MESSAGE("messageReplyToMessage"); const QString TYPE_MESSAGE_ANIMATED_EMOJI("messageAnimatedEmoji"); const QString TYPE_ANIMATED_EMOJI("animatedEmoji"); + const QString TYPE_INPUT_MESSAGE_REPLY_TO_MESSAGE("inputMessageReplyToMessage"); + const QString TYPE_DRAFT_MESSAGE("draftMessage"); } static QString getChatPositionOrder(const QVariantMap &position) @@ -445,7 +448,7 @@ void TDLibReceiver::processMessageSendSucceeded(const QVariantMap &receivedInfor const QVariantMap message = receivedInformation.value(MESSAGE).toMap(); const qlonglong messageId = message.value(ID).toLongLong(); LOG("Message send succeeded" << messageId << oldMessageId); - emit messageSendSucceeded(messageId, oldMessageId, message); + emit messageSendSucceeded(messageId, oldMessageId, cleanupMap(message)); } void TDLibReceiver::processUpdateActiveNotifications(const QVariantMap &receivedInformation) @@ -672,7 +675,7 @@ void TDLibReceiver::processUpdateChatIsMarkedAsUnread(const QVariantMap &receive void TDLibReceiver::processUpdateChatDraftMessage(const QVariantMap &receivedInformation) { LOG("Draft message was updated"); - emit chatDraftMessageUpdated(receivedInformation.value(CHAT_ID).toLongLong(), receivedInformation.value("draft_message").toMap(), findChatPositionOrder(receivedInformation.value(POSITIONS).toList())); + emit chatDraftMessageUpdated(receivedInformation.value(CHAT_ID).toLongLong(), cleanupMap(receivedInformation.value(DRAFT_MESSAGE).toMap()), findChatPositionOrder(receivedInformation.value(POSITIONS).toList())); } void TDLibReceiver::processInlineQueryResults(const QVariantMap &receivedInformation) @@ -815,6 +818,24 @@ const QVariantMap TDLibReceiver::cleanupMap(const QVariantMap& map, bool *update if (updated) *updated = true; return message; } + } else if (type == TYPE_DRAFT_MESSAGE) { + QVariantMap draftMessage(map); + QVariantMap reply_to(draftMessage.value(REPLY_TO).toMap()); + // In TdLib 1.8.21 reply_to_message_id has been replaced with reply_to + if (reply_to.value(_TYPE).toString() == TYPE_INPUT_MESSAGE_REPLY_TO_MESSAGE) { + if (reply_to.contains(MESSAGE_ID) && + !draftMessage.contains(REPLY_TO_MESSAGE_ID)) { + // reply_to_message_id is what QML (still) expects + draftMessage.insert(REPLY_TO_MESSAGE_ID, reply_to.value(MESSAGE_ID)); + } + reply_to.remove(_TYPE); + reply_to.insert(_TYPE, TYPE_INPUT_MESSAGE_REPLY_TO_MESSAGE); // Shared value + draftMessage.insert(REPLY_TO, reply_to); + draftMessage.remove(_TYPE); + draftMessage.insert(_TYPE, DRAFT_MESSAGE); // Shared value + if (updated) *updated = true; + return draftMessage; + } } else if (type == TYPE_MESSAGE_STICKER) { bool cleaned = false; const QVariantMap content(cleanupMap(map.value(CONTENT).toMap(), &cleaned)); diff --git a/src/tdlibwrapper.cpp b/src/tdlibwrapper.cpp index 6cedc4d..509e7cc 100644 --- a/src/tdlibwrapper.cpp +++ b/src/tdlibwrapper.cpp @@ -51,6 +51,8 @@ namespace { const QString THREAD_ID("thread_id"); const QString VALUE("value"); const QString CHAT_LIST_TYPE("chat_list_type"); + const QString REPLY_TO_MESSAGE_ID("reply_to_message_id"); + const QString REPLY_TO("reply_to"); const QString _TYPE("@type"); const QString _EXTRA("@extra"); const QString CHAT_LIST_MAIN("chatListMain"); @@ -61,6 +63,8 @@ namespace { const QString REACTION_TYPE("reaction_type"); const QString REACTION_TYPE_EMOJI("reactionTypeEmoji"); const QString EMOJI("emoji"); + const QString TYPE_MESSAGE_REPLY_TO_MESSAGE("messageReplyToMessage"); + const QString TYPE_INPUT_MESSAGE_REPLY_TO_MESSAGE("inputMessageReplyToMessage"); } TDLibWrapper::TDLibWrapper(AppSettings *settings, MceInterface *mce, QObject *parent) @@ -401,15 +405,33 @@ static bool compareReplacements(const QVariant &replacement1, const QVariant &re } } -void TDLibWrapper::sendTextMessage(const QString &chatId, const QString &message, const QString &replyToMessageId) +QVariantMap TDLibWrapper::newSendMessageRequest(qlonglong chatId, qlonglong replyToMessageId) +{ + QVariantMap request; + request.insert(_TYPE, "sendMessage"); + request.insert(CHAT_ID, chatId); + if (replyToMessageId) { + if (versionNumber > VERSION_NUMBER(1,8,14)) { + QVariantMap replyTo; + if (versionNumber > VERSION_NUMBER(1,8,20)) { + replyTo.insert(_TYPE, TYPE_INPUT_MESSAGE_REPLY_TO_MESSAGE); + } else { + replyTo.insert(_TYPE, TYPE_MESSAGE_REPLY_TO_MESSAGE); + } + replyTo.insert(CHAT_ID, chatId); + replyTo.insert(MESSAGE_ID, replyToMessageId); + request.insert(REPLY_TO, replyTo); + } else { + request.insert(REPLY_TO_MESSAGE_ID, replyToMessageId); + } + } + return request; +} + +void TDLibWrapper::sendTextMessage(qlonglong chatId, const QString &message, qlonglong replyToMessageId) { LOG("Sending text message" << chatId << message << replyToMessageId); - QVariantMap requestObject; - requestObject.insert(_TYPE, "sendMessage"); - requestObject.insert(CHAT_ID, chatId); - if (replyToMessageId != "0") { - requestObject.insert("reply_to_message_id", replyToMessageId); - } + QVariantMap requestObject(newSendMessageRequest(chatId, replyToMessageId)); QVariantMap inputMessageContent; inputMessageContent.insert(_TYPE, "inputMessageText"); @@ -462,17 +484,13 @@ void TDLibWrapper::sendTextMessage(const QString &chatId, const QString &message this->sendRequest(requestObject); } -void TDLibWrapper::sendPhotoMessage(const QString &chatId, const QString &filePath, const QString &message, const QString &replyToMessageId) +void TDLibWrapper::sendPhotoMessage(qlonglong chatId, const QString &filePath, const QString &message, qlonglong replyToMessageId) { LOG("Sending photo message" << chatId << filePath << message << replyToMessageId); - QVariantMap requestObject; - requestObject.insert(_TYPE, "sendMessage"); - requestObject.insert(CHAT_ID, chatId); - if (replyToMessageId != "0") { - requestObject.insert("reply_to_message_id", replyToMessageId); - } + QVariantMap requestObject(newSendMessageRequest(chatId, replyToMessageId)); QVariantMap inputMessageContent; inputMessageContent.insert(_TYPE, "inputMessagePhoto"); + QVariantMap formattedText; formattedText.insert("text", message); formattedText.insert(_TYPE, "formattedText"); @@ -486,17 +504,13 @@ void TDLibWrapper::sendPhotoMessage(const QString &chatId, const QString &filePa this->sendRequest(requestObject); } -void TDLibWrapper::sendVideoMessage(const QString &chatId, const QString &filePath, const QString &message, const QString &replyToMessageId) +void TDLibWrapper::sendVideoMessage(qlonglong chatId, const QString &filePath, const QString &message, qlonglong replyToMessageId) { LOG("Sending video message" << chatId << filePath << message << replyToMessageId); - QVariantMap requestObject; - requestObject.insert(_TYPE, "sendMessage"); - requestObject.insert(CHAT_ID, chatId); - if (replyToMessageId != "0") { - requestObject.insert("reply_to_message_id", replyToMessageId); - } + QVariantMap requestObject(newSendMessageRequest(chatId, replyToMessageId)); QVariantMap inputMessageContent; inputMessageContent.insert(_TYPE, "inputMessageVideo"); + QVariantMap formattedText; formattedText.insert("text", message); formattedText.insert(_TYPE, "formattedText"); @@ -510,17 +524,13 @@ void TDLibWrapper::sendVideoMessage(const QString &chatId, const QString &filePa this->sendRequest(requestObject); } -void TDLibWrapper::sendDocumentMessage(const QString &chatId, const QString &filePath, const QString &message, const QString &replyToMessageId) +void TDLibWrapper::sendDocumentMessage(qlonglong chatId, const QString &filePath, const QString &message, qlonglong replyToMessageId) { LOG("Sending document message" << chatId << filePath << message << replyToMessageId); - QVariantMap requestObject; - requestObject.insert(_TYPE, "sendMessage"); - requestObject.insert(CHAT_ID, chatId); - if (replyToMessageId != "0") { - requestObject.insert("reply_to_message_id", replyToMessageId); - } + QVariantMap requestObject(newSendMessageRequest(chatId, replyToMessageId)); QVariantMap inputMessageContent; inputMessageContent.insert(_TYPE, "inputMessageDocument"); + QVariantMap formattedText; formattedText.insert("text", message); formattedText.insert(_TYPE, "formattedText"); @@ -534,17 +544,13 @@ void TDLibWrapper::sendDocumentMessage(const QString &chatId, const QString &fil this->sendRequest(requestObject); } -void TDLibWrapper::sendVoiceNoteMessage(const QString &chatId, const QString &filePath, const QString &message, const QString &replyToMessageId) +void TDLibWrapper::sendVoiceNoteMessage(qlonglong chatId, const QString &filePath, const QString &message, qlonglong replyToMessageId) { LOG("Sending voice note message" << chatId << filePath << message << replyToMessageId); - QVariantMap requestObject; - requestObject.insert(_TYPE, "sendMessage"); - requestObject.insert(CHAT_ID, chatId); - if (replyToMessageId != "0") { - requestObject.insert("reply_to_message_id", replyToMessageId); - } + QVariantMap requestObject(newSendMessageRequest(chatId, replyToMessageId)); QVariantMap inputMessageContent; inputMessageContent.insert(_TYPE, "inputMessageVoiceNote"); + QVariantMap formattedText; formattedText.insert("text", message); formattedText.insert(_TYPE, "formattedText"); @@ -558,24 +564,19 @@ void TDLibWrapper::sendVoiceNoteMessage(const QString &chatId, const QString &fi this->sendRequest(requestObject); } -void TDLibWrapper::sendLocationMessage(const QString &chatId, double latitude, double longitude, double horizontalAccuracy, const QString &replyToMessageId) +void TDLibWrapper::sendLocationMessage(qlonglong chatId, double latitude, double longitude, double horizontalAccuracy, qlonglong replyToMessageId) { LOG("Sending location message" << chatId << latitude << longitude << horizontalAccuracy << replyToMessageId); - QVariantMap requestObject; - requestObject.insert(_TYPE, "sendMessage"); - requestObject.insert(CHAT_ID, chatId); - if (replyToMessageId != "0") { - requestObject.insert("reply_to_message_id", replyToMessageId); - } + QVariantMap requestObject(newSendMessageRequest(chatId, replyToMessageId)); QVariantMap inputMessageContent; inputMessageContent.insert(_TYPE, "inputMessageLocation"); + QVariantMap location; location.insert("latitude", latitude); location.insert("longitude", longitude); location.insert("horizontal_accuracy", horizontalAccuracy); location.insert(_TYPE, "location"); inputMessageContent.insert("location", location); - inputMessageContent.insert("live_period", 0); inputMessageContent.insert("heading", 0); inputMessageContent.insert("proximity_alert_radius", 0); @@ -584,15 +585,10 @@ void TDLibWrapper::sendLocationMessage(const QString &chatId, double latitude, d this->sendRequest(requestObject); } -void TDLibWrapper::sendStickerMessage(const QString &chatId, const QString &fileId, const QString &replyToMessageId) +void TDLibWrapper::sendStickerMessage(qlonglong chatId, const QString &fileId, qlonglong replyToMessageId) { LOG("Sending sticker message" << chatId << fileId << replyToMessageId); - QVariantMap requestObject; - requestObject.insert(_TYPE, "sendMessage"); - requestObject.insert(CHAT_ID, chatId); - if (replyToMessageId != "0") { - requestObject.insert("reply_to_message_id", replyToMessageId); - } + QVariantMap requestObject(newSendMessageRequest(chatId, replyToMessageId)); QVariantMap inputMessageContent; inputMessageContent.insert(_TYPE, "inputMessageSticker"); @@ -606,15 +602,10 @@ void TDLibWrapper::sendStickerMessage(const QString &chatId, const QString &file this->sendRequest(requestObject); } -void TDLibWrapper::sendPollMessage(const QString &chatId, const QString &question, const QVariantList &options, bool anonymous, int correctOption, bool multiple, const QString &explanation, const QString &replyToMessageId) +void TDLibWrapper::sendPollMessage(qlonglong chatId, const QString &question, const QVariantList &options, bool anonymous, int correctOption, bool multiple, const QString &explanation, qlonglong replyToMessageId) { LOG("Sending poll message" << chatId << question << replyToMessageId); - QVariantMap requestObject; - requestObject.insert(_TYPE, "sendMessage"); - requestObject.insert(CHAT_ID, chatId); - if (replyToMessageId != "0") { - requestObject.insert("reply_to_message_id", replyToMessageId); - } + QVariantMap requestObject(newSendMessageRequest(chatId, replyToMessageId)); QVariantMap inputMessageContent; inputMessageContent.insert(_TYPE, "inputMessagePoll"); @@ -1187,9 +1178,18 @@ void TDLibWrapper::setChatDraftMessage(qlonglong chatId, qlonglong threadId, qlo inputMessageContent.insert(_TYPE, "inputMessageText"); inputMessageContent.insert("text", formattedText); draftMessage.insert(_TYPE, "draftMessage"); - draftMessage.insert("reply_to_message_id", replyToMessageId); draftMessage.insert("input_message_text", inputMessageContent); + if (versionNumber > VERSION_NUMBER(1,8,20)) { + QVariantMap replyTo; + replyTo.insert(_TYPE, TYPE_INPUT_MESSAGE_REPLY_TO_MESSAGE); + replyTo.insert(CHAT_ID, chatId); + replyTo.insert(MESSAGE_ID, replyToMessageId); + draftMessage.insert(REPLY_TO, replyTo); + } else { + draftMessage.insert(REPLY_TO_MESSAGE_ID, replyToMessageId); + } + requestObject.insert("draft_message", draftMessage); this->sendRequest(requestObject); } diff --git a/src/tdlibwrapper.h b/src/tdlibwrapper.h index 4caff11..33e29b4 100644 --- a/src/tdlibwrapper.h +++ b/src/tdlibwrapper.h @@ -176,14 +176,14 @@ public: Q_INVOKABLE void viewMessage(qlonglong chatId, qlonglong messageId, bool force); Q_INVOKABLE void pinMessage(const QString &chatId, const QString &messageId, bool disableNotification = false); Q_INVOKABLE void unpinMessage(const QString &chatId, const QString &messageId); - Q_INVOKABLE void sendTextMessage(const QString &chatId, const QString &message, const QString &replyToMessageId = "0"); - Q_INVOKABLE void sendPhotoMessage(const QString &chatId, const QString &filePath, const QString &message, const QString &replyToMessageId = "0"); - Q_INVOKABLE void sendVideoMessage(const QString &chatId, const QString &filePath, const QString &message, const QString &replyToMessageId = "0"); - Q_INVOKABLE void sendDocumentMessage(const QString &chatId, const QString &filePath, const QString &message, const QString &replyToMessageId = "0"); - Q_INVOKABLE void sendVoiceNoteMessage(const QString &chatId, const QString &filePath, const QString &message, const QString &replyToMessageId = "0"); - Q_INVOKABLE void sendLocationMessage(const QString &chatId, double latitude, double longitude, double horizontalAccuracy, const QString &replyToMessageId = "0"); - Q_INVOKABLE void sendStickerMessage(const QString &chatId, const QString &fileId, const QString &replyToMessageId = "0"); - Q_INVOKABLE void sendPollMessage(const QString &chatId, const QString &question, const QVariantList &options, bool anonymous, int correctOption, bool multiple, const QString &explanation, const QString &replyToMessageId = "0"); + Q_INVOKABLE void sendTextMessage(qlonglong chatId, const QString &message, qlonglong replyToMessageId = 0); + Q_INVOKABLE void sendPhotoMessage(qlonglong chatId, const QString &filePath, const QString &message, qlonglong replyToMessageId = 0); + Q_INVOKABLE void sendVideoMessage(qlonglong chatId, const QString &filePath, const QString &message, qlonglong replyToMessageId = 0); + Q_INVOKABLE void sendDocumentMessage(qlonglong chatId, const QString &filePath, const QString &message, qlonglong replyToMessageId = 0); + Q_INVOKABLE void sendVoiceNoteMessage(qlonglong chatId, const QString &filePath, const QString &message, qlonglong replyToMessageId = 0); + Q_INVOKABLE void sendLocationMessage(qlonglong chatId, double latitude, double longitude, double horizontalAccuracy, qlonglong replyToMessageId = 0); + Q_INVOKABLE void sendStickerMessage(qlonglong chatId, const QString &fileId, qlonglong replyToMessageId = 0); + Q_INVOKABLE void sendPollMessage(qlonglong chatId, const QString &question, const QVariantList &options, bool anonymous, int correctOption, bool multiple, const QString &explanation, qlonglong replyToMessageId = 0); Q_INVOKABLE void forwardMessages(const QString &chatId, const QString &fromChatId, const QVariantList &messageIds, bool sendCopy, bool removeCaption); Q_INVOKABLE void getMessage(qlonglong chatId, qlonglong messageId); Q_INVOKABLE void getMessageLinkInfo(const QString &url, const QString &extra = ""); @@ -375,6 +375,7 @@ private: void setLogVerbosityLevel(); QVariantMap &fillTdlibParameters(QVariantMap ¶meters); const Group *updateGroup(qlonglong groupId, const QVariantMap &groupInfo, QHash *groups); + QVariantMap newSendMessageRequest(qlonglong chatId, qlonglong replyToMessageId); void initializeTDLibReceiver(); private: From 46419b0960c48513d04589fccbb5e8aa8ed14b06 Mon Sep 17 00:00:00 2001 From: Peter G Date: Sat, 18 Nov 2023 21:40:12 +0000 Subject: [PATCH 04/12] Highlight unread Converstations (#513) * Highlight unread conversations See: #512 * make highlighting configurable * more verbose variable names * remove the rectangle gain, it is too annoying * respect the setting --------- Co-authored-by: nephros --- qml/components/PhotoTextsListItem.qml | 3 +++ qml/components/settingsPage/SettingsBehavior.qml | 12 ++++++++++++ src/appsettings.cpp | 15 +++++++++++++++ src/appsettings.h | 5 +++++ 4 files changed, 35 insertions(+) diff --git a/qml/components/PhotoTextsListItem.qml b/qml/components/PhotoTextsListItem.qml index 5234437..57a1416 100644 --- a/qml/components/PhotoTextsListItem.qml +++ b/qml/components/PhotoTextsListItem.qml @@ -151,6 +151,9 @@ ListItem { truncationMode: TruncationMode.Fade anchors.verticalCenter: parent.verticalCenter width: Math.min(contentColumn.width - (verifiedImage.visible ? (verifiedImage.width + primaryTextRow.spacing) : 0) - (mutedImage.visible ? (mutedImage.width + primaryTextRow.spacing) : 0), implicitWidth) + font.bold: appSettings.highlightUnreadConversations && ( !chatListViewItem.isMuted && (chatListViewItem.unreadCount > 0 || chatListViewItem.isMarkedAsUnread) ) + font.italic: appSettings.highlightUnreadConversations && (chatListViewItem.unreadReactionCount > 0) + color: (appSettings.highlightUnreadConversations && (chatListViewItem.unreadCount > 0)) ? Theme.highlightColor : Theme.primaryColor } Image { diff --git a/qml/components/settingsPage/SettingsBehavior.qml b/qml/components/settingsPage/SettingsBehavior.qml index f0b2ea2..8ec3aec 100644 --- a/qml/components/settingsPage/SettingsBehavior.qml +++ b/qml/components/settingsPage/SettingsBehavior.qml @@ -70,6 +70,18 @@ AccordionItem { } } + TextSwitch { + width: parent.columnWidth + checked: appSettings.highlightUnreadConversations + text: qsTr("Highlight unread messages") + description: qsTr("Highlight Conversations with unread messages") + automaticCheck: false + onClicked: { + appSettings.highlightUnreadConversations = !checked + } + } + + TextSwitch { width: parent.columnWidth checked: appSettings.useOpenWith diff --git a/src/appsettings.cpp b/src/appsettings.cpp index c5af969..d749f93 100644 --- a/src/appsettings.cpp +++ b/src/appsettings.cpp @@ -37,6 +37,7 @@ namespace { const QString KEY_DELAY_MESSAGE_READ("delayMessageRead"); const QString KEY_FOCUS_TEXTAREA_ON_CHAT_OPEN("focusTextAreaOnChatOpen"); const QString KEY_SPONSORED_MESS("sponsoredMess"); + const QString KEY_HIGHLIGHT_UNREADCONVS("highlightUnreadConversations"); } AppSettings::AppSettings(QObject *parent) : QObject(parent), settings(QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + "/de.ygriega/fernschreiber/settings.conf", QSettings::NativeFormat) @@ -240,6 +241,20 @@ void AppSettings::setDelayMessageRead(bool enable) } } +bool AppSettings::highlightUnreadConversations() const +{ + return settings.value(KEY_HIGHLIGHT_UNREADCONVS, true).toBool(); +} + +void AppSettings::setHighlightUnreadConversations(bool enable) +{ + if (highlightUnreadConversations() != enable) { + LOG(KEY_HIGHLIGHT_UNREADCONVS << enable); + settings.setValue(KEY_HIGHLIGHT_UNREADCONVS, enable); + emit highlightUnreadConversationsChanged(); + } +} + bool AppSettings::getFocusTextAreaOnChatOpen() const { return settings.value(KEY_FOCUS_TEXTAREA_ON_CHAT_OPEN, false).toBool(); diff --git a/src/appsettings.h b/src/appsettings.h index fbd5709..8071b44 100644 --- a/src/appsettings.h +++ b/src/appsettings.h @@ -40,6 +40,7 @@ class AppSettings : public QObject { Q_PROPERTY(bool delayMessageRead READ delayMessageRead WRITE setDelayMessageRead NOTIFY delayMessageReadChanged) Q_PROPERTY(bool focusTextAreaOnChatOpen READ getFocusTextAreaOnChatOpen WRITE setFocusTextAreaOnChatOpen NOTIFY focusTextAreaOnChatOpenChanged) Q_PROPERTY(SponsoredMess sponsoredMess READ getSponsoredMess WRITE setSponsoredMess NOTIFY sponsoredMessChanged) + Q_PROPERTY(bool highlightUnreadConversations READ highlightUnreadConversations WRITE setHighlightUnreadConversations NOTIFY highlightUnreadConversationsChanged) public: enum SponsoredMess { @@ -107,6 +108,9 @@ public: SponsoredMess getSponsoredMess() const; void setSponsoredMess(SponsoredMess sponsoredMess); + bool highlightUnreadConversations() const; + void setHighlightUnreadConversations(bool enable); + signals: void sendByEnterChanged(); void focusTextAreaAfterSendChanged(); @@ -124,6 +128,7 @@ signals: void delayMessageReadChanged(); void focusTextAreaOnChatOpenChanged(); void sponsoredMessChanged(); + void highlightUnreadConversationsChanged(); private: QSettings settings; From c7324c020bc8596d0f79dfff643fcda618b26a49 Mon Sep 17 00:00:00 2001 From: Peter G Date: Sat, 18 Nov 2023 21:58:05 +0000 Subject: [PATCH 05/12] Add option to suppress notification previews (#521) * Add Switch in Settings * Don't set notification preview body * Support the setting in appSettings * fixup! Add Switch in Settings * Just show message count * Also show only when notifications are enabled at all --------- Co-authored-by: nephros --- qml/components/settingsPage/SettingsBehavior.qml | 14 ++++++++++++++ src/appsettings.cpp | 15 +++++++++++++++ src/appsettings.h | 5 +++++ src/notificationmanager.cpp | 6 +++++- 4 files changed, 39 insertions(+), 1 deletion(-) diff --git a/qml/components/settingsPage/SettingsBehavior.qml b/qml/components/settingsPage/SettingsBehavior.qml index 8ec3aec..17746f7 100644 --- a/qml/components/settingsPage/SettingsBehavior.qml +++ b/qml/components/settingsPage/SettingsBehavior.qml @@ -147,6 +147,20 @@ AccordionItem { } } + TextSwitch { + width: parent.columnWidth + checked: appSettings.notificationSuppressContent && enabled + text: qsTr("Hide content in Notifications") + enabled: appSettings.notificationFeedback !== AppSettings.NotificationFeedbackNone + clip: height < implicitHeight + visible: height > 0 + automaticCheck: false + onClicked: { + appSettings.notificationSuppressContent = !checked + } + Behavior on height { SmoothedAnimation { duration: 200 } } + } + TextSwitch { width: parent.columnWidth checked: appSettings.notificationTurnsDisplayOn && enabled diff --git a/src/appsettings.cpp b/src/appsettings.cpp index d749f93..146d296 100644 --- a/src/appsettings.cpp +++ b/src/appsettings.cpp @@ -29,6 +29,7 @@ namespace { const QString KEY_ANIMATE_STICKERS("animateStickers"); const QString KEY_NOTIFICATION_TURNS_DISPLAY_ON("notificationTurnsDisplayOn"); const QString KEY_NOTIFICATION_SOUNDS_ENABLED("notificationSoundsEnabled"); + const QString KEY_NOTIFICATION_SUPPRESS_ENABLED("notificationSuppressContent"); const QString KEY_NOTIFICATION_FEEDBACK("notificationFeedback"); const QString KEY_STORAGE_OPTIMIZER("useStorageOptimizer"); const QString KEY_INLINEBOT_LOCATION_ACCESS("allowInlineBotLocationAccess"); @@ -156,6 +157,20 @@ void AppSettings::setNotificationSoundsEnabled(bool enable) } } +bool AppSettings::notificationSuppressContent() const +{ + return settings.value(KEY_NOTIFICATION_SUPPRESS_ENABLED, false).toBool(); +} + +void AppSettings::setNotificationSuppressContent(bool enable) +{ + if (notificationSuppressContent() != enable) { + LOG(KEY_NOTIFICATION_SUPPRESS_ENABLED << enable); + settings.setValue(KEY_NOTIFICATION_SUPPRESS_ENABLED, enable); + emit notificationSuppressContentChanged(); + } +} + AppSettings::NotificationFeedback AppSettings::notificationFeedback() const { return (NotificationFeedback) settings.value(KEY_NOTIFICATION_FEEDBACK, (int) NotificationFeedbackAll).toInt(); diff --git a/src/appsettings.h b/src/appsettings.h index 8071b44..7ddc7ca 100644 --- a/src/appsettings.h +++ b/src/appsettings.h @@ -32,6 +32,7 @@ class AppSettings : public QObject { Q_PROPERTY(bool animateStickers READ animateStickers WRITE setAnimateStickers NOTIFY animateStickersChanged) Q_PROPERTY(bool notificationTurnsDisplayOn READ notificationTurnsDisplayOn WRITE setNotificationTurnsDisplayOn NOTIFY notificationTurnsDisplayOnChanged) Q_PROPERTY(bool notificationSoundsEnabled READ notificationSoundsEnabled WRITE setNotificationSoundsEnabled NOTIFY notificationSoundsEnabledChanged) + Q_PROPERTY(bool notificationSuppressContent READ notificationSuppressContent WRITE setNotificationSuppressContent NOTIFY notificationSuppressContentChanged) Q_PROPERTY(NotificationFeedback notificationFeedback READ notificationFeedback WRITE setNotificationFeedback NOTIFY notificationFeedbackChanged) Q_PROPERTY(bool storageOptimizer READ storageOptimizer WRITE setStorageOptimizer NOTIFY storageOptimizerChanged) Q_PROPERTY(bool allowInlineBotLocationAccess READ allowInlineBotLocationAccess WRITE setAllowInlineBotLocationAccess NOTIFY allowInlineBotLocationAccessChanged) @@ -84,6 +85,9 @@ public: bool notificationSoundsEnabled() const; void setNotificationSoundsEnabled(bool enable); + bool notificationSuppressContent() const; + void setNotificationSuppressContent(bool enable); + NotificationFeedback notificationFeedback() const; void setNotificationFeedback(NotificationFeedback feedback); @@ -120,6 +124,7 @@ signals: void animateStickersChanged(); void notificationTurnsDisplayOnChanged(); void notificationSoundsEnabledChanged(); + void notificationSuppressContentChanged(); void notificationFeedbackChanged(); void storageOptimizerChanged(); void allowInlineBotLocationAccessChanged(); diff --git a/src/notificationmanager.cpp b/src/notificationmanager.cpp index f45f743..2bd4bd8 100644 --- a/src/notificationmanager.cpp +++ b/src/notificationmanager.cpp @@ -377,7 +377,11 @@ void NotificationManager::publishNotification(const NotificationGroup *notificat nemoNotification->setHintValue(HINT_VISIBILITY, QString()); nemoNotification->setUrgency(Notification::Low); } else { - nemoNotification->setPreviewBody(notificationBody); + if (!appSettings->notificationSuppressContent()) { + nemoNotification->setPreviewBody(notificationBody); + } else { + nemoNotification->setPreviewBody(tr("%Ln unread messages", "", notificationGroup->totalCount)); + } nemoNotification->setPreviewSummary(summary); nemoNotification->setHintValue(HINT_SUPPRESS_SOUND, !appSettings->notificationSoundsEnabled()); nemoNotification->setHintValue(HINT_DISPLAY_ON, appSettings->notificationTurnsDisplayOn()); From a9947ff9f77ab65eb011c1a15bcfd47a43f2808f Mon Sep 17 00:00:00 2001 From: Johannes Bachmann <45299708+dscheinah@users.noreply.github.com> Date: Sat, 18 Nov 2023 23:11:17 +0100 Subject: [PATCH 06/12] Always append last message content to notifications (#514) * always append last message content to notifications * make "always show notification" configurable * add unfinished translations * Fix spacing if no sender is printed --- .../settingsPage/SettingsBehavior.qml | 11 ++++++++++ src/appsettings.cpp | 15 ++++++++++++++ src/appsettings.h | 5 +++++ src/notificationmanager.cpp | 20 +++++++++++-------- translations/harbour-fernschreiber-de.ts | 8 ++++++++ translations/harbour-fernschreiber-en.ts | 8 ++++++++ translations/harbour-fernschreiber-es.ts | 8 ++++++++ translations/harbour-fernschreiber-fi.ts | 8 ++++++++ translations/harbour-fernschreiber-fr.ts | 8 ++++++++ translations/harbour-fernschreiber-hu.ts | 8 ++++++++ translations/harbour-fernschreiber-it.ts | 8 ++++++++ translations/harbour-fernschreiber-pl.ts | 8 ++++++++ translations/harbour-fernschreiber-ru.ts | 8 ++++++++ translations/harbour-fernschreiber-sk.ts | 8 ++++++++ translations/harbour-fernschreiber-sv.ts | 8 ++++++++ translations/harbour-fernschreiber-zh_CN.ts | 8 ++++++++ translations/harbour-fernschreiber.ts | 8 ++++++++ 17 files changed, 147 insertions(+), 8 deletions(-) diff --git a/qml/components/settingsPage/SettingsBehavior.qml b/qml/components/settingsPage/SettingsBehavior.qml index 17746f7..9c6b961 100644 --- a/qml/components/settingsPage/SettingsBehavior.qml +++ b/qml/components/settingsPage/SettingsBehavior.qml @@ -191,6 +191,17 @@ AccordionItem { } Behavior on height { SmoothedAnimation { duration: 200 } } } + + TextSwitch { + width: parent.columnWidth + checked: appSettings.notificationAlwaysShowPreview + text: qsTr("Always append message preview to notifications") + description: qsTr("In addition to showing the number of unread messages, the latest message will also be appended to notifications.") + automaticCheck: false + onClicked: { + appSettings.notificationAlwaysShowPreview = !checked + } + } } } } diff --git a/src/appsettings.cpp b/src/appsettings.cpp index 146d296..caf64d5 100644 --- a/src/appsettings.cpp +++ b/src/appsettings.cpp @@ -31,6 +31,7 @@ namespace { const QString KEY_NOTIFICATION_SOUNDS_ENABLED("notificationSoundsEnabled"); const QString KEY_NOTIFICATION_SUPPRESS_ENABLED("notificationSuppressContent"); const QString KEY_NOTIFICATION_FEEDBACK("notificationFeedback"); + const QString KEY_NOTIFICATION_ALWAYS_SHOW_PREVIEW("notificationAlwaysShowPreview"); const QString KEY_STORAGE_OPTIMIZER("useStorageOptimizer"); const QString KEY_INLINEBOT_LOCATION_ACCESS("allowInlineBotLocationAccess"); const QString KEY_REMAINING_INTERACTION_HINTS("remainingInteractionHints"); @@ -185,6 +186,20 @@ void AppSettings::setNotificationFeedback(NotificationFeedback feedback) } } +bool AppSettings::notificationAlwaysShowPreview() const +{ + return settings.value(KEY_NOTIFICATION_ALWAYS_SHOW_PREVIEW, false).toBool(); +} + +void AppSettings::setNotificationAlwaysShowPreview(bool enable) +{ + if (notificationAlwaysShowPreview() != enable) { + LOG(KEY_NOTIFICATION_ALWAYS_SHOW_PREVIEW << enable); + settings.setValue(KEY_NOTIFICATION_ALWAYS_SHOW_PREVIEW, enable); + emit notificationAlwaysShowPreviewChanged(); + } +} + bool AppSettings::storageOptimizer() const { return settings.value(KEY_STORAGE_OPTIMIZER, true).toBool(); diff --git a/src/appsettings.h b/src/appsettings.h index 7ddc7ca..e4a1a2d 100644 --- a/src/appsettings.h +++ b/src/appsettings.h @@ -34,6 +34,7 @@ class AppSettings : public QObject { Q_PROPERTY(bool notificationSoundsEnabled READ notificationSoundsEnabled WRITE setNotificationSoundsEnabled NOTIFY notificationSoundsEnabledChanged) Q_PROPERTY(bool notificationSuppressContent READ notificationSuppressContent WRITE setNotificationSuppressContent NOTIFY notificationSuppressContentChanged) Q_PROPERTY(NotificationFeedback notificationFeedback READ notificationFeedback WRITE setNotificationFeedback NOTIFY notificationFeedbackChanged) + Q_PROPERTY(bool notificationAlwaysShowPreview READ notificationAlwaysShowPreview WRITE setNotificationAlwaysShowPreview NOTIFY notificationAlwaysShowPreviewChanged) Q_PROPERTY(bool storageOptimizer READ storageOptimizer WRITE setStorageOptimizer NOTIFY storageOptimizerChanged) Q_PROPERTY(bool allowInlineBotLocationAccess READ allowInlineBotLocationAccess WRITE setAllowInlineBotLocationAccess NOTIFY allowInlineBotLocationAccessChanged) Q_PROPERTY(int remainingInteractionHints READ remainingInteractionHints WRITE setRemainingInteractionHints NOTIFY remainingInteractionHintsChanged) @@ -91,6 +92,9 @@ public: NotificationFeedback notificationFeedback() const; void setNotificationFeedback(NotificationFeedback feedback); + bool notificationAlwaysShowPreview() const; + void setNotificationAlwaysShowPreview(bool enable); + bool storageOptimizer() const; void setStorageOptimizer(bool enable); @@ -126,6 +130,7 @@ signals: void notificationSoundsEnabledChanged(); void notificationSuppressContentChanged(); void notificationFeedbackChanged(); + void notificationAlwaysShowPreviewChanged(); void storageOptimizerChanged(); void allowInlineBotLocationAccessChanged(); void remainingInteractionHintsChanged(); diff --git a/src/notificationmanager.cpp b/src/notificationmanager.cpp index 2bd4bd8..f4d6127 100644 --- a/src/notificationmanager.cpp +++ b/src/notificationmanager.cpp @@ -341,8 +341,18 @@ void NotificationManager::publishNotification(const NotificationGroup *notificat QString notificationBody; const QVariantMap senderInformation = messageMap.value(SENDER_ID).toMap(); - if (notificationGroup->totalCount == 1 && !messageMap.isEmpty()) { + bool outputMessageCount = notificationGroup->totalCount > 1; + bool messageIsEmpty = messageMap.isEmpty(); + if (outputMessageCount || messageIsEmpty) { + // Either we have more than one notification or we have no content to display + LOG("Group" << notificationGroup->notificationGroupId << "has" << notificationGroup->totalCount << "notifications"); + notificationBody = tr("%Ln unread messages", "", notificationGroup->totalCount); + } + if ((!outputMessageCount || appSettings->notificationAlwaysShowPreview()) && !messageIsEmpty) { LOG("Group" << notificationGroup->notificationGroupId << "has 1 notification"); + if (outputMessageCount) { + notificationBody += "; "; + } if (chatInformation && (chatInformation->type == TDLibWrapper::ChatTypeBasicGroup || (chatInformation->type == TDLibWrapper::ChatTypeSupergroup && !chatInformation->isChannel))) { // Add author @@ -352,15 +362,9 @@ void NotificationManager::publishNotification(const NotificationGroup *notificat } else { fullName = FernschreiberUtils::getUserName(tdLibWrapper->getUserInformation(senderInformation.value(USER_ID).toString())); } - - notificationBody = notificationBody + fullName.trimmed() + ": "; + notificationBody += fullName.trimmed() + ": "; } notificationBody += FernschreiberUtils::getMessageShortText(tdLibWrapper, messageMap.value(CONTENT).toMap(), (chatInformation ? chatInformation->isChannel : false), tdLibWrapper->getUserInformation().value(ID).toLongLong(), senderInformation ); - nemoNotification->setBody(notificationBody); - } else { - // Either we have more than one notification or we have no content to display - LOG("Group" << notificationGroup->notificationGroupId << "has" << notificationGroup->totalCount << "notifications"); - notificationBody = tr("%Ln unread messages", "", notificationGroup->totalCount); } const QString summary(chatInformation ? chatInformation->title : QString()); diff --git a/translations/harbour-fernschreiber-de.ts b/translations/harbour-fernschreiber-de.ts index 2009446..9624d96 100644 --- a/translations/harbour-fernschreiber-de.ts +++ b/translations/harbour-fernschreiber-de.ts @@ -1575,6 +1575,14 @@ When sounds are enabled, Fernschreiber will use the current Sailfish OS notification sound for chats, which can be configured in the system settings. Wenn Töne eingeschaltet sind, wird Fernschreiber den aktuellen Sailfish OS-Hinweiston für Chats verwenden, der in den Systemeinstellungen konfiguriert werden kann. + + Always append message preview to notifications + Immer bei Hinweisen die Nachricht ausgeben + + + In addition to showing the number of unread messages, the latest message will also be appended to notifications. + Zusätzlich zur Anzahl der ungelesenen Nachrichten wird immer die neuste Nachricht an Hinweise angefügt. + SettingsPage diff --git a/translations/harbour-fernschreiber-en.ts b/translations/harbour-fernschreiber-en.ts index 5d29139..e3c7b3c 100644 --- a/translations/harbour-fernschreiber-en.ts +++ b/translations/harbour-fernschreiber-en.ts @@ -1577,6 +1577,14 @@ messages When sounds are enabled, Fernschreiber will use the current Sailfish OS notification sound for chats, which can be configured in the system settings. When sounds are enabled, Fernschreiber will use the current Sailfish OS notification sound for chats, which can be configured in the system settings. + + Always append message preview to notifications + Always append message preview to notifications + + + In addition to showing the number of unread messages, the latest message will also be appended to notifications. + In addition to showing the number of unread messages, the latest message will also be appended to notifications. + SettingsPage diff --git a/translations/harbour-fernschreiber-es.ts b/translations/harbour-fernschreiber-es.ts index 4c35f53..6a637ba 100644 --- a/translations/harbour-fernschreiber-es.ts +++ b/translations/harbour-fernschreiber-es.ts @@ -1575,6 +1575,14 @@ When sounds are enabled, Fernschreiber will use the current Sailfish OS notification sound for chats, which can be configured in the system settings. Cuando los sonidos están habilitados, Fernschreiber utilizará el sonido de notificación actual de Sailfish OS para los grupos, que se puede configurar en la configuración del sistema. + + Always append message preview to notifications + + + + In addition to showing the number of unread messages, the latest message will also be appended to notifications. + + SettingsPage diff --git a/translations/harbour-fernschreiber-fi.ts b/translations/harbour-fernschreiber-fi.ts index ac089e9..c462838 100644 --- a/translations/harbour-fernschreiber-fi.ts +++ b/translations/harbour-fernschreiber-fi.ts @@ -1576,6 +1576,14 @@ When sounds are enabled, Fernschreiber will use the current Sailfish OS notification sound for chats, which can be configured in the system settings. Kun äänet ovat käytössä, Fernschreiber käyttää Sailfish OS:n ilmoitusääniä keskusteluille, jotia voit muuttaa järjestelmäasetuksista. + + Always append message preview to notifications + + + + In addition to showing the number of unread messages, the latest message will also be appended to notifications. + + SettingsPage diff --git a/translations/harbour-fernschreiber-fr.ts b/translations/harbour-fernschreiber-fr.ts index 6fc3cde..fb8b385 100644 --- a/translations/harbour-fernschreiber-fr.ts +++ b/translations/harbour-fernschreiber-fr.ts @@ -1575,6 +1575,14 @@ When sounds are enabled, Fernschreiber will use the current Sailfish OS notification sound for chats, which can be configured in the system settings. Lorsque le son est activé, Fernschreiber utilisera le réglage de Sailfish OS. Celui-ci est paramétrable depuis les paramètres du système. + + Always append message preview to notifications + + + + In addition to showing the number of unread messages, the latest message will also be appended to notifications. + + SettingsPage diff --git a/translations/harbour-fernschreiber-hu.ts b/translations/harbour-fernschreiber-hu.ts index 9926c27..0571486 100644 --- a/translations/harbour-fernschreiber-hu.ts +++ b/translations/harbour-fernschreiber-hu.ts @@ -1548,6 +1548,14 @@ When sounds are enabled, Fernschreiber will use the current Sailfish OS notification sound for chats, which can be configured in the system settings. + + Always append message preview to notifications + + + + In addition to showing the number of unread messages, the latest message will also be appended to notifications. + + SettingsPage diff --git a/translations/harbour-fernschreiber-it.ts b/translations/harbour-fernschreiber-it.ts index c3bec32..7e45e52 100644 --- a/translations/harbour-fernschreiber-it.ts +++ b/translations/harbour-fernschreiber-it.ts @@ -1575,6 +1575,14 @@ When sounds are enabled, Fernschreiber will use the current Sailfish OS notification sound for chats, which can be configured in the system settings. Quando i suoni di notifica sono attivi, Fernschreiber utilizza l'attuale suono di notifica per i messaggi scelto per Sailfish OS, il quale può essere modificato dalle impostazioni di sistema. + + Always append message preview to notifications + + + + In addition to showing the number of unread messages, the latest message will also be appended to notifications. + + SettingsPage diff --git a/translations/harbour-fernschreiber-pl.ts b/translations/harbour-fernschreiber-pl.ts index 498951b..ab12670 100644 --- a/translations/harbour-fernschreiber-pl.ts +++ b/translations/harbour-fernschreiber-pl.ts @@ -1602,6 +1602,14 @@ When sounds are enabled, Fernschreiber will use the current Sailfish OS notification sound for chats, which can be configured in the system settings. Gdy dźwięki są włączone, Fernschreiber użyje bieżącego dźwięku powiadomienia Sailfish OS do czatów, które można skonfigurować w ustawieniach systemu. + + Always append message preview to notifications + + + + In addition to showing the number of unread messages, the latest message will also be appended to notifications. + + SettingsPage diff --git a/translations/harbour-fernschreiber-ru.ts b/translations/harbour-fernschreiber-ru.ts index 9db0913..2b291a8 100644 --- a/translations/harbour-fernschreiber-ru.ts +++ b/translations/harbour-fernschreiber-ru.ts @@ -1605,6 +1605,14 @@ When sounds are enabled, Fernschreiber will use the current Sailfish OS notification sound for chats, which can be configured in the system settings. Если звуки разрешены, Fernschreiber использует звук, выбранный для чатов в настройках Sailfish OS. + + Always append message preview to notifications + + + + In addition to showing the number of unread messages, the latest message will also be appended to notifications. + + SettingsPage diff --git a/translations/harbour-fernschreiber-sk.ts b/translations/harbour-fernschreiber-sk.ts index 1f055cb..c450cb4 100644 --- a/translations/harbour-fernschreiber-sk.ts +++ b/translations/harbour-fernschreiber-sk.ts @@ -1602,6 +1602,14 @@ When sounds are enabled, Fernschreiber will use the current Sailfish OS notification sound for chats, which can be configured in the system settings. Keď sú povolené zvukové upozornenia, Fernschreiber použije aktuálne zvukové upozornenia Sailfish OS pre čety, ktoré môžu byť upravené v nastaveniach systému. + + Always append message preview to notifications + + + + In addition to showing the number of unread messages, the latest message will also be appended to notifications. + + SettingsPage diff --git a/translations/harbour-fernschreiber-sv.ts b/translations/harbour-fernschreiber-sv.ts index 8288034..c18e20b 100644 --- a/translations/harbour-fernschreiber-sv.ts +++ b/translations/harbour-fernschreiber-sv.ts @@ -1575,6 +1575,14 @@ When sounds are enabled, Fernschreiber will use the current Sailfish OS notification sound for chats, which can be configured in the system settings. När ljud är aktiverat, använder Fernschreiber aktuell Sailfish-signal för chatt-avisering, vilken kan ställas in i systemets ljudinställningar. + + Always append message preview to notifications + + + + In addition to showing the number of unread messages, the latest message will also be appended to notifications. + + SettingsPage diff --git a/translations/harbour-fernschreiber-zh_CN.ts b/translations/harbour-fernschreiber-zh_CN.ts index 6a83637..4fec0e9 100644 --- a/translations/harbour-fernschreiber-zh_CN.ts +++ b/translations/harbour-fernschreiber-zh_CN.ts @@ -1549,6 +1549,14 @@ When sounds are enabled, Fernschreiber will use the current Sailfish OS notification sound for chats, which can be configured in the system settings. 如果开启声音,Fernschreiber 会采用当前旗鱼系统通知声音作为对话通知声音,你可以在系统设置进行配置。 + + Always append message preview to notifications + + + + In addition to showing the number of unread messages, the latest message will also be appended to notifications. + + SettingsPage diff --git a/translations/harbour-fernschreiber.ts b/translations/harbour-fernschreiber.ts index 7a65c7a..dea8736 100644 --- a/translations/harbour-fernschreiber.ts +++ b/translations/harbour-fernschreiber.ts @@ -1575,6 +1575,14 @@ When sounds are enabled, Fernschreiber will use the current Sailfish OS notification sound for chats, which can be configured in the system settings. + + Always append message preview to notifications + + + + In addition to showing the number of unread messages, the latest message will also be appended to notifications. + + SettingsPage From 0aeaf50c92f55076c3dc83c0d6088a6e5a78a8ca Mon Sep 17 00:00:00 2001 From: Sebastian Wolf Date: Sat, 18 Nov 2023 23:39:09 +0100 Subject: [PATCH 07/12] Some minor adjustments --- qml/components/settingsPage/SettingsSession.qml | 12 ------------ translations/harbour-fernschreiber-de.ts | 16 ++++++++++++---- translations/harbour-fernschreiber-en.ts | 16 ++++++++++++---- translations/harbour-fernschreiber-es.ts | 16 ++++++++++++---- translations/harbour-fernschreiber-fi.ts | 16 ++++++++++++---- translations/harbour-fernschreiber-fr.ts | 16 ++++++++++++---- translations/harbour-fernschreiber-hu.ts | 16 ++++++++++++---- translations/harbour-fernschreiber-it.ts | 16 ++++++++++++---- translations/harbour-fernschreiber-pl.ts | 16 ++++++++++++---- translations/harbour-fernschreiber-ru.ts | 16 ++++++++++++---- translations/harbour-fernschreiber-sk.ts | 16 ++++++++++++---- translations/harbour-fernschreiber-sv.ts | 16 ++++++++++++---- translations/harbour-fernschreiber-zh_CN.ts | 16 ++++++++++++---- translations/harbour-fernschreiber.ts | 16 ++++++++++++---- 14 files changed, 156 insertions(+), 64 deletions(-) diff --git a/qml/components/settingsPage/SettingsSession.qml b/qml/components/settingsPage/SettingsSession.qml index 038c774..9f5a9b6 100644 --- a/qml/components/settingsPage/SettingsSession.qml +++ b/qml/components/settingsPage/SettingsSession.qml @@ -141,18 +141,6 @@ AccordionItem { } } - Label { - width: parent.width - text: qsTr("IP address: %1, origin: %2").arg(modelData.ip).arg(modelData.country) - font.pixelSize: Theme.fontSizeExtraSmall - color: Theme.secondaryColor - maximumLineCount: 1 - truncationMode: TruncationMode.Fade - anchors { - horizontalCenter: parent.horizontalCenter - } - } - Label { width: parent.width text: qsTr("Active since: %1, last online: %2").arg(Functions.getDateTimeTimepoint(modelData.log_in_date)).arg(Functions.getDateTimeElapsed(modelData.last_active_date)) diff --git a/translations/harbour-fernschreiber-de.ts b/translations/harbour-fernschreiber-de.ts index 9624d96..d81841f 100644 --- a/translations/harbour-fernschreiber-de.ts +++ b/translations/harbour-fernschreiber-de.ts @@ -1583,6 +1583,18 @@ In addition to showing the number of unread messages, the latest message will also be appended to notifications. Zusätzlich zur Anzahl der ungelesenen Nachrichten wird immer die neuste Nachricht an Hinweise angefügt. + + Highlight unread messages + Ungelesene Nachrichten hervorheben + + + Highlight Conversations with unread messages + Unterhaltungen mit ungelesenen Nachrichten hervorheben + + + Hide content in Notifications + Inhalte in Hinweisen verbergen + SettingsPage @@ -1680,10 +1692,6 @@ This app Diese App - - IP address: %1, origin: %2 - IP-Adresse: %1, Herkunft: %2 - Active since: %1, last online: %2 Aktiv seit: %1, zuletzt online: %2 diff --git a/translations/harbour-fernschreiber-en.ts b/translations/harbour-fernschreiber-en.ts index e3c7b3c..0c1d951 100644 --- a/translations/harbour-fernschreiber-en.ts +++ b/translations/harbour-fernschreiber-en.ts @@ -1585,6 +1585,18 @@ messages In addition to showing the number of unread messages, the latest message will also be appended to notifications. In addition to showing the number of unread messages, the latest message will also be appended to notifications. + + Highlight unread messages + + + + Highlight Conversations with unread messages + + + + Hide content in Notifications + + SettingsPage @@ -1690,10 +1702,6 @@ messages This app This app - - IP address: %1, origin: %2 - IP address: %1, origin: %2 - Active since: %1, last online: %2 Active since: %1, last online: %2 diff --git a/translations/harbour-fernschreiber-es.ts b/translations/harbour-fernschreiber-es.ts index 6a637ba..928bbc2 100644 --- a/translations/harbour-fernschreiber-es.ts +++ b/translations/harbour-fernschreiber-es.ts @@ -1583,6 +1583,18 @@ In addition to showing the number of unread messages, the latest message will also be appended to notifications. + + Highlight unread messages + + + + Highlight Conversations with unread messages + + + + Hide content in Notifications + + SettingsPage @@ -1688,10 +1700,6 @@ This app Esta apl - - IP address: %1, origin: %2 - Dirección IP: %1, origen: %2 - Active since: %1, last online: %2 Activo desde: %1, último en línea: %2 diff --git a/translations/harbour-fernschreiber-fi.ts b/translations/harbour-fernschreiber-fi.ts index c462838..9bf71b5 100644 --- a/translations/harbour-fernschreiber-fi.ts +++ b/translations/harbour-fernschreiber-fi.ts @@ -1584,6 +1584,18 @@ In addition to showing the number of unread messages, the latest message will also be appended to notifications. + + Highlight unread messages + + + + Highlight Conversations with unread messages + + + + Hide content in Notifications + + SettingsPage @@ -1689,10 +1701,6 @@ This app Tämä sovellus - - IP address: %1, origin: %2 - IP-osoite: %1, sijainti: %2 - Active since: %1, last online: %2 Aktiivinen %1 alkaen, viimeksi paikalla: %2 diff --git a/translations/harbour-fernschreiber-fr.ts b/translations/harbour-fernschreiber-fr.ts index fb8b385..761798e 100644 --- a/translations/harbour-fernschreiber-fr.ts +++ b/translations/harbour-fernschreiber-fr.ts @@ -1583,6 +1583,18 @@ In addition to showing the number of unread messages, the latest message will also be appended to notifications. + + Highlight unread messages + + + + Highlight Conversations with unread messages + + + + Hide content in Notifications + + SettingsPage @@ -1688,10 +1700,6 @@ This app Cette app - - IP address: %1, origin: %2 - Adresse IP : %1, origine : %2 - Active since: %1, last online: %2 Actif depuis : %1, en ligne : %2 diff --git a/translations/harbour-fernschreiber-hu.ts b/translations/harbour-fernschreiber-hu.ts index 0571486..2c5babc 100644 --- a/translations/harbour-fernschreiber-hu.ts +++ b/translations/harbour-fernschreiber-hu.ts @@ -1556,6 +1556,18 @@ In addition to showing the number of unread messages, the latest message will also be appended to notifications. + + Highlight unread messages + + + + Highlight Conversations with unread messages + + + + Hide content in Notifications + + SettingsPage @@ -1661,10 +1673,6 @@ This app - - IP address: %1, origin: %2 - - Active since: %1, last online: %2 diff --git a/translations/harbour-fernschreiber-it.ts b/translations/harbour-fernschreiber-it.ts index 7e45e52..59d27d0 100644 --- a/translations/harbour-fernschreiber-it.ts +++ b/translations/harbour-fernschreiber-it.ts @@ -1583,6 +1583,18 @@ In addition to showing the number of unread messages, the latest message will also be appended to notifications. + + Highlight unread messages + + + + Highlight Conversations with unread messages + + + + Hide content in Notifications + + SettingsPage @@ -1688,10 +1700,6 @@ This app - - IP address: %1, origin: %2 - - Active since: %1, last online: %2 diff --git a/translations/harbour-fernschreiber-pl.ts b/translations/harbour-fernschreiber-pl.ts index ab12670..78c7d3e 100644 --- a/translations/harbour-fernschreiber-pl.ts +++ b/translations/harbour-fernschreiber-pl.ts @@ -1610,6 +1610,18 @@ In addition to showing the number of unread messages, the latest message will also be appended to notifications. + + Highlight unread messages + + + + Highlight Conversations with unread messages + + + + Hide content in Notifications + + SettingsPage @@ -1715,10 +1727,6 @@ This app Ta aplikacja - - IP address: %1, origin: %2 - Adres IP: %1, oryginalny: %2 - Active since: %1, last online: %2 Aktywny od: %1, ostatnio aktywny: %2 diff --git a/translations/harbour-fernschreiber-ru.ts b/translations/harbour-fernschreiber-ru.ts index 2b291a8..784b217 100644 --- a/translations/harbour-fernschreiber-ru.ts +++ b/translations/harbour-fernschreiber-ru.ts @@ -1613,6 +1613,18 @@ In addition to showing the number of unread messages, the latest message will also be appended to notifications. + + Highlight unread messages + + + + Highlight Conversations with unread messages + + + + Hide content in Notifications + + SettingsPage @@ -1718,10 +1730,6 @@ This app Это приложение - - IP address: %1, origin: %2 - IP-адрес: %1, регион: %2 - Active since: %1, last online: %2 Активен с: %1, был онлайн: %2 diff --git a/translations/harbour-fernschreiber-sk.ts b/translations/harbour-fernschreiber-sk.ts index c450cb4..d5f16fe 100644 --- a/translations/harbour-fernschreiber-sk.ts +++ b/translations/harbour-fernschreiber-sk.ts @@ -1610,6 +1610,18 @@ In addition to showing the number of unread messages, the latest message will also be appended to notifications. + + Highlight unread messages + + + + Highlight Conversations with unread messages + + + + Hide content in Notifications + + SettingsPage @@ -1715,10 +1727,6 @@ This app Táto aplikácia - - IP address: %1, origin: %2 - IP adresa: %1, pôvod: %2 - Active since: %1, last online: %2 Aktívna od: %1, naposledy pripojená: %2 diff --git a/translations/harbour-fernschreiber-sv.ts b/translations/harbour-fernschreiber-sv.ts index c18e20b..9c4ba8b 100644 --- a/translations/harbour-fernschreiber-sv.ts +++ b/translations/harbour-fernschreiber-sv.ts @@ -1583,6 +1583,18 @@ In addition to showing the number of unread messages, the latest message will also be appended to notifications. + + Highlight unread messages + + + + Highlight Conversations with unread messages + + + + Hide content in Notifications + + SettingsPage @@ -1688,10 +1700,6 @@ This app Denna app - - IP address: %1, origin: %2 - IP-adress: %1, ursprung: %2 - Active since: %1, last online: %2 Aktiv sedan: %1, senast online: %2 diff --git a/translations/harbour-fernschreiber-zh_CN.ts b/translations/harbour-fernschreiber-zh_CN.ts index 4fec0e9..997f5cd 100644 --- a/translations/harbour-fernschreiber-zh_CN.ts +++ b/translations/harbour-fernschreiber-zh_CN.ts @@ -1557,6 +1557,18 @@ In addition to showing the number of unread messages, the latest message will also be appended to notifications. + + Highlight unread messages + + + + Highlight Conversations with unread messages + + + + Hide content in Notifications + + SettingsPage @@ -1662,10 +1674,6 @@ This app 此应用 - - IP address: %1, origin: %2 - IP 地址: %1, 地点: %2 - Active since: %1, last online: %2 活跃时间: %1, 上次在线: %2 diff --git a/translations/harbour-fernschreiber.ts b/translations/harbour-fernschreiber.ts index dea8736..cbb7139 100644 --- a/translations/harbour-fernschreiber.ts +++ b/translations/harbour-fernschreiber.ts @@ -1583,6 +1583,18 @@ In addition to showing the number of unread messages, the latest message will also be appended to notifications. + + Highlight unread messages + + + + Highlight Conversations with unread messages + + + + Hide content in Notifications + + SettingsPage @@ -1688,10 +1700,6 @@ This app - - IP address: %1, origin: %2 - - Active since: %1, last online: %2 From 0ba3a8cd7f79315db8aaa6470ff5ac896a8b1b89 Mon Sep 17 00:00:00 2001 From: Sebastian Wolf Date: Sun, 19 Nov 2023 00:18:29 +0100 Subject: [PATCH 08/12] Trouble with usernames --- qml/components/settingsPage/SettingsUserProfile.qml | 2 +- src/contactsmodel.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qml/components/settingsPage/SettingsUserProfile.qml b/qml/components/settingsPage/SettingsUserProfile.qml index f4fad97..169c2a6 100644 --- a/qml/components/settingsPage/SettingsUserProfile.qml +++ b/qml/components/settingsPage/SettingsUserProfile.qml @@ -143,7 +143,7 @@ AccordionItem { visible: true canEdit: true headerText: qsTr("Username", "user name of the logged-in profile - header") - text: userInformation.username + text: userInformation.usernames.editable_username width: parent.columnWidth headerLeftAligned: true diff --git a/src/contactsmodel.cpp b/src/contactsmodel.cpp index fa24b24..2c59801 100644 --- a/src/contactsmodel.cpp +++ b/src/contactsmodel.cpp @@ -68,7 +68,7 @@ QVariant ContactsModel::data(const QModelIndex &index, int role) const case ContactRole::RoleDisplay: return requestedContact; case ContactRole::RoleTitle: return QString(requestedContact.value("first_name").toString() + " " + requestedContact.value("last_name").toString()).trimmed(); case ContactRole::RoleUserId: return requestedContact.value("id"); - case ContactRole::RoleUsername: return requestedContact.value("username"); + case ContactRole::RoleUsername: return requestedContact.value("usernames").toMap().value("editable_username").toString(); case ContactRole::RolePhotoSmall: return requestedContact.value("profile_photo").toMap().value("small"); case ContactRole::RoleUserStatus: return requestedContact.value("status").toMap().value("@type"); case ContactRole::RoleUserLastOnline: return requestedContact.value("status").toMap().value("was_online"); From 9a37db94aeb05db1859f0ad853fc2cbd55910afc Mon Sep 17 00:00:00 2001 From: Denis Fedoseev Date: Sun, 19 Nov 2023 16:11:29 +0300 Subject: [PATCH 09/12] Update tdlib headers --- tdlib/include/td/telegram/Client.h | 14 +- tdlib/include/td/telegram/Log.h | 2 +- tdlib/include/td/telegram/td_api.h | 15726 +++++++++++++++++-- tdlib/include/td/telegram/td_api.hpp | 3653 ++++- tdlib/include/td/telegram/td_json_client.h | 10 +- tdlib/include/td/telegram/td_log.h | 2 +- tdlib/include/td/tl/TlObject.h | 12 +- 7 files changed, 17429 insertions(+), 1990 deletions(-) diff --git a/tdlib/include/td/telegram/Client.h b/tdlib/include/td/telegram/Client.h index 211d17f..2f2165e 100644 --- a/tdlib/include/td/telegram/Client.h +++ b/tdlib/include/td/telegram/Client.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2021 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -23,7 +23,7 @@ namespace td { * Requests can be sent using the method ClientManager::send from any thread. * New updates and responses to requests can be received using the method ClientManager::receive from any thread after * the first request has been sent to the client instance. ClientManager::receive must not be called simultaneously from - * two different threads. Also note that all updates and responses to requests should be applied in the same order as + * two different threads. Also, note that all updates and responses to requests should be applied in the same order as * they were received, to ensure consistency. * Some TDLib requests can be executed synchronously from any thread using the method ClientManager::execute. * @@ -96,7 +96,7 @@ class ClientManager final { ClientId client_id; /** - * Request identifier, to which the response corresponds, or 0 for incoming updates from TDLib. + * Request identifier to which the response corresponds, or 0 for incoming updates from TDLib. */ RequestId request_id; @@ -126,10 +126,10 @@ class ClientManager final { /** * A type of callback function that will be called when a message is added to the internal TDLib log. * - * \param verbosity_level Log verbosity level with which the message was added (-1 - 1024). + * \param verbosity_level Log verbosity level with which the message was added from -1 up to 1024. * If 0, then TDLib will crash as soon as the callback returns. * None of the TDLib methods can be called from the callback. - * \param message Null-terminated string with the message added to the log. + * \param message Null-terminated UTF-8-encoded string with the message added to the log. */ using LogMessageCallbackPtr = void (*)(int verbosity_level, const char *message); @@ -177,7 +177,7 @@ class ClientManager final { * The TDLib instance is created for the lifetime of the Client object. * Requests to TDLib can be sent using the Client::send method from any thread. * New updates and responses to requests can be received using the Client::receive method from any thread, - * this function must not be called simultaneously from two different threads. Also note that all updates and + * this function must not be called simultaneously from two different threads. Also, note that all updates and * responses to requests should be applied in the same order as they were received, to ensure consistency. * Given this information, it's advisable to call this function from a dedicated thread. * Some service TDLib requests can be executed synchronously from any thread using the Client::execute method. @@ -199,7 +199,7 @@ class ClientManager final { * if (response.id == 0) { * // process response.object as an incoming update of type td_api::Update * } else { - * // process response.object as an answer to a sent request with id response.id + * // process response.object as an answer to a sent request with identifier response.id * } * } * \endcode diff --git a/tdlib/include/td/telegram/Log.h b/tdlib/include/td/telegram/Log.h index 7573c5b..9ad31da 100644 --- a/tdlib/include/td/telegram/Log.h +++ b/tdlib/include/td/telegram/Log.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2021 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/tdlib/include/td/telegram/td_api.h b/tdlib/include/td/telegram/td_api.h index dc4b818..420c834 100644 --- a/tdlib/include/td/telegram/td_api.h +++ b/tdlib/include/td/telegram/td_api.h @@ -64,622 +64,6 @@ std::string to_string(const std::vector> &values) { return result; } -class accountTtl; - -class address; - -class animatedChatPhoto; - -class animatedEmoji; - -class animation; - -class animations; - -class audio; - -class authenticationCodeInfo; - -class AuthenticationCodeType; - -class AuthorizationState; - -class autoDownloadSettings; - -class autoDownloadSettingsPresets; - -class background; - -class BackgroundFill; - -class BackgroundType; - -class backgrounds; - -class bankCardActionOpenUrl; - -class bankCardInfo; - -class basicGroup; - -class basicGroupFullInfo; - -class botCommand; - -class BotCommandScope; - -class botCommands; - -class call; - -class CallDiscardReason; - -class callId; - -class CallProblem; - -class callProtocol; - -class callServer; - -class CallServerType; - -class CallState; - -class callbackQueryAnswer; - -class CallbackQueryPayload; - -class CanTransferOwnershipResult; - -class chat; - -class ChatAction; - -class ChatActionBar; - -class chatAdministrator; - -class chatAdministrators; - -class chatEvent; - -class ChatEventAction; - -class chatEventLogFilters; - -class chatEvents; - -class chatFilter; - -class chatFilterInfo; - -class chatInviteLink; - -class chatInviteLinkCount; - -class chatInviteLinkCounts; - -class chatInviteLinkInfo; - -class chatInviteLinkMember; - -class chatInviteLinkMembers; - -class chatInviteLinks; - -class chatJoinRequest; - -class chatJoinRequests; - -class chatJoinRequestsInfo; - -class ChatList; - -class chatLists; - -class chatLocation; - -class chatMember; - -class ChatMemberStatus; - -class chatMembers; - -class ChatMembersFilter; - -class chatNearby; - -class chatNotificationSettings; - -class chatPermissions; - -class chatPhoto; - -class chatPhotoInfo; - -class chatPhotos; - -class chatPosition; - -class ChatReportReason; - -class ChatSource; - -class ChatStatistics; - -class chatStatisticsAdministratorActionsInfo; - -class chatStatisticsInviterInfo; - -class chatStatisticsMessageInteractionInfo; - -class chatStatisticsMessageSenderInfo; - -class chatTheme; - -class ChatType; - -class chats; - -class chatsNearby; - -class CheckChatUsernameResult; - -class CheckStickerSetNameResult; - -class closedVectorPath; - -class connectedWebsite; - -class connectedWebsites; - -class ConnectionState; - -class contact; - -class count; - -class countries; - -class countryInfo; - -class customRequestResult; - -class databaseStatistics; - -class date; - -class dateRange; - -class datedFile; - -class deepLinkInfo; - -class DeviceToken; - -class DiceStickers; - -class document; - -class draftMessage; - -class emailAddressAuthenticationCodeInfo; - -class emojis; - -class encryptedCredentials; - -class encryptedPassportElement; - -class error; - -class file; - -class filePart; - -class FileType; - -class formattedText; - -class foundMessages; - -class game; - -class gameHighScore; - -class gameHighScores; - -class groupCall; - -class groupCallId; - -class groupCallParticipant; - -class groupCallParticipantVideoInfo; - -class groupCallRecentSpeaker; - -class GroupCallVideoQuality; - -class groupCallVideoSourceGroup; - -class hashtags; - -class httpUrl; - -class identityDocument; - -class importedContacts; - -class inlineKeyboardButton; - -class InlineKeyboardButtonType; - -class InlineQueryResult; - -class inlineQueryResults; - -class InputBackground; - -class InputChatPhoto; - -class InputCredentials; - -class InputFile; - -class inputIdentityDocument; - -class InputInlineQueryResult; - -class InputMessageContent; - -class InputPassportElement; - -class inputPassportElementError; - -class InputPassportElementErrorSource; - -class inputPersonalDocument; - -class InputSticker; - -class inputThumbnail; - -class InternalLinkType; - -class invoice; - -class jsonObjectMember; - -class JsonValue; - -class keyboardButton; - -class KeyboardButtonType; - -class labeledPricePart; - -class languagePackInfo; - -class languagePackString; - -class LanguagePackStringValue; - -class languagePackStrings; - -class localFile; - -class localizationTargetInfo; - -class location; - -class LogStream; - -class logTags; - -class logVerbosityLevel; - -class LoginUrlInfo; - -class MaskPoint; - -class maskPosition; - -class message; - -class messageCalendar; - -class messageCalendarDay; - -class MessageContent; - -class messageCopyOptions; - -class MessageFileType; - -class messageForwardInfo; - -class MessageForwardOrigin; - -class messageInteractionInfo; - -class messageLink; - -class messageLinkInfo; - -class messagePosition; - -class messagePositions; - -class messageReplyInfo; - -class MessageSchedulingState; - -class messageSendOptions; - -class MessageSender; - -class messageSenders; - -class MessageSendingState; - -class messageStatistics; - -class messageThreadInfo; - -class messages; - -class minithumbnail; - -class networkStatistics; - -class NetworkStatisticsEntry; - -class NetworkType; - -class notification; - -class notificationGroup; - -class NotificationGroupType; - -class NotificationSettingsScope; - -class NotificationType; - -class ok; - -class OptionValue; - -class orderInfo; - -class PageBlock; - -class pageBlockCaption; - -class PageBlockHorizontalAlignment; - -class pageBlockListItem; - -class pageBlockRelatedArticle; - -class pageBlockTableCell; - -class PageBlockVerticalAlignment; - -class passportAuthorizationForm; - -class PassportElement; - -class passportElementError; - -class PassportElementErrorSource; - -class PassportElementType; - -class passportElements; - -class passportElementsWithErrors; - -class passportRequiredElement; - -class passportSuitableElement; - -class passwordState; - -class paymentForm; - -class paymentFormTheme; - -class paymentReceipt; - -class paymentResult; - -class paymentsProviderStripe; - -class personalDetails; - -class personalDocument; - -class phoneNumberAuthenticationSettings; - -class phoneNumberInfo; - -class photo; - -class photoSize; - -class point; - -class poll; - -class pollOption; - -class PollType; - -class profilePhoto; - -class proxies; - -class proxy; - -class ProxyType; - -class PublicChatType; - -class PushMessageContent; - -class pushReceiverId; - -class recommendedChatFilter; - -class recommendedChatFilters; - -class recoveryEmailAddress; - -class remoteFile; - -class ReplyMarkup; - -class ResetPasswordResult; - -class RichText; - -class savedCredentials; - -class scopeNotificationSettings; - -class SearchMessagesFilter; - -class seconds; - -class secretChat; - -class SecretChatState; - -class session; - -class sessions; - -class shippingOption; - -class sponsoredMessage; - -class StatisticalGraph; - -class statisticalValue; - -class sticker; - -class stickerSet; - -class stickerSetInfo; - -class stickerSets; - -class stickers; - -class storageStatistics; - -class storageStatisticsByChat; - -class storageStatisticsByFileType; - -class storageStatisticsFast; - -class SuggestedAction; - -class supergroup; - -class supergroupFullInfo; - -class SupergroupMembersFilter; - -class tMeUrl; - -class TMeUrlType; - -class tMeUrls; - -class tdlibParameters; - -class temporaryPasswordState; - -class termsOfService; - -class testBytes; - -class testInt; - -class testString; - -class testVectorInt; - -class testVectorIntObject; - -class testVectorString; - -class testVectorStringObject; - -class text; - -class textEntities; - -class textEntity; - -class TextEntityType; - -class TextParseMode; - -class themeSettings; - -class thumbnail; - -class ThumbnailFormat; - -class TopChatCategory; - -class Update; - -class updates; - -class user; - -class userFullInfo; - -class UserPrivacySetting; - -class UserPrivacySettingRule; - -class userPrivacySettingRules; - -class UserStatus; - -class UserType; - -class users; - -class validatedOrderInfo; - -class VectorPathCommand; - -class venue; - -class video; - -class videoChat; - -class videoNote; - -class voiceNote; - -class webPage; - -class webPageInstantView; - -class Object; - class Object: public TlObject { public: }; @@ -688,6 +72,25 @@ class Function: public TlObject { public: }; +class accentColor final : public Object { + public: + int32 id_; + int32 built_in_accent_color_id_; + array light_theme_colors_; + array dark_theme_colors_; + + accentColor(); + + accentColor(int32 id_, int32 built_in_accent_color_id_, array &&light_theme_colors_, array &&dark_theme_colors_); + + static const std::int32_t ID = 1830661068; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + class accountTtl final : public Object { public: int32 days_; @@ -704,6 +107,49 @@ class accountTtl final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class MessageSender; + +class ReactionType; + +class addedReaction final : public Object { + public: + object_ptr type_; + object_ptr sender_id_; + bool is_outgoing_; + int32 date_; + + addedReaction(); + + addedReaction(object_ptr &&type_, object_ptr &&sender_id_, bool is_outgoing_, int32 date_); + + static const std::int32_t ID = 1258586525; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class addedReaction; + +class addedReactions final : public Object { + public: + int32 total_count_; + array> reactions_; + string next_offset_; + + addedReactions(); + + addedReactions(int32 total_count_, array> &&reactions_, string const &next_offset_); + + static const std::int32_t ID = 226352304; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + class address final : public Object { public: string country_code_; @@ -725,6 +171,8 @@ class address final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class file; + class animatedChatPhoto final : public Object { public: int32 length_; @@ -743,17 +191,23 @@ class animatedChatPhoto final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class file; + +class sticker; + class animatedEmoji final : public Object { public: object_ptr sticker_; + int32 sticker_width_; + int32 sticker_height_; int32 fitzpatrick_type_; object_ptr sound_; animatedEmoji(); - animatedEmoji(object_ptr &&sticker_, int32 fitzpatrick_type_, object_ptr &&sound_); + animatedEmoji(object_ptr &&sticker_, int32 sticker_width_, int32 sticker_height_, int32 fitzpatrick_type_, object_ptr &&sound_); - static const std::int32_t ID = -1816658231; + static const std::int32_t ID = 1378918079; std::int32_t get_id() const final { return ID; } @@ -761,6 +215,12 @@ class animatedEmoji final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class file; + +class minithumbnail; + +class thumbnail; + class animation final : public Object { public: int32 duration_; @@ -785,6 +245,8 @@ class animation final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class animation; + class animations final : public Object { public: array> animations_; @@ -801,6 +263,89 @@ class animations final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class archiveChatListSettings final : public Object { + public: + bool archive_and_mute_new_chats_from_unknown_users_; + bool keep_unmuted_chats_archived_; + bool keep_chats_from_folders_archived_; + + archiveChatListSettings(); + + archiveChatListSettings(bool archive_and_mute_new_chats_from_unknown_users_, bool keep_unmuted_chats_archived_, bool keep_chats_from_folders_archived_); + + static const std::int32_t ID = 1058499236; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class attachmentMenuBotColor; + +class file; + +class attachmentMenuBot final : public Object { + public: + int53 bot_user_id_; + bool supports_self_chat_; + bool supports_user_chats_; + bool supports_bot_chats_; + bool supports_group_chats_; + bool supports_channel_chats_; + bool request_write_access_; + bool is_added_; + bool show_in_attachment_menu_; + bool show_in_side_menu_; + bool show_disclaimer_in_side_menu_; + string name_; + object_ptr name_color_; + object_ptr default_icon_; + object_ptr ios_static_icon_; + object_ptr ios_animated_icon_; + object_ptr ios_side_menu_icon_; + object_ptr android_icon_; + object_ptr android_side_menu_icon_; + object_ptr macos_icon_; + object_ptr macos_side_menu_icon_; + object_ptr icon_color_; + object_ptr web_app_placeholder_; + + attachmentMenuBot(); + + attachmentMenuBot(int53 bot_user_id_, bool supports_self_chat_, bool supports_user_chats_, bool supports_bot_chats_, bool supports_group_chats_, bool supports_channel_chats_, bool request_write_access_, bool is_added_, bool show_in_attachment_menu_, bool show_in_side_menu_, bool show_disclaimer_in_side_menu_, string const &name_, object_ptr &&name_color_, object_ptr &&default_icon_, object_ptr &&ios_static_icon_, object_ptr &&ios_animated_icon_, object_ptr &&ios_side_menu_icon_, object_ptr &&android_icon_, object_ptr &&android_side_menu_icon_, object_ptr &&macos_icon_, object_ptr &&macos_side_menu_icon_, object_ptr &&icon_color_, object_ptr &&web_app_placeholder_); + + static const std::int32_t ID = -1183966273; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class attachmentMenuBotColor final : public Object { + public: + int32 light_color_; + int32 dark_color_; + + attachmentMenuBotColor(); + + attachmentMenuBotColor(int32 light_color_, int32 dark_color_); + + static const std::int32_t ID = 1680039612; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class file; + +class minithumbnail; + +class thumbnail; + class audio final : public Object { public: int32 duration_; @@ -810,13 +355,14 @@ class audio final : public Object { string mime_type_; object_ptr album_cover_minithumbnail_; object_ptr album_cover_thumbnail_; + array> external_album_covers_; object_ptr audio_; audio(); - audio(int32 duration_, string const &title_, string const &performer_, string const &file_name_, string const &mime_type_, object_ptr &&album_cover_minithumbnail_, object_ptr &&album_cover_thumbnail_, object_ptr &&audio_); + audio(int32 duration_, string const &title_, string const &performer_, string const &file_name_, string const &mime_type_, object_ptr &&album_cover_minithumbnail_, object_ptr &&album_cover_thumbnail_, array> &&external_album_covers_, object_ptr &&audio_); - static const std::int32_t ID = -1179334690; + static const std::int32_t ID = -166398841; std::int32_t get_id() const final { return ID; } @@ -824,6 +370,8 @@ class audio final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class AuthenticationCodeType; + class authenticationCodeInfo final : public Object { public: string phone_number_; @@ -928,6 +476,66 @@ class authenticationCodeTypeMissedCall final : public AuthenticationCodeType { void store(TlStorerToString &s, const char *field_name) const final; }; +class authenticationCodeTypeFragment final : public AuthenticationCodeType { + public: + string url_; + int32 length_; + + authenticationCodeTypeFragment(); + + authenticationCodeTypeFragment(string const &url_, int32 length_); + + static const std::int32_t ID = -2129693491; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class authenticationCodeTypeFirebaseAndroid final : public AuthenticationCodeType { + public: + bytes nonce_; + int32 length_; + + authenticationCodeTypeFirebaseAndroid(); + + authenticationCodeTypeFirebaseAndroid(bytes const &nonce_, int32 length_); + + static const std::int32_t ID = -1978562535; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class authenticationCodeTypeFirebaseIos final : public AuthenticationCodeType { + public: + string receipt_; + int32 push_timeout_; + int32 length_; + + authenticationCodeTypeFirebaseIos(); + + authenticationCodeTypeFirebaseIos(string const &receipt_, int32 push_timeout_, int32 length_); + + static const std::int32_t ID = -11162989; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class EmailAddressResetState; + +class authenticationCodeInfo; + +class emailAddressAuthenticationCodeInfo; + +class termsOfService; + class AuthorizationState: public Object { public: }; @@ -945,15 +553,12 @@ class authorizationStateWaitTdlibParameters final : public AuthorizationState { void store(TlStorerToString &s, const char *field_name) const final; }; -class authorizationStateWaitEncryptionKey final : public AuthorizationState { +class authorizationStateWaitPhoneNumber final : public AuthorizationState { public: - bool is_encrypted_; - authorizationStateWaitEncryptionKey(); + authorizationStateWaitPhoneNumber(); - explicit authorizationStateWaitEncryptionKey(bool is_encrypted_); - - static const std::int32_t ID = 612103496; + static const std::int32_t ID = 306402531; std::int32_t get_id() const final { return ID; } @@ -961,12 +566,35 @@ class authorizationStateWaitEncryptionKey final : public AuthorizationState { void store(TlStorerToString &s, const char *field_name) const final; }; -class authorizationStateWaitPhoneNumber final : public AuthorizationState { +class authorizationStateWaitEmailAddress final : public AuthorizationState { public: + bool allow_apple_id_; + bool allow_google_id_; - authorizationStateWaitPhoneNumber(); + authorizationStateWaitEmailAddress(); - static const std::int32_t ID = 306402531; + authorizationStateWaitEmailAddress(bool allow_apple_id_, bool allow_google_id_); + + static const std::int32_t ID = 1040478663; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class authorizationStateWaitEmailCode final : public AuthorizationState { + public: + bool allow_apple_id_; + bool allow_google_id_; + object_ptr code_info_; + object_ptr email_address_reset_state_; + + authorizationStateWaitEmailCode(); + + authorizationStateWaitEmailCode(bool allow_apple_id_, bool allow_google_id_, object_ptr &&code_info_, object_ptr &&email_address_reset_state_); + + static const std::int32_t ID = -1868627365; std::int32_t get_id() const final { return ID; } @@ -1026,13 +654,14 @@ class authorizationStateWaitPassword final : public AuthorizationState { public: string password_hint_; bool has_recovery_email_address_; + bool has_passport_data_; string recovery_email_address_pattern_; authorizationStateWaitPassword(); - authorizationStateWaitPassword(string const &password_hint_, bool has_recovery_email_address_, string const &recovery_email_address_pattern_); + authorizationStateWaitPassword(string const &password_hint_, bool has_recovery_email_address_, bool has_passport_data_, string const &recovery_email_address_pattern_); - static const std::int32_t ID = 187548796; + static const std::int32_t ID = 112238030; std::int32_t get_id() const final { return ID; } @@ -1096,18 +725,19 @@ class autoDownloadSettings final : public Object { public: bool is_auto_download_enabled_; int32 max_photo_file_size_; - int32 max_video_file_size_; - int32 max_other_file_size_; + int53 max_video_file_size_; + int53 max_other_file_size_; int32 video_upload_bitrate_; bool preload_large_videos_; bool preload_next_audio_; + bool preload_stories_; bool use_less_data_for_calls_; autoDownloadSettings(); - autoDownloadSettings(bool is_auto_download_enabled_, int32 max_photo_file_size_, int32 max_video_file_size_, int32 max_other_file_size_, int32 video_upload_bitrate_, bool preload_large_videos_, bool preload_next_audio_, bool use_less_data_for_calls_); + autoDownloadSettings(bool is_auto_download_enabled_, int32 max_photo_file_size_, int53 max_video_file_size_, int53 max_other_file_size_, int32 video_upload_bitrate_, bool preload_large_videos_, bool preload_next_audio_, bool preload_stories_, bool use_less_data_for_calls_); - static const std::int32_t ID = -2144418333; + static const std::int32_t ID = 991433696; std::int32_t get_id() const final { return ID; } @@ -1115,6 +745,8 @@ class autoDownloadSettings final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class autoDownloadSettings; + class autoDownloadSettingsPresets final : public Object { public: object_ptr low_; @@ -1133,6 +765,151 @@ class autoDownloadSettingsPresets final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class autosaveSettingsException; + +class scopeAutosaveSettings; + +class autosaveSettings final : public Object { + public: + object_ptr private_chat_settings_; + object_ptr group_settings_; + object_ptr channel_settings_; + array> exceptions_; + + autosaveSettings(); + + autosaveSettings(object_ptr &&private_chat_settings_, object_ptr &&group_settings_, object_ptr &&channel_settings_, array> &&exceptions_); + + static const std::int32_t ID = 1629412502; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class scopeAutosaveSettings; + +class autosaveSettingsException final : public Object { + public: + int53 chat_id_; + object_ptr settings_; + + autosaveSettingsException(); + + autosaveSettingsException(int53 chat_id_, object_ptr &&settings_); + + static const std::int32_t ID = 1483470280; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class AutosaveSettingsScope: public Object { + public: +}; + +class autosaveSettingsScopePrivateChats final : public AutosaveSettingsScope { + public: + + autosaveSettingsScopePrivateChats(); + + static const std::int32_t ID = 1395227007; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class autosaveSettingsScopeGroupChats final : public AutosaveSettingsScope { + public: + + autosaveSettingsScopeGroupChats(); + + static const std::int32_t ID = 853544526; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class autosaveSettingsScopeChannelChats final : public AutosaveSettingsScope { + public: + + autosaveSettingsScopeChannelChats(); + + static const std::int32_t ID = -499572783; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class autosaveSettingsScopeChat final : public AutosaveSettingsScope { + public: + int53 chat_id_; + + autosaveSettingsScopeChat(); + + explicit autosaveSettingsScopeChat(int53 chat_id_); + + static const std::int32_t ID = -1632255255; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class ReactionType; + +class availableReaction final : public Object { + public: + object_ptr type_; + bool needs_premium_; + + availableReaction(); + + availableReaction(object_ptr &&type_, bool needs_premium_); + + static const std::int32_t ID = -117292153; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class availableReaction; + +class availableReactions final : public Object { + public: + array> top_reactions_; + array> recent_reactions_; + array> popular_reactions_; + bool allow_custom_emoji_; + + availableReactions(); + + availableReactions(array> &&top_reactions_, array> &&recent_reactions_, array> &&popular_reactions_, bool allow_custom_emoji_); + + static const std::int32_t ID = 1995943616; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class BackgroundType; + +class document; + class background final : public Object { public: int64 id_; @@ -1208,6 +985,8 @@ class backgroundFillFreeformGradient final : public BackgroundFill { void store(TlStorerToString &s, const char *field_name) const final; }; +class BackgroundFill; + class BackgroundType: public Object { public: }; @@ -1264,6 +1043,8 @@ class backgroundTypeFill final : public BackgroundType { void store(TlStorerToString &s, const char *field_name) const final; }; +class background; + class backgrounds final : public Object { public: array> backgrounds_; @@ -1297,6 +1078,8 @@ class bankCardActionOpenUrl final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class bankCardActionOpenUrl; + class bankCardInfo final : public Object { public: string title_; @@ -1314,6 +1097,8 @@ class bankCardInfo final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class ChatMemberStatus; + class basicGroup final : public Object { public: int53 id_; @@ -1334,20 +1119,60 @@ class basicGroup final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class botCommands; + +class chatInviteLink; + +class chatMember; + +class chatPhoto; + class basicGroupFullInfo final : public Object { public: object_ptr photo_; string description_; int53 creator_user_id_; array> members_; + bool can_hide_members_; + bool can_toggle_aggressive_anti_spam_; object_ptr invite_link_; array> bot_commands_; basicGroupFullInfo(); - basicGroupFullInfo(object_ptr &&photo_, string const &description_, int53 creator_user_id_, array> &&members_, object_ptr &&invite_link_, array> &&bot_commands_); + basicGroupFullInfo(object_ptr &&photo_, string const &description_, int53 creator_user_id_, array> &&members_, bool can_hide_members_, bool can_toggle_aggressive_anti_spam_, object_ptr &&invite_link_, array> &&bot_commands_); - static const std::int32_t ID = 2022233397; + static const std::int32_t ID = -1879035520; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class BlockList: public Object { + public: +}; + +class blockListMain final : public BlockList { + public: + + blockListMain(); + + static const std::int32_t ID = 1352930172; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class blockListStories final : public BlockList { + public: + + blockListStories(); + + static const std::int32_t ID = 103323228; std::int32_t get_id() const final { return ID; } @@ -1477,6 +1302,8 @@ class botCommandScopeChatMember final : public BotCommandScope { void store(TlStorerToString &s, const char *field_name) const final; }; +class botCommand; + class botCommands final : public Object { public: int53 bot_user_id_; @@ -1494,6 +1321,128 @@ class botCommands final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class InternalLinkType; + +class animation; + +class botCommand; + +class botMenuButton; + +class chatAdministratorRights; + +class photo; + +class botInfo final : public Object { + public: + string short_description_; + string description_; + object_ptr photo_; + object_ptr animation_; + object_ptr menu_button_; + array> commands_; + object_ptr default_group_administrator_rights_; + object_ptr default_channel_administrator_rights_; + object_ptr edit_commands_link_; + object_ptr edit_description_link_; + object_ptr edit_description_media_link_; + object_ptr edit_settings_link_; + + botInfo(); + + botInfo(string const &short_description_, string const &description_, object_ptr &&photo_, object_ptr &&animation_, object_ptr &&menu_button_, array> &&commands_, object_ptr &&default_group_administrator_rights_, object_ptr &&default_channel_administrator_rights_, object_ptr &&edit_commands_link_, object_ptr &&edit_description_link_, object_ptr &&edit_description_media_link_, object_ptr &&edit_settings_link_); + + static const std::int32_t ID = -1472546735; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class botMenuButton final : public Object { + public: + string text_; + string url_; + + botMenuButton(); + + botMenuButton(string const &text_, string const &url_); + + static const std::int32_t ID = -944407322; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class webApp; + +class BotWriteAccessAllowReason: public Object { + public: +}; + +class botWriteAccessAllowReasonConnectedWebsite final : public BotWriteAccessAllowReason { + public: + string domain_name_; + + botWriteAccessAllowReasonConnectedWebsite(); + + explicit botWriteAccessAllowReasonConnectedWebsite(string const &domain_name_); + + static const std::int32_t ID = 2016325603; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class botWriteAccessAllowReasonAddedToAttachmentMenu final : public BotWriteAccessAllowReason { + public: + + botWriteAccessAllowReasonAddedToAttachmentMenu(); + + static const std::int32_t ID = -2104795235; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class botWriteAccessAllowReasonLaunchedWebApp final : public BotWriteAccessAllowReason { + public: + object_ptr web_app_; + + botWriteAccessAllowReasonLaunchedWebApp(); + + explicit botWriteAccessAllowReasonLaunchedWebApp(object_ptr &&web_app_); + + static const std::int32_t ID = -240843561; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class botWriteAccessAllowReasonAcceptedRequest final : public BotWriteAccessAllowReason { + public: + + botWriteAccessAllowReasonAcceptedRequest(); + + static const std::int32_t ID = -1983497220; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class CallState; + class call final : public Object { public: int32 id_; @@ -1740,6 +1689,8 @@ class callProtocol final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class CallServerType; + class callServer final : public Object { public: int64 id_; @@ -1767,12 +1718,13 @@ class CallServerType: public Object { class callServerTypeTelegramReflector final : public CallServerType { public: bytes peer_tag_; + bool is_tcp_; callServerTypeTelegramReflector(); - explicit callServerTypeTelegramReflector(bytes const &peer_tag_); + callServerTypeTelegramReflector(bytes const &peer_tag_, bool is_tcp_); - static const std::int32_t ID = -1507850700; + static const std::int32_t ID = 850343189; std::int32_t get_id() const final { return ID; } @@ -1799,6 +1751,14 @@ class callServerTypeWebrtc final : public CallServerType { void store(TlStorerToString &s, const char *field_name) const final; }; +class CallDiscardReason; + +class callProtocol; + +class callServer; + +class error; + class CallState: public Object { public: }; @@ -1872,12 +1832,13 @@ class callStateDiscarded final : public CallState { object_ptr reason_; bool need_rating_; bool need_debug_information_; + bool need_log_; callStateDiscarded(); - callStateDiscarded(object_ptr &&reason_, bool need_rating_, bool need_debug_information_); + callStateDiscarded(object_ptr &&reason_, bool need_rating_, bool need_debug_information_, bool need_log_); - static const std::int32_t ID = -190853167; + static const std::int32_t ID = 1394310213; std::int32_t get_id() const final { return ID; } @@ -1972,6 +1933,94 @@ class callbackQueryPayloadGame final : public CallbackQueryPayload { void store(TlStorerToString &s, const char *field_name) const final; }; +class CanSendStoryResult: public Object { + public: +}; + +class canSendStoryResultOk final : public CanSendStoryResult { + public: + + canSendStoryResultOk(); + + static const std::int32_t ID = 1346171133; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class canSendStoryResultPremiumNeeded final : public CanSendStoryResult { + public: + + canSendStoryResultPremiumNeeded(); + + static const std::int32_t ID = 1451220585; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class canSendStoryResultBoostNeeded final : public CanSendStoryResult { + public: + + canSendStoryResultBoostNeeded(); + + static const std::int32_t ID = -1637816017; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class canSendStoryResultActiveStoryLimitExceeded final : public CanSendStoryResult { + public: + + canSendStoryResultActiveStoryLimitExceeded(); + + static const std::int32_t ID = -1344689450; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class canSendStoryResultWeeklyLimitExceeded final : public CanSendStoryResult { + public: + int32 retry_after_; + + canSendStoryResultWeeklyLimitExceeded(); + + explicit canSendStoryResultWeeklyLimitExceeded(int32 retry_after_); + + static const std::int32_t ID = 323068088; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class canSendStoryResultMonthlyLimitExceeded final : public CanSendStoryResult { + public: + int32 retry_after_; + + canSendStoryResultMonthlyLimitExceeded(); + + explicit canSendStoryResultMonthlyLimitExceeded(int32 retry_after_); + + static const std::int32_t ID = -578665771; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + class CanTransferOwnershipResult: public Object { public: }; @@ -2034,19 +2083,50 @@ class canTransferOwnershipResultSessionTooFresh final : public CanTransferOwners void store(TlStorerToString &s, const char *field_name) const final; }; +class BlockList; + +class ChatActionBar; + +class ChatAvailableReactions; + +class ChatType; + +class MessageSender; + +class chatBackground; + +class chatJoinRequestsInfo; + +class chatNotificationSettings; + +class chatPermissions; + +class chatPhotoInfo; + +class chatPosition; + +class draftMessage; + +class message; + +class videoChat; + class chat final : public Object { public: int53 id_; object_ptr type_; string title_; object_ptr photo_; + int32 accent_color_id_; + int64 background_custom_emoji_id_; object_ptr permissions_; object_ptr last_message_; array> positions_; object_ptr message_sender_id_; + object_ptr block_list_; bool has_protected_content_; + bool is_translatable_; bool is_marked_as_unread_; - bool is_blocked_; bool has_scheduled_messages_; bool can_be_deleted_only_for_self_; bool can_be_deleted_for_all_users_; @@ -2056,8 +2136,11 @@ class chat final : public Object { int53 last_read_inbox_message_id_; int53 last_read_outbox_message_id_; int32 unread_mention_count_; + int32 unread_reaction_count_; object_ptr notification_settings_; - int32 message_ttl_; + object_ptr available_reactions_; + int32 message_auto_delete_time_; + object_ptr background_; string theme_name_; object_ptr action_bar_; object_ptr video_chat_; @@ -2068,9 +2151,9 @@ class chat final : public Object { chat(); - chat(int53 id_, object_ptr &&type_, string const &title_, object_ptr &&photo_, object_ptr &&permissions_, object_ptr &&last_message_, array> &&positions_, object_ptr &&message_sender_id_, bool has_protected_content_, bool is_marked_as_unread_, bool is_blocked_, bool has_scheduled_messages_, bool can_be_deleted_only_for_self_, bool can_be_deleted_for_all_users_, bool can_be_reported_, bool default_disable_notification_, int32 unread_count_, int53 last_read_inbox_message_id_, int53 last_read_outbox_message_id_, int32 unread_mention_count_, object_ptr &¬ification_settings_, int32 message_ttl_, string const &theme_name_, object_ptr &&action_bar_, object_ptr &&video_chat_, object_ptr &&pending_join_requests_, int53 reply_markup_message_id_, object_ptr &&draft_message_, string const &client_data_); + chat(int53 id_, object_ptr &&type_, string const &title_, object_ptr &&photo_, int32 accent_color_id_, int64 background_custom_emoji_id_, object_ptr &&permissions_, object_ptr &&last_message_, array> &&positions_, object_ptr &&message_sender_id_, object_ptr &&block_list_, bool has_protected_content_, bool is_translatable_, bool is_marked_as_unread_, bool has_scheduled_messages_, bool can_be_deleted_only_for_self_, bool can_be_deleted_for_all_users_, bool can_be_reported_, bool default_disable_notification_, int32 unread_count_, int53 last_read_inbox_message_id_, int53 last_read_outbox_message_id_, int32 unread_mention_count_, int32 unread_reaction_count_, object_ptr &¬ification_settings_, object_ptr &&available_reactions_, int32 message_auto_delete_time_, object_ptr &&background_, string const &theme_name_, object_ptr &&action_bar_, object_ptr &&video_chat_, object_ptr &&pending_join_requests_, int53 reply_markup_message_id_, object_ptr &&draft_message_, string const &client_data_); - static const std::int32_t ID = 1617921149; + static const std::int32_t ID = 577146552; std::int32_t get_id() const final { return ID; } @@ -2402,6 +2485,30 @@ class chatActionBarJoinRequest final : public ChatActionBar { void store(TlStorerToString &s, const char *field_name) const final; }; +class StoryList; + +class storyInfo; + +class chatActiveStories final : public Object { + public: + int53 chat_id_; + object_ptr list_; + int53 order_; + int32 max_read_story_id_; + array> stories_; + + chatActiveStories(); + + chatActiveStories(int53 chat_id_, object_ptr &&list_, int53 order_, int32 max_read_story_id_, array> &&stories_); + + static const std::int32_t ID = -1398869529; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + class chatAdministrator final : public Object { public: int53 user_id_; @@ -2420,6 +2527,38 @@ class chatAdministrator final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class chatAdministratorRights final : public Object { + public: + bool can_manage_chat_; + bool can_change_info_; + bool can_post_messages_; + bool can_edit_messages_; + bool can_delete_messages_; + bool can_invite_users_; + bool can_restrict_members_; + bool can_pin_messages_; + bool can_manage_topics_; + bool can_promote_members_; + bool can_manage_video_chats_; + bool can_post_stories_; + bool can_edit_stories_; + bool can_delete_stories_; + bool is_anonymous_; + + chatAdministratorRights(); + + chatAdministratorRights(bool can_manage_chat_, bool can_change_info_, bool can_post_messages_, bool can_edit_messages_, bool can_delete_messages_, bool can_invite_users_, bool can_restrict_members_, bool can_pin_messages_, bool can_manage_topics_, bool can_promote_members_, bool can_manage_video_chats_, bool can_post_stories_, bool can_edit_stories_, bool can_delete_stories_, bool is_anonymous_); + + static const std::int32_t ID = 1599049796; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatAdministrator; + class chatAdministrators final : public Object { public: array> administrators_; @@ -2436,6 +2575,241 @@ class chatAdministrators final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class ReactionType; + +class ChatAvailableReactions: public Object { + public: +}; + +class chatAvailableReactionsAll final : public ChatAvailableReactions { + public: + + chatAvailableReactionsAll(); + + static const std::int32_t ID = -537887666; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatAvailableReactionsSome final : public ChatAvailableReactions { + public: + array> reactions_; + + chatAvailableReactionsSome(); + + explicit chatAvailableReactionsSome(array> &&reactions_); + + static const std::int32_t ID = -640810821; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class background; + +class chatBackground final : public Object { + public: + object_ptr background_; + int32 dark_theme_dimming_; + + chatBackground(); + + chatBackground(object_ptr &&background_, int32 dark_theme_dimming_); + + static const std::int32_t ID = 1653152104; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class ChatBoostSource; + +class chatBoost final : public Object { + public: + string id_; + int32 count_; + object_ptr source_; + int32 start_date_; + int32 expiration_date_; + + chatBoost(); + + chatBoost(string const &id_, int32 count_, object_ptr &&source_, int32 start_date_, int32 expiration_date_); + + static const std::int32_t ID = -1765815118; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatBoostLink final : public Object { + public: + string link_; + bool is_public_; + + chatBoostLink(); + + chatBoostLink(string const &link_, bool is_public_); + + static const std::int32_t ID = -1253999503; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatBoostLinkInfo final : public Object { + public: + bool is_public_; + int53 chat_id_; + + chatBoostLinkInfo(); + + chatBoostLinkInfo(bool is_public_, int53 chat_id_); + + static const std::int32_t ID = -602785660; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatBoostSlot final : public Object { + public: + int32 slot_id_; + int53 currently_boosted_chat_id_; + int32 start_date_; + int32 expiration_date_; + int32 cooldown_until_date_; + + chatBoostSlot(); + + chatBoostSlot(int32 slot_id_, int53 currently_boosted_chat_id_, int32 start_date_, int32 expiration_date_, int32 cooldown_until_date_); + + static const std::int32_t ID = 123206343; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatBoostSlot; + +class chatBoostSlots final : public Object { + public: + array> slots_; + + chatBoostSlots(); + + explicit chatBoostSlots(array> &&slots_); + + static const std::int32_t ID = 1014966293; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class ChatBoostSource: public Object { + public: +}; + +class chatBoostSourceGiftCode final : public ChatBoostSource { + public: + int53 user_id_; + string gift_code_; + + chatBoostSourceGiftCode(); + + chatBoostSourceGiftCode(int53 user_id_, string const &gift_code_); + + static const std::int32_t ID = -98299206; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatBoostSourceGiveaway final : public ChatBoostSource { + public: + int53 user_id_; + string gift_code_; + int53 giveaway_message_id_; + bool is_unclaimed_; + + chatBoostSourceGiveaway(); + + chatBoostSourceGiveaway(int53 user_id_, string const &gift_code_, int53 giveaway_message_id_, bool is_unclaimed_); + + static const std::int32_t ID = 151854192; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatBoostSourcePremium final : public ChatBoostSource { + public: + int53 user_id_; + + chatBoostSourcePremium(); + + explicit chatBoostSourcePremium(int53 user_id_); + + static const std::int32_t ID = 972011; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class prepaidPremiumGiveaway; + +class chatBoostStatus final : public Object { + public: + string boost_url_; + array applied_slot_ids_; + int32 level_; + int32 gift_code_boost_count_; + int32 boost_count_; + int32 current_level_boost_count_; + int32 next_level_boost_count_; + int32 premium_member_count_; + double premium_member_percentage_; + array> prepaid_giveaways_; + + chatBoostStatus(); + + chatBoostStatus(string const &boost_url_, array &&applied_slot_ids_, int32 level_, int32 gift_code_boost_count_, int32 boost_count_, int32 current_level_boost_count_, int32 next_level_boost_count_, int32 premium_member_count_, double premium_member_percentage_, array> &&prepaid_giveaways_); + + static const std::int32_t ID = -347168798; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class ChatEventAction; + +class MessageSender; + class chatEvent final : public Object { public: int64 id_; @@ -2455,6 +2829,24 @@ class chatEvent final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class ChatAvailableReactions; + +class ChatMemberStatus; + +class MessageSender; + +class chatInviteLink; + +class chatLocation; + +class chatPermissions; + +class chatPhoto; + +class forumTopicInfo; + +class message; + class ChatEventAction: public Object { public: }; @@ -2479,28 +2871,13 @@ class chatEventMessageEdited final : public ChatEventAction { class chatEventMessageDeleted final : public ChatEventAction { public: object_ptr message_; + bool can_report_anti_spam_false_positive_; chatEventMessageDeleted(); - explicit chatEventMessageDeleted(object_ptr &&message_); + chatEventMessageDeleted(object_ptr &&message_, bool can_report_anti_spam_false_positive_); - static const std::int32_t ID = -892974601; - std::int32_t get_id() const final { - return ID; - } - - void store(TlStorerToString &s, const char *field_name) const final; -}; - -class chatEventPollStopped final : public ChatEventAction { - public: - object_ptr message_; - - chatEventPollStopped(); - - explicit chatEventPollStopped(object_ptr &&message_); - - static const std::int32_t ID = 2009893861; + static const std::int32_t ID = 935316851; std::int32_t get_id() const final { return ID; } @@ -2540,6 +2917,22 @@ class chatEventMessageUnpinned final : public ChatEventAction { void store(TlStorerToString &s, const char *field_name) const final; }; +class chatEventPollStopped final : public ChatEventAction { + public: + object_ptr message_; + + chatEventPollStopped(); + + explicit chatEventPollStopped(object_ptr &&message_); + + static const std::int32_t ID = 2009893861; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + class chatEventMemberJoined final : public ChatEventAction { public: @@ -2556,12 +2949,13 @@ class chatEventMemberJoined final : public ChatEventAction { class chatEventMemberJoinedByInviteLink final : public ChatEventAction { public: object_ptr invite_link_; + bool via_chat_folder_invite_link_; chatEventMemberJoinedByInviteLink(); - explicit chatEventMemberJoinedByInviteLink(object_ptr &&invite_link_); + chatEventMemberJoinedByInviteLink(object_ptr &&invite_link_, bool via_chat_folder_invite_link_); - static const std::int32_t ID = -253307459; + static const std::int32_t ID = -1445536390; std::int32_t get_id() const final { return ID; } @@ -2586,19 +2980,6 @@ class chatEventMemberJoinedByRequest final : public ChatEventAction { void store(TlStorerToString &s, const char *field_name) const final; }; -class chatEventMemberLeft final : public ChatEventAction { - public: - - chatEventMemberLeft(); - - static const std::int32_t ID = -948420593; - std::int32_t get_id() const final { - return ID; - } - - void store(TlStorerToString &s, const char *field_name) const final; -}; - class chatEventMemberInvited final : public ChatEventAction { public: int53 user_id_; @@ -2616,6 +2997,19 @@ class chatEventMemberInvited final : public ChatEventAction { void store(TlStorerToString &s, const char *field_name) const final; }; +class chatEventMemberLeft final : public ChatEventAction { + public: + + chatEventMemberLeft(); + + static const std::int32_t ID = -948420593; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + class chatEventMemberPromoted final : public ChatEventAction { public: int53 user_id_; @@ -2652,33 +3046,16 @@ class chatEventMemberRestricted final : public ChatEventAction { void store(TlStorerToString &s, const char *field_name) const final; }; -class chatEventTitleChanged final : public ChatEventAction { +class chatEventAvailableReactionsChanged final : public ChatEventAction { public: - string old_title_; - string new_title_; + object_ptr old_available_reactions_; + object_ptr new_available_reactions_; - chatEventTitleChanged(); + chatEventAvailableReactionsChanged(); - chatEventTitleChanged(string const &old_title_, string const &new_title_); + chatEventAvailableReactionsChanged(object_ptr &&old_available_reactions_, object_ptr &&new_available_reactions_); - static const std::int32_t ID = 1134103250; - std::int32_t get_id() const final { - return ID; - } - - void store(TlStorerToString &s, const char *field_name) const final; -}; - -class chatEventPermissionsChanged final : public ChatEventAction { - public: - object_ptr old_permissions_; - object_ptr new_permissions_; - - chatEventPermissionsChanged(); - - chatEventPermissionsChanged(object_ptr &&old_permissions_, object_ptr &&new_permissions_); - - static const std::int32_t ID = -1311557720; + static const std::int32_t ID = -1749491521; std::int32_t get_id() const final { return ID; } @@ -2703,56 +3080,6 @@ class chatEventDescriptionChanged final : public ChatEventAction { void store(TlStorerToString &s, const char *field_name) const final; }; -class chatEventUsernameChanged final : public ChatEventAction { - public: - string old_username_; - string new_username_; - - chatEventUsernameChanged(); - - chatEventUsernameChanged(string const &old_username_, string const &new_username_); - - static const std::int32_t ID = 1728558443; - std::int32_t get_id() const final { - return ID; - } - - void store(TlStorerToString &s, const char *field_name) const final; -}; - -class chatEventPhotoChanged final : public ChatEventAction { - public: - object_ptr old_photo_; - object_ptr new_photo_; - - chatEventPhotoChanged(); - - chatEventPhotoChanged(object_ptr &&old_photo_, object_ptr &&new_photo_); - - static const std::int32_t ID = -811572541; - std::int32_t get_id() const final { - return ID; - } - - void store(TlStorerToString &s, const char *field_name) const final; -}; - -class chatEventInvitesToggled final : public ChatEventAction { - public: - bool can_invite_users_; - - chatEventInvitesToggled(); - - explicit chatEventInvitesToggled(bool can_invite_users_); - - static const std::int32_t ID = -62548373; - std::int32_t get_id() const final { - return ID; - } - - void store(TlStorerToString &s, const char *field_name) const final; -}; - class chatEventLinkedChatChanged final : public ChatEventAction { public: int53 old_linked_chat_id_; @@ -2770,89 +3097,6 @@ class chatEventLinkedChatChanged final : public ChatEventAction { void store(TlStorerToString &s, const char *field_name) const final; }; -class chatEventSlowModeDelayChanged final : public ChatEventAction { - public: - int32 old_slow_mode_delay_; - int32 new_slow_mode_delay_; - - chatEventSlowModeDelayChanged(); - - chatEventSlowModeDelayChanged(int32 old_slow_mode_delay_, int32 new_slow_mode_delay_); - - static const std::int32_t ID = -1653195765; - std::int32_t get_id() const final { - return ID; - } - - void store(TlStorerToString &s, const char *field_name) const final; -}; - -class chatEventMessageTtlChanged final : public ChatEventAction { - public: - int32 old_message_ttl_; - int32 new_message_ttl_; - - chatEventMessageTtlChanged(); - - chatEventMessageTtlChanged(int32 old_message_ttl_, int32 new_message_ttl_); - - static const std::int32_t ID = 776386995; - std::int32_t get_id() const final { - return ID; - } - - void store(TlStorerToString &s, const char *field_name) const final; -}; - -class chatEventSignMessagesToggled final : public ChatEventAction { - public: - bool sign_messages_; - - chatEventSignMessagesToggled(); - - explicit chatEventSignMessagesToggled(bool sign_messages_); - - static const std::int32_t ID = -1313265634; - std::int32_t get_id() const final { - return ID; - } - - void store(TlStorerToString &s, const char *field_name) const final; -}; - -class chatEventHasProtectedContentToggled final : public ChatEventAction { - public: - bool has_protected_content_; - - chatEventHasProtectedContentToggled(); - - explicit chatEventHasProtectedContentToggled(bool has_protected_content_); - - static const std::int32_t ID = -184270335; - std::int32_t get_id() const final { - return ID; - } - - void store(TlStorerToString &s, const char *field_name) const final; -}; - -class chatEventStickerSetChanged final : public ChatEventAction { - public: - int64 old_sticker_set_id_; - int64 new_sticker_set_id_; - - chatEventStickerSetChanged(); - - chatEventStickerSetChanged(int64 old_sticker_set_id_, int64 new_sticker_set_id_); - - static const std::int32_t ID = -1243130481; - std::int32_t get_id() const final { - return ID; - } - - void store(TlStorerToString &s, const char *field_name) const final; -}; - class chatEventLocationChanged final : public ChatEventAction { public: object_ptr old_location_; @@ -2870,6 +3114,208 @@ class chatEventLocationChanged final : public ChatEventAction { void store(TlStorerToString &s, const char *field_name) const final; }; +class chatEventMessageAutoDeleteTimeChanged final : public ChatEventAction { + public: + int32 old_message_auto_delete_time_; + int32 new_message_auto_delete_time_; + + chatEventMessageAutoDeleteTimeChanged(); + + chatEventMessageAutoDeleteTimeChanged(int32 old_message_auto_delete_time_, int32 new_message_auto_delete_time_); + + static const std::int32_t ID = 17317668; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatEventPermissionsChanged final : public ChatEventAction { + public: + object_ptr old_permissions_; + object_ptr new_permissions_; + + chatEventPermissionsChanged(); + + chatEventPermissionsChanged(object_ptr &&old_permissions_, object_ptr &&new_permissions_); + + static const std::int32_t ID = -1311557720; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatEventPhotoChanged final : public ChatEventAction { + public: + object_ptr old_photo_; + object_ptr new_photo_; + + chatEventPhotoChanged(); + + chatEventPhotoChanged(object_ptr &&old_photo_, object_ptr &&new_photo_); + + static const std::int32_t ID = -811572541; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatEventSlowModeDelayChanged final : public ChatEventAction { + public: + int32 old_slow_mode_delay_; + int32 new_slow_mode_delay_; + + chatEventSlowModeDelayChanged(); + + chatEventSlowModeDelayChanged(int32 old_slow_mode_delay_, int32 new_slow_mode_delay_); + + static const std::int32_t ID = -1653195765; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatEventStickerSetChanged final : public ChatEventAction { + public: + int64 old_sticker_set_id_; + int64 new_sticker_set_id_; + + chatEventStickerSetChanged(); + + chatEventStickerSetChanged(int64 old_sticker_set_id_, int64 new_sticker_set_id_); + + static const std::int32_t ID = -1243130481; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatEventTitleChanged final : public ChatEventAction { + public: + string old_title_; + string new_title_; + + chatEventTitleChanged(); + + chatEventTitleChanged(string const &old_title_, string const &new_title_); + + static const std::int32_t ID = 1134103250; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatEventUsernameChanged final : public ChatEventAction { + public: + string old_username_; + string new_username_; + + chatEventUsernameChanged(); + + chatEventUsernameChanged(string const &old_username_, string const &new_username_); + + static const std::int32_t ID = 1728558443; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatEventActiveUsernamesChanged final : public ChatEventAction { + public: + array old_usernames_; + array new_usernames_; + + chatEventActiveUsernamesChanged(); + + chatEventActiveUsernamesChanged(array &&old_usernames_, array &&new_usernames_); + + static const std::int32_t ID = -1508790810; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatEventAccentColorChanged final : public ChatEventAction { + public: + int32 old_accent_color_id_; + int32 new_accent_color_id_; + + chatEventAccentColorChanged(); + + chatEventAccentColorChanged(int32 old_accent_color_id_, int32 new_accent_color_id_); + + static const std::int32_t ID = 707952178; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatEventBackgroundCustomEmojiChanged final : public ChatEventAction { + public: + int64 old_background_custom_emoji_id_; + int64 new_background_custom_emoji_id_; + + chatEventBackgroundCustomEmojiChanged(); + + chatEventBackgroundCustomEmojiChanged(int64 old_background_custom_emoji_id_, int64 new_background_custom_emoji_id_); + + static const std::int32_t ID = -764993894; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatEventHasProtectedContentToggled final : public ChatEventAction { + public: + bool has_protected_content_; + + chatEventHasProtectedContentToggled(); + + explicit chatEventHasProtectedContentToggled(bool has_protected_content_); + + static const std::int32_t ID = -184270335; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatEventInvitesToggled final : public ChatEventAction { + public: + bool can_invite_users_; + + chatEventInvitesToggled(); + + explicit chatEventInvitesToggled(bool can_invite_users_); + + static const std::int32_t ID = -62548373; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + class chatEventIsAllHistoryAvailableToggled final : public ChatEventAction { public: bool is_all_history_available_; @@ -2886,6 +3332,38 @@ class chatEventIsAllHistoryAvailableToggled final : public ChatEventAction { void store(TlStorerToString &s, const char *field_name) const final; }; +class chatEventHasAggressiveAntiSpamEnabledToggled final : public ChatEventAction { + public: + bool has_aggressive_anti_spam_enabled_; + + chatEventHasAggressiveAntiSpamEnabledToggled(); + + explicit chatEventHasAggressiveAntiSpamEnabledToggled(bool has_aggressive_anti_spam_enabled_); + + static const std::int32_t ID = -125348094; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatEventSignMessagesToggled final : public ChatEventAction { + public: + bool sign_messages_; + + chatEventSignMessagesToggled(); + + explicit chatEventSignMessagesToggled(bool sign_messages_); + + static const std::int32_t ID = -1313265634; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + class chatEventInviteLinkEdited final : public ChatEventAction { public: object_ptr old_invite_link_; @@ -2967,6 +3445,22 @@ class chatEventVideoChatEnded final : public ChatEventAction { void store(TlStorerToString &s, const char *field_name) const final; }; +class chatEventVideoChatMuteNewParticipantsToggled final : public ChatEventAction { + public: + bool mute_new_participants_; + + chatEventVideoChatMuteNewParticipantsToggled(); + + explicit chatEventVideoChatMuteNewParticipantsToggled(bool mute_new_participants_); + + static const std::int32_t ID = -126547970; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + class chatEventVideoChatParticipantIsMutedToggled final : public ChatEventAction { public: object_ptr participant_id_; @@ -3001,15 +3495,113 @@ class chatEventVideoChatParticipantVolumeLevelChanged final : public ChatEventAc void store(TlStorerToString &s, const char *field_name) const final; }; -class chatEventVideoChatMuteNewParticipantsToggled final : public ChatEventAction { +class chatEventIsForumToggled final : public ChatEventAction { public: - bool mute_new_participants_; + bool is_forum_; - chatEventVideoChatMuteNewParticipantsToggled(); + chatEventIsForumToggled(); - explicit chatEventVideoChatMuteNewParticipantsToggled(bool mute_new_participants_); + explicit chatEventIsForumToggled(bool is_forum_); - static const std::int32_t ID = -126547970; + static const std::int32_t ID = 1516491033; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatEventForumTopicCreated final : public ChatEventAction { + public: + object_ptr topic_info_; + + chatEventForumTopicCreated(); + + explicit chatEventForumTopicCreated(object_ptr &&topic_info_); + + static const std::int32_t ID = 2005269314; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatEventForumTopicEdited final : public ChatEventAction { + public: + object_ptr old_topic_info_; + object_ptr new_topic_info_; + + chatEventForumTopicEdited(); + + chatEventForumTopicEdited(object_ptr &&old_topic_info_, object_ptr &&new_topic_info_); + + static const std::int32_t ID = 1624910860; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatEventForumTopicToggleIsClosed final : public ChatEventAction { + public: + object_ptr topic_info_; + + chatEventForumTopicToggleIsClosed(); + + explicit chatEventForumTopicToggleIsClosed(object_ptr &&topic_info_); + + static const std::int32_t ID = -962704070; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatEventForumTopicToggleIsHidden final : public ChatEventAction { + public: + object_ptr topic_info_; + + chatEventForumTopicToggleIsHidden(); + + explicit chatEventForumTopicToggleIsHidden(object_ptr &&topic_info_); + + static const std::int32_t ID = -1609175250; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatEventForumTopicDeleted final : public ChatEventAction { + public: + object_ptr topic_info_; + + chatEventForumTopicDeleted(); + + explicit chatEventForumTopicDeleted(object_ptr &&topic_info_); + + static const std::int32_t ID = -1332795123; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatEventForumTopicPinned final : public ChatEventAction { + public: + object_ptr old_topic_info_; + object_ptr new_topic_info_; + + chatEventForumTopicPinned(); + + chatEventForumTopicPinned(object_ptr &&old_topic_info_, object_ptr &&new_topic_info_); + + static const std::int32_t ID = 2143626222; std::int32_t get_id() const final { return ID; } @@ -3031,12 +3623,13 @@ class chatEventLogFilters final : public Object { bool setting_changes_; bool invite_link_changes_; bool video_chat_changes_; + bool forum_changes_; chatEventLogFilters(); - chatEventLogFilters(bool message_edits_, bool message_deletions_, bool message_pins_, bool member_joins_, bool member_leaves_, bool member_invites_, bool member_promotions_, bool member_restrictions_, bool info_changes_, bool setting_changes_, bool invite_link_changes_, bool video_chat_changes_); + chatEventLogFilters(bool message_edits_, bool message_deletions_, bool message_pins_, bool member_joins_, bool member_leaves_, bool member_invites_, bool member_promotions_, bool member_restrictions_, bool info_changes_, bool setting_changes_, bool invite_link_changes_, bool video_chat_changes_, bool forum_changes_); - static const std::int32_t ID = 1251197299; + static const std::int32_t ID = 1648261677; std::int32_t get_id() const final { return ID; } @@ -3044,6 +3637,8 @@ class chatEventLogFilters final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class chatEvent; + class chatEvents final : public Object { public: array> events_; @@ -3060,10 +3655,13 @@ class chatEvents final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; -class chatFilter final : public Object { +class chatFolderIcon; + +class chatFolder final : public Object { public: string title_; - string icon_name_; + object_ptr icon_; + bool is_shareable_; array pinned_chat_ids_; array included_chat_ids_; array excluded_chat_ids_; @@ -3076,11 +3674,11 @@ class chatFilter final : public Object { bool include_groups_; bool include_channels_; - chatFilter(); + chatFolder(); - chatFilter(string const &title_, string const &icon_name_, array &&pinned_chat_ids_, array &&included_chat_ids_, array &&excluded_chat_ids_, bool exclude_muted_, bool exclude_read_, bool exclude_archived_, bool include_contacts_, bool include_non_contacts_, bool include_bots_, bool include_groups_, bool include_channels_); + chatFolder(string const &title_, object_ptr &&icon_, bool is_shareable_, array &&pinned_chat_ids_, array &&included_chat_ids_, array &&excluded_chat_ids_, bool exclude_muted_, bool exclude_read_, bool exclude_archived_, bool include_contacts_, bool include_non_contacts_, bool include_bots_, bool include_groups_, bool include_channels_); - static const std::int32_t ID = -664815123; + static const std::int32_t ID = -459081051; std::int32_t get_id() const final { return ID; } @@ -3088,17 +3686,93 @@ class chatFilter final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; -class chatFilterInfo final : public Object { +class chatFolderIcon final : public Object { + public: + string name_; + + chatFolderIcon(); + + explicit chatFolderIcon(string const &name_); + + static const std::int32_t ID = -146104090; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatFolderIcon; + +class chatFolderInfo final : public Object { public: int32 id_; string title_; - string icon_name_; + object_ptr icon_; + bool is_shareable_; + bool has_my_invite_links_; - chatFilterInfo(); + chatFolderInfo(); - chatFilterInfo(int32 id_, string const &title_, string const &icon_name_); + chatFolderInfo(int32 id_, string const &title_, object_ptr &&icon_, bool is_shareable_, bool has_my_invite_links_); - static const std::int32_t ID = -943721165; + static const std::int32_t ID = 1279189204; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatFolderInviteLink final : public Object { + public: + string invite_link_; + string name_; + array chat_ids_; + + chatFolderInviteLink(); + + chatFolderInviteLink(string const &invite_link_, string const &name_, array &&chat_ids_); + + static const std::int32_t ID = 493969661; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatFolderInfo; + +class chatFolderInviteLinkInfo final : public Object { + public: + object_ptr chat_folder_info_; + array missing_chat_ids_; + array added_chat_ids_; + + chatFolderInviteLinkInfo(); + + chatFolderInviteLinkInfo(object_ptr &&chat_folder_info_, array &&missing_chat_ids_, array &&added_chat_ids_); + + static const std::int32_t ID = 1119450395; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatFolderInviteLink; + +class chatFolderInviteLinks final : public Object { + public: + array> invite_links_; + + chatFolderInviteLinks(); + + explicit chatFolderInviteLinks(array> &&invite_links_); + + static const std::int32_t ID = 1853351525; std::int32_t get_id() const final { return ID; } @@ -3151,6 +3825,8 @@ class chatInviteLinkCount final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class chatInviteLinkCount; + class chatInviteLinkCounts final : public Object { public: array> invite_link_counts_; @@ -3167,24 +3843,32 @@ class chatInviteLinkCounts final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class InviteLinkChatType; + +class chatPhotoInfo; + class chatInviteLinkInfo final : public Object { public: int53 chat_id_; int32 accessible_for_; - object_ptr type_; + object_ptr type_; string title_; object_ptr photo_; + int32 accent_color_id_; string description_; int32 member_count_; array member_user_ids_; bool creates_join_request_; bool is_public_; + bool is_verified_; + bool is_scam_; + bool is_fake_; chatInviteLinkInfo(); - chatInviteLinkInfo(int53 chat_id_, int32 accessible_for_, object_ptr &&type_, string const &title_, object_ptr &&photo_, string const &description_, int32 member_count_, array &&member_user_ids_, bool creates_join_request_, bool is_public_); + chatInviteLinkInfo(int53 chat_id_, int32 accessible_for_, object_ptr &&type_, string const &title_, object_ptr &&photo_, int32 accent_color_id_, string const &description_, int32 member_count_, array &&member_user_ids_, bool creates_join_request_, bool is_public_, bool is_verified_, bool is_scam_, bool is_fake_); - static const std::int32_t ID = 546234276; + static const std::int32_t ID = 1683383858; std::int32_t get_id() const final { return ID; } @@ -3196,13 +3880,14 @@ class chatInviteLinkMember final : public Object { public: int53 user_id_; int32 joined_chat_date_; + bool via_chat_folder_invite_link_; int53 approver_user_id_; chatInviteLinkMember(); - chatInviteLinkMember(int53 user_id_, int32 joined_chat_date_, int53 approver_user_id_); + chatInviteLinkMember(int53 user_id_, int32 joined_chat_date_, bool via_chat_folder_invite_link_, int53 approver_user_id_); - static const std::int32_t ID = -1409060582; + static const std::int32_t ID = 29156795; std::int32_t get_id() const final { return ID; } @@ -3210,6 +3895,8 @@ class chatInviteLinkMember final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class chatInviteLinkMember; + class chatInviteLinkMembers final : public Object { public: int32 total_count_; @@ -3227,6 +3914,8 @@ class chatInviteLinkMembers final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class chatInviteLink; + class chatInviteLinks final : public Object { public: int32 total_count_; @@ -3262,6 +3951,8 @@ class chatJoinRequest final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class chatJoinRequest; + class chatJoinRequests final : public Object { public: int32 total_count_; @@ -3326,15 +4017,15 @@ class chatListArchive final : public ChatList { void store(TlStorerToString &s, const char *field_name) const final; }; -class chatListFilter final : public ChatList { +class chatListFolder final : public ChatList { public: - int32 chat_filter_id_; + int32 chat_folder_id_; - chatListFilter(); + chatListFolder(); - explicit chatListFilter(int32 chat_filter_id_); + explicit chatListFolder(int32 chat_folder_id_); - static const std::int32_t ID = -2022707655; + static const std::int32_t ID = 385760856; std::int32_t get_id() const final { return ID; } @@ -3342,6 +4033,8 @@ class chatListFilter final : public ChatList { void store(TlStorerToString &s, const char *field_name) const final; }; +class ChatList; + class chatLists final : public Object { public: array> chat_lists_; @@ -3358,6 +4051,8 @@ class chatLists final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class location; + class chatLocation final : public Object { public: object_ptr location_; @@ -3375,6 +4070,10 @@ class chatLocation final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class ChatMemberStatus; + +class MessageSender; + class chatMember final : public Object { public: object_ptr member_id_; @@ -3394,6 +4093,10 @@ class chatMember final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class chatAdministratorRights; + +class chatPermissions; + class ChatMemberStatus: public Object { public: }; @@ -3420,23 +4123,13 @@ class chatMemberStatusAdministrator final : public ChatMemberStatus { public: string custom_title_; bool can_be_edited_; - bool can_manage_chat_; - bool can_change_info_; - bool can_post_messages_; - bool can_edit_messages_; - bool can_delete_messages_; - bool can_invite_users_; - bool can_restrict_members_; - bool can_pin_messages_; - bool can_promote_members_; - bool can_manage_video_chats_; - bool is_anonymous_; + object_ptr rights_; chatMemberStatusAdministrator(); - chatMemberStatusAdministrator(string const &custom_title_, bool can_be_edited_, bool can_manage_chat_, bool can_change_info_, bool can_post_messages_, bool can_edit_messages_, bool can_delete_messages_, bool can_invite_users_, bool can_restrict_members_, bool can_pin_messages_, bool can_promote_members_, bool can_manage_video_chats_, bool is_anonymous_); + chatMemberStatusAdministrator(string const &custom_title_, bool can_be_edited_, object_ptr &&rights_); - static const std::int32_t ID = 82243562; + static const std::int32_t ID = -70024163; std::int32_t get_id() const final { return ID; } @@ -3504,6 +4197,8 @@ class chatMemberStatusBanned final : public ChatMemberStatus { void store(TlStorerToString &s, const char *field_name) const final; }; +class chatMember; + class chatMembers final : public Object { public: int32 total_count_; @@ -3619,6 +4314,43 @@ class chatMembersFilterBots final : public ChatMembersFilter { void store(TlStorerToString &s, const char *field_name) const final; }; +class MessageSender; + +class chatMessageSender final : public Object { + public: + object_ptr sender_; + bool needs_premium_; + + chatMessageSender(); + + chatMessageSender(object_ptr &&sender_, bool needs_premium_); + + static const std::int32_t ID = 760590010; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatMessageSender; + +class chatMessageSenders final : public Object { + public: + array> senders_; + + chatMessageSenders(); + + explicit chatMessageSenders(array> &&senders_); + + static const std::int32_t ID = -1866230970; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + class chatNearby final : public Object { public: int53 chat_id_; @@ -3641,9 +4373,15 @@ class chatNotificationSettings final : public Object { bool use_default_mute_for_; int32 mute_for_; bool use_default_sound_; - string sound_; + int64 sound_id_; bool use_default_show_preview_; bool show_preview_; + bool use_default_mute_stories_; + bool mute_stories_; + bool use_default_story_sound_; + int64 story_sound_id_; + bool use_default_show_story_sender_; + bool show_story_sender_; bool use_default_disable_pinned_message_notifications_; bool disable_pinned_message_notifications_; bool use_default_disable_mention_notifications_; @@ -3651,9 +4389,9 @@ class chatNotificationSettings final : public Object { chatNotificationSettings(); - chatNotificationSettings(bool use_default_mute_for_, int32 mute_for_, bool use_default_sound_, string const &sound_, bool use_default_show_preview_, bool show_preview_, bool use_default_disable_pinned_message_notifications_, bool disable_pinned_message_notifications_, bool use_default_disable_mention_notifications_, bool disable_mention_notifications_); + chatNotificationSettings(bool use_default_mute_for_, int32 mute_for_, bool use_default_sound_, int64 sound_id_, bool use_default_show_preview_, bool show_preview_, bool use_default_mute_stories_, bool mute_stories_, bool use_default_story_sound_, int64 story_sound_id_, bool use_default_show_story_sender_, bool show_story_sender_, bool use_default_disable_pinned_message_notifications_, bool disable_pinned_message_notifications_, bool use_default_disable_mention_notifications_, bool disable_mention_notifications_); - static const std::int32_t ID = 1503183218; + static const std::int32_t ID = -572779825; std::int32_t get_id() const final { return ID; } @@ -3663,20 +4401,26 @@ class chatNotificationSettings final : public Object { class chatPermissions final : public Object { public: - bool can_send_messages_; - bool can_send_media_messages_; + bool can_send_basic_messages_; + bool can_send_audios_; + bool can_send_documents_; + bool can_send_photos_; + bool can_send_videos_; + bool can_send_video_notes_; + bool can_send_voice_notes_; bool can_send_polls_; bool can_send_other_messages_; bool can_add_web_page_previews_; bool can_change_info_; bool can_invite_users_; bool can_pin_messages_; + bool can_manage_topics_; chatPermissions(); - chatPermissions(bool can_send_messages_, bool can_send_media_messages_, bool can_send_polls_, bool can_send_other_messages_, bool can_add_web_page_previews_, bool can_change_info_, bool can_invite_users_, bool can_pin_messages_); + chatPermissions(bool can_send_basic_messages_, bool can_send_audios_, bool can_send_documents_, bool can_send_photos_, bool can_send_videos_, bool can_send_video_notes_, bool can_send_voice_notes_, bool can_send_polls_, bool can_send_other_messages_, bool can_add_web_page_previews_, bool can_change_info_, bool can_invite_users_, bool can_pin_messages_, bool can_manage_topics_); - static const std::int32_t ID = 1584650463; + static const std::int32_t ID = -1355062837; std::int32_t get_id() const final { return ID; } @@ -3684,6 +4428,14 @@ class chatPermissions final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class animatedChatPhoto; + +class chatPhotoSticker; + +class minithumbnail; + +class photoSize; + class chatPhoto final : public Object { public: int64 id_; @@ -3691,12 +4443,14 @@ class chatPhoto final : public Object { object_ptr minithumbnail_; array> sizes_; object_ptr animation_; + object_ptr small_animation_; + object_ptr sticker_; chatPhoto(); - chatPhoto(int64 id_, int32 added_date_, object_ptr &&minithumbnail_, array> &&sizes_, object_ptr &&animation_); + chatPhoto(int64 id_, int32 added_date_, object_ptr &&minithumbnail_, array> &&sizes_, object_ptr &&animation_, object_ptr &&small_animation_, object_ptr &&sticker_); - static const std::int32_t ID = -113003577; + static const std::int32_t ID = -1430870201; std::int32_t get_id() const final { return ID; } @@ -3704,18 +4458,23 @@ class chatPhoto final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class file; + +class minithumbnail; + class chatPhotoInfo final : public Object { public: object_ptr small_; object_ptr big_; object_ptr minithumbnail_; bool has_animation_; + bool is_personal_; chatPhotoInfo(); - chatPhotoInfo(object_ptr &&small_, object_ptr &&big_, object_ptr &&minithumbnail_, bool has_animation_); + chatPhotoInfo(object_ptr &&small_, object_ptr &&big_, object_ptr &&minithumbnail_, bool has_animation_, bool is_personal_); - static const std::int32_t ID = 167058358; + static const std::int32_t ID = 281195686; std::int32_t get_id() const final { return ID; } @@ -3723,6 +4482,66 @@ class chatPhotoInfo final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class BackgroundFill; + +class ChatPhotoStickerType; + +class chatPhotoSticker final : public Object { + public: + object_ptr type_; + object_ptr background_fill_; + + chatPhotoSticker(); + + chatPhotoSticker(object_ptr &&type_, object_ptr &&background_fill_); + + static const std::int32_t ID = -1459387485; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class ChatPhotoStickerType: public Object { + public: +}; + +class chatPhotoStickerTypeRegularOrMask final : public ChatPhotoStickerType { + public: + int64 sticker_set_id_; + int64 sticker_id_; + + chatPhotoStickerTypeRegularOrMask(); + + chatPhotoStickerTypeRegularOrMask(int64 sticker_set_id_, int64 sticker_id_); + + static const std::int32_t ID = -415147620; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatPhotoStickerTypeCustomEmoji final : public ChatPhotoStickerType { + public: + int64 custom_emoji_id_; + + chatPhotoStickerTypeCustomEmoji(); + + explicit chatPhotoStickerTypeCustomEmoji(int64 custom_emoji_id_); + + static const std::int32_t ID = -266224943; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatPhoto; + class chatPhotos final : public Object { public: int32 total_count_; @@ -3740,6 +4559,10 @@ class chatPhotos final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class ChatList; + +class ChatSource; + class chatPosition final : public Object { public: object_ptr list_; @@ -3759,114 +4582,6 @@ class chatPosition final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; -class ChatReportReason: public Object { - public: -}; - -class chatReportReasonSpam final : public ChatReportReason { - public: - - chatReportReasonSpam(); - - static const std::int32_t ID = -510848863; - std::int32_t get_id() const final { - return ID; - } - - void store(TlStorerToString &s, const char *field_name) const final; -}; - -class chatReportReasonViolence final : public ChatReportReason { - public: - - chatReportReasonViolence(); - - static const std::int32_t ID = -1330235395; - std::int32_t get_id() const final { - return ID; - } - - void store(TlStorerToString &s, const char *field_name) const final; -}; - -class chatReportReasonPornography final : public ChatReportReason { - public: - - chatReportReasonPornography(); - - static const std::int32_t ID = 722614385; - std::int32_t get_id() const final { - return ID; - } - - void store(TlStorerToString &s, const char *field_name) const final; -}; - -class chatReportReasonChildAbuse final : public ChatReportReason { - public: - - chatReportReasonChildAbuse(); - - static const std::int32_t ID = -1070686531; - std::int32_t get_id() const final { - return ID; - } - - void store(TlStorerToString &s, const char *field_name) const final; -}; - -class chatReportReasonCopyright final : public ChatReportReason { - public: - - chatReportReasonCopyright(); - - static const std::int32_t ID = 986898080; - std::int32_t get_id() const final { - return ID; - } - - void store(TlStorerToString &s, const char *field_name) const final; -}; - -class chatReportReasonUnrelatedLocation final : public ChatReportReason { - public: - - chatReportReasonUnrelatedLocation(); - - static const std::int32_t ID = 2632403; - std::int32_t get_id() const final { - return ID; - } - - void store(TlStorerToString &s, const char *field_name) const final; -}; - -class chatReportReasonFake final : public ChatReportReason { - public: - - chatReportReasonFake(); - - static const std::int32_t ID = -1713230446; - std::int32_t get_id() const final { - return ID; - } - - void store(TlStorerToString &s, const char *field_name) const final; -}; - -class chatReportReasonCustom final : public ChatReportReason { - public: - - chatReportReasonCustom(); - - static const std::int32_t ID = 1288925974; - std::int32_t get_id() const final { - return ID; - } - - void store(TlStorerToString &s, const char *field_name) const final; -}; - class ChatSource: public Object { public: }; @@ -3901,6 +4616,20 @@ class chatSourcePublicServiceAnnouncement final : public ChatSource { void store(TlStorerToString &s, const char *field_name) const final; }; +class StatisticalGraph; + +class chatStatisticsAdministratorActionsInfo; + +class chatStatisticsInviterInfo; + +class chatStatisticsMessageInteractionInfo; + +class chatStatisticsMessageSenderInfo; + +class dateRange; + +class statisticalValue; + class ChatStatistics: public Object { public: }; @@ -4038,6 +4767,8 @@ class chatStatisticsMessageSenderInfo final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class themeSettings; + class chatTheme final : public Object { public: string name_; @@ -4143,6 +4874,8 @@ class chats final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class chatNearby; + class chatsNearby final : public Object { public: array> users_nearby_; @@ -4203,12 +4936,25 @@ class checkChatUsernameResultUsernameOccupied final : public CheckChatUsernameRe void store(TlStorerToString &s, const char *field_name) const final; }; -class checkChatUsernameResultPublicChatsTooMuch final : public CheckChatUsernameResult { +class checkChatUsernameResultUsernamePurchasable final : public CheckChatUsernameResult { public: - checkChatUsernameResultPublicChatsTooMuch(); + checkChatUsernameResultUsernamePurchasable(); - static const std::int32_t ID = 858247741; + static const std::int32_t ID = 5885529; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class checkChatUsernameResultPublicChatsTooMany final : public CheckChatUsernameResult { + public: + + checkChatUsernameResultPublicChatsTooMany(); + + static const std::int32_t ID = -659264388; std::int32_t get_id() const final { return ID; } @@ -4272,6 +5018,8 @@ class checkStickerSetNameResultNameOccupied final : public CheckStickerSetNameRe void store(TlStorerToString &s, const char *field_name) const final; }; +class VectorPathCommand; + class closedVectorPath final : public Object { public: array> commands_; @@ -4297,14 +5045,14 @@ class connectedWebsite final : public Object { string platform_; int32 log_in_date_; int32 last_active_date_; - string ip_; + string ip_address_; string location_; connectedWebsite(); - connectedWebsite(int64 id_, string const &domain_name_, int53 bot_user_id_, string const &browser_, string const &platform_, int32 log_in_date_, int32 last_active_date_, string const &ip_, string const &location_); + connectedWebsite(int64 id_, string const &domain_name_, int53 bot_user_id_, string const &browser_, string const &platform_, int32 log_in_date_, int32 last_active_date_, string const &ip_address_, string const &location_); - static const std::int32_t ID = 844014445; + static const std::int32_t ID = 1978115978; std::int32_t get_id() const final { return ID; } @@ -4312,6 +5060,8 @@ class connectedWebsite final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class connectedWebsite; + class connectedWebsites final : public Object { public: array> websites_; @@ -4433,6 +5183,8 @@ class count final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class countryInfo; + class countries final : public Object { public: array> countries_; @@ -4536,6 +5288,8 @@ class dateRange final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class file; + class datedFile final : public Object { public: object_ptr file_; @@ -4553,6 +5307,8 @@ class datedFile final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class formattedText; + class deepLinkInfo final : public Object { public: object_ptr text_; @@ -4756,6 +5512,25 @@ class deviceTokenTizenPush final : public DeviceToken { void store(TlStorerToString &s, const char *field_name) const final; }; +class deviceTokenHuaweiPush final : public DeviceToken { + public: + string token_; + bool encrypt_; + + deviceTokenHuaweiPush(); + + deviceTokenHuaweiPush(string const &token_, bool encrypt_); + + static const std::int32_t ID = 1989103142; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class sticker; + class DiceStickers: public Object { public: }; @@ -4796,6 +5571,12 @@ class diceStickersSlotMachine final : public DiceStickers { void store(TlStorerToString &s, const char *field_name) const final; }; +class file; + +class minithumbnail; + +class thumbnail; + class document final : public Object { public: string file_name_; @@ -4816,17 +5597,91 @@ class document final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class downloadedFileCounts final : public Object { + public: + int32 active_count_; + int32 paused_count_; + int32 completed_count_; + + downloadedFileCounts(); + + downloadedFileCounts(int32 active_count_, int32 paused_count_, int32 completed_count_); + + static const std::int32_t ID = -1973999550; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class InputMessageContent; + +class InputMessageReplyTo; + class draftMessage final : public Object { public: - int53 reply_to_message_id_; + object_ptr reply_to_; int32 date_; object_ptr input_message_text_; draftMessage(); - draftMessage(int53 reply_to_message_id_, int32 date_, object_ptr &&input_message_text_); + draftMessage(object_ptr &&reply_to_, int32 date_, object_ptr &&input_message_text_); - static const std::int32_t ID = 1373050112; + static const std::int32_t ID = -159618468; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class EmailAddressAuthentication: public Object { + public: +}; + +class emailAddressAuthenticationCode final : public EmailAddressAuthentication { + public: + string code_; + + emailAddressAuthenticationCode(); + + explicit emailAddressAuthenticationCode(string const &code_); + + static const std::int32_t ID = -993257022; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class emailAddressAuthenticationAppleId final : public EmailAddressAuthentication { + public: + string token_; + + emailAddressAuthenticationAppleId(); + + explicit emailAddressAuthenticationAppleId(string const &token_); + + static const std::int32_t ID = 633948265; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class emailAddressAuthenticationGoogleId final : public EmailAddressAuthentication { + public: + string token_; + + emailAddressAuthenticationGoogleId(); + + explicit emailAddressAuthenticationGoogleId(string const &token_); + + static const std::int32_t ID = -19142846; std::int32_t get_id() const final { return ID; } @@ -4851,6 +5706,183 @@ class emailAddressAuthenticationCodeInfo final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class EmailAddressResetState: public Object { + public: +}; + +class emailAddressResetStateAvailable final : public EmailAddressResetState { + public: + int32 wait_period_; + + emailAddressResetStateAvailable(); + + explicit emailAddressResetStateAvailable(int32 wait_period_); + + static const std::int32_t ID = -1917177600; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class emailAddressResetStatePending final : public EmailAddressResetState { + public: + int32 reset_in_; + + emailAddressResetStatePending(); + + explicit emailAddressResetStatePending(int32 reset_in_); + + static const std::int32_t ID = -1885966805; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class emojiCategory; + +class emojiCategories final : public Object { + public: + array> categories_; + + emojiCategories(); + + explicit emojiCategories(array> &&categories_); + + static const std::int32_t ID = -1455387824; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class sticker; + +class emojiCategory final : public Object { + public: + string name_; + object_ptr icon_; + array emojis_; + + emojiCategory(); + + emojiCategory(string const &name_, object_ptr &&icon_, array &&emojis_); + + static const std::int32_t ID = 1019393600; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class EmojiCategoryType: public Object { + public: +}; + +class emojiCategoryTypeDefault final : public EmojiCategoryType { + public: + + emojiCategoryTypeDefault(); + + static const std::int32_t ID = 1188782699; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class emojiCategoryTypeEmojiStatus final : public EmojiCategoryType { + public: + + emojiCategoryTypeEmojiStatus(); + + static const std::int32_t ID = 1381282631; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class emojiCategoryTypeChatPhoto final : public EmojiCategoryType { + public: + + emojiCategoryTypeChatPhoto(); + + static const std::int32_t ID = 1059063081; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class sticker; + +class emojiReaction final : public Object { + public: + string emoji_; + string title_; + bool is_active_; + object_ptr static_icon_; + object_ptr appear_animation_; + object_ptr select_animation_; + object_ptr activate_animation_; + object_ptr effect_animation_; + object_ptr around_animation_; + object_ptr center_animation_; + + emojiReaction(); + + emojiReaction(string const &emoji_, string const &title_, bool is_active_, object_ptr &&static_icon_, object_ptr &&appear_animation_, object_ptr &&select_animation_, object_ptr &&activate_animation_, object_ptr &&effect_animation_, object_ptr &&around_animation_, object_ptr &¢er_animation_); + + static const std::int32_t ID = 1616063583; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class emojiStatus final : public Object { + public: + int64 custom_emoji_id_; + int32 expiration_date_; + + emojiStatus(); + + emojiStatus(int64 custom_emoji_id_, int32 expiration_date_); + + static const std::int32_t ID = -606529994; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class emojiStatuses final : public Object { + public: + array custom_emoji_ids_; + + emojiStatuses(); + + explicit emojiStatuses(array &&custom_emoji_ids_); + + static const std::int32_t ID = -377859594; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + class emojis final : public Object { public: array emojis_; @@ -4885,6 +5917,10 @@ class encryptedCredentials final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class PassportElementType; + +class datedFile; + class encryptedPassportElement final : public Object { public: object_ptr type_; @@ -4926,19 +5962,61 @@ class error final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class localFile; + +class remoteFile; + class file final : public Object { public: int32 id_; - int32 size_; - int32 expected_size_; + int53 size_; + int53 expected_size_; object_ptr local_; object_ptr remote_; file(); - file(int32 id_, int32 size_, int32 expected_size_, object_ptr &&local_, object_ptr &&remote_); + file(int32 id_, int53 size_, int53 expected_size_, object_ptr &&local_, object_ptr &&remote_); - static const std::int32_t ID = 766337656; + static const std::int32_t ID = 1263291956; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class message; + +class fileDownload final : public Object { + public: + int32 file_id_; + object_ptr message_; + int32 add_date_; + int32 complete_date_; + bool is_paused_; + + fileDownload(); + + fileDownload(int32 file_id_, object_ptr &&message_, int32 add_date_, int32 complete_date_, bool is_paused_); + + static const std::int32_t ID = -2092100780; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class fileDownloadedPrefixSize final : public Object { + public: + int53 size_; + + fileDownloadedPrefixSize(); + + explicit fileDownloadedPrefixSize(int53 size_); + + static const std::int32_t ID = -2015205381; std::int32_t get_id() const final { return ID; } @@ -5018,6 +6096,19 @@ class fileTypeDocument final : public FileType { void store(TlStorerToString &s, const char *field_name) const final; }; +class fileTypeNotificationSound final : public FileType { + public: + + fileTypeNotificationSound(); + + static const std::int32_t ID = -1020289271; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + class fileTypePhoto final : public FileType { public: @@ -5031,6 +6122,19 @@ class fileTypePhoto final : public FileType { void store(TlStorerToString &s, const char *field_name) const final; }; +class fileTypePhotoStory final : public FileType { + public: + + fileTypePhotoStory(); + + static const std::int32_t ID = 2018995956; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + class fileTypeProfilePhoto final : public FileType { public: @@ -5148,6 +6252,19 @@ class fileTypeVideoNote final : public FileType { void store(TlStorerToString &s, const char *field_name) const final; }; +class fileTypeVideoStory final : public FileType { + public: + + fileTypeVideoStory(); + + static const std::int32_t ID = -2146754143; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + class fileTypeVoiceNote final : public FileType { public: @@ -5174,6 +6291,42 @@ class fileTypeWallpaper final : public FileType { void store(TlStorerToString &s, const char *field_name) const final; }; +class FirebaseAuthenticationSettings: public Object { + public: +}; + +class firebaseAuthenticationSettingsAndroid final : public FirebaseAuthenticationSettings { + public: + + firebaseAuthenticationSettingsAndroid(); + + static const std::int32_t ID = -1771112932; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class firebaseAuthenticationSettingsIos final : public FirebaseAuthenticationSettings { + public: + string device_token_; + bool is_app_sandbox_; + + firebaseAuthenticationSettingsIos(); + + firebaseAuthenticationSettingsIos(string const &device_token_, bool is_app_sandbox_); + + static const std::int32_t ID = 222930116; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class textEntity; + class formattedText final : public Object { public: string text_; @@ -5191,6 +6344,170 @@ class formattedText final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class chatNotificationSettings; + +class draftMessage; + +class forumTopicInfo; + +class message; + +class forumTopic final : public Object { + public: + object_ptr info_; + object_ptr last_message_; + bool is_pinned_; + int32 unread_count_; + int53 last_read_inbox_message_id_; + int53 last_read_outbox_message_id_; + int32 unread_mention_count_; + int32 unread_reaction_count_; + object_ptr notification_settings_; + object_ptr draft_message_; + + forumTopic(); + + forumTopic(object_ptr &&info_, object_ptr &&last_message_, bool is_pinned_, int32 unread_count_, int53 last_read_inbox_message_id_, int53 last_read_outbox_message_id_, int32 unread_mention_count_, int32 unread_reaction_count_, object_ptr &¬ification_settings_, object_ptr &&draft_message_); + + static const std::int32_t ID = 303279334; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class forumTopicIcon final : public Object { + public: + int32 color_; + int64 custom_emoji_id_; + + forumTopicIcon(); + + forumTopicIcon(int32 color_, int64 custom_emoji_id_); + + static const std::int32_t ID = -818765421; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class MessageSender; + +class forumTopicIcon; + +class forumTopicInfo final : public Object { + public: + int53 message_thread_id_; + string name_; + object_ptr icon_; + int32 creation_date_; + object_ptr creator_id_; + bool is_general_; + bool is_outgoing_; + bool is_closed_; + bool is_hidden_; + + forumTopicInfo(); + + forumTopicInfo(int53 message_thread_id_, string const &name_, object_ptr &&icon_, int32 creation_date_, object_ptr &&creator_id_, bool is_general_, bool is_outgoing_, bool is_closed_, bool is_hidden_); + + static const std::int32_t ID = -1879842914; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class forumTopic; + +class forumTopics final : public Object { + public: + int32 total_count_; + array> topics_; + int32 next_offset_date_; + int53 next_offset_message_id_; + int53 next_offset_message_thread_id_; + + forumTopics(); + + forumTopics(int32 total_count_, array> &&topics_, int32 next_offset_date_, int53 next_offset_message_id_, int53 next_offset_message_thread_id_); + + static const std::int32_t ID = 732819537; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class chatBoost; + +class foundChatBoosts final : public Object { + public: + int32 total_count_; + array> boosts_; + string next_offset_; + + foundChatBoosts(); + + foundChatBoosts(int32 total_count_, array> &&boosts_, string const &next_offset_); + + static const std::int32_t ID = 51457680; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class message; + +class foundChatMessages final : public Object { + public: + int32 total_count_; + array> messages_; + int53 next_from_message_id_; + + foundChatMessages(); + + foundChatMessages(int32 total_count_, array> &&messages_, int53 next_from_message_id_); + + static const std::int32_t ID = 427484196; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class downloadedFileCounts; + +class fileDownload; + +class foundFileDownloads final : public Object { + public: + object_ptr total_counts_; + array> files_; + string next_offset_; + + foundFileDownloads(); + + foundFileDownloads(object_ptr &&total_counts_, array> &&files_, string const &next_offset_); + + static const std::int32_t ID = 1395890392; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class message; + class foundMessages final : public Object { public: int32 total_count_; @@ -5209,6 +6526,65 @@ class foundMessages final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class foundPosition final : public Object { + public: + int32 position_; + + foundPosition(); + + explicit foundPosition(int32 position_); + + static const std::int32_t ID = -1886724216; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class foundPositions final : public Object { + public: + int32 total_count_; + array positions_; + + foundPositions(); + + foundPositions(int32 total_count_, array &&positions_); + + static const std::int32_t ID = -80518368; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class webApp; + +class foundWebApp final : public Object { + public: + object_ptr web_app_; + bool request_write_access_; + bool skip_confirmation_; + + foundWebApp(); + + foundWebApp(object_ptr &&web_app_, bool request_write_access_, bool skip_confirmation_); + + static const std::int32_t ID = -290926562; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class animation; + +class formattedText; + +class photo; + class game final : public Object { public: int64 id_; @@ -5249,6 +6625,8 @@ class gameHighScore final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class gameHighScore; + class gameHighScores final : public Object { public: array> scores_; @@ -5265,6 +6643,8 @@ class gameHighScores final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class groupCallRecentSpeaker; + class groupCall final : public Object { public: int32 id_; @@ -5272,10 +6652,12 @@ class groupCall final : public Object { int32 scheduled_start_date_; bool enabled_start_notification_; bool is_active_; + bool is_rtmp_stream_; bool is_joined_; bool need_rejoin_; bool can_be_managed_; int32 participant_count_; + bool has_hidden_listeners_; bool loaded_all_participants_; array> recent_speakers_; bool is_my_video_enabled_; @@ -5289,9 +6671,9 @@ class groupCall final : public Object { groupCall(); - groupCall(int32 id_, string const &title_, int32 scheduled_start_date_, bool enabled_start_notification_, bool is_active_, bool is_joined_, bool need_rejoin_, bool can_be_managed_, int32 participant_count_, bool loaded_all_participants_, array> &&recent_speakers_, bool is_my_video_enabled_, bool is_my_video_paused_, bool can_enable_video_, bool mute_new_participants_, bool can_toggle_mute_new_participants_, int32 record_duration_, bool is_video_recorded_, int32 duration_); + groupCall(int32 id_, string const &title_, int32 scheduled_start_date_, bool enabled_start_notification_, bool is_active_, bool is_rtmp_stream_, bool is_joined_, bool need_rejoin_, bool can_be_managed_, int32 participant_count_, bool has_hidden_listeners_, bool loaded_all_participants_, array> &&recent_speakers_, bool is_my_video_enabled_, bool is_my_video_paused_, bool can_enable_video_, bool mute_new_participants_, bool can_toggle_mute_new_participants_, int32 record_duration_, bool is_video_recorded_, int32 duration_); - static const std::int32_t ID = 1548892209; + static const std::int32_t ID = -123443355; std::int32_t get_id() const final { return ID; } @@ -5315,6 +6697,10 @@ class groupCallId final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class MessageSender; + +class groupCallParticipantVideoInfo; + class groupCallParticipant final : public Object { public: object_ptr participant_id_; @@ -5348,6 +6734,8 @@ class groupCallParticipant final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class groupCallVideoSourceGroup; + class groupCallParticipantVideoInfo final : public Object { public: array> source_groups_; @@ -5366,6 +6754,8 @@ class groupCallParticipantVideoInfo final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class MessageSender; + class groupCallRecentSpeaker final : public Object { public: object_ptr participant_id_; @@ -5383,6 +6773,42 @@ class groupCallRecentSpeaker final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class groupCallStream final : public Object { + public: + int32 channel_id_; + int32 scale_; + int53 time_offset_; + + groupCallStream(); + + groupCallStream(int32 channel_id_, int32 scale_, int53 time_offset_); + + static const std::int32_t ID = -264564795; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class groupCallStream; + +class groupCallStreams final : public Object { + public: + array> streams_; + + groupCallStreams(); + + explicit groupCallStreams(array> &&streams_); + + static const std::int32_t ID = -1032959578; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + class GroupCallVideoQuality: public Object { public: }; @@ -5475,10 +6901,14 @@ class httpUrl final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class date; + +class datedFile; + class identityDocument final : public Object { public: string number_; - object_ptr expiry_date_; + object_ptr expiration_date_; object_ptr front_side_; object_ptr reverse_side_; object_ptr selfie_; @@ -5486,9 +6916,9 @@ class identityDocument final : public Object { identityDocument(); - identityDocument(string const &number_, object_ptr &&expiry_date_, object_ptr &&front_side_, object_ptr &&reverse_side_, object_ptr &&selfie_, array> &&translation_); + identityDocument(string const &number_, object_ptr &&expiration_date_, object_ptr &&front_side_, object_ptr &&reverse_side_, object_ptr &&selfie_, array> &&translation_); - static const std::int32_t ID = 445952972; + static const std::int32_t ID = 1001703606; std::int32_t get_id() const final { return ID; } @@ -5513,6 +6943,8 @@ class importedContacts final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class InlineKeyboardButtonType; + class inlineKeyboardButton final : public Object { public: string text_; @@ -5530,6 +6962,8 @@ class inlineKeyboardButton final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class TargetChat; + class InlineKeyboardButtonType: public Object { public: }; @@ -5568,6 +7002,22 @@ class inlineKeyboardButtonTypeLoginUrl final : public InlineKeyboardButtonType { void store(TlStorerToString &s, const char *field_name) const final; }; +class inlineKeyboardButtonTypeWebApp final : public InlineKeyboardButtonType { + public: + string url_; + + inlineKeyboardButtonTypeWebApp(); + + explicit inlineKeyboardButtonTypeWebApp(string const &url_); + + static const std::int32_t ID = -1767471672; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + class inlineKeyboardButtonTypeCallback final : public InlineKeyboardButtonType { public: bytes data_; @@ -5616,13 +7066,13 @@ class inlineKeyboardButtonTypeCallbackGame final : public InlineKeyboardButtonTy class inlineKeyboardButtonTypeSwitchInline final : public InlineKeyboardButtonType { public: string query_; - bool in_current_chat_; + object_ptr target_chat_; inlineKeyboardButtonTypeSwitchInline(); - inlineKeyboardButtonTypeSwitchInline(string const &query_, bool in_current_chat_); + inlineKeyboardButtonTypeSwitchInline(string const &query_, object_ptr &&target_chat_); - static const std::int32_t ID = -2035563307; + static const std::int32_t ID = 544906485; std::int32_t get_id() const final { return ID; } @@ -5659,6 +7109,30 @@ class inlineKeyboardButtonTypeUser final : public InlineKeyboardButtonType { void store(TlStorerToString &s, const char *field_name) const final; }; +class animation; + +class audio; + +class contact; + +class document; + +class game; + +class location; + +class photo; + +class sticker; + +class thumbnail; + +class venue; + +class video; + +class voiceNote; + class InlineQueryResult: public Object { public: }; @@ -5883,19 +7357,22 @@ class inlineQueryResultVoiceNote final : public InlineQueryResult { void store(TlStorerToString &s, const char *field_name) const final; }; +class InlineQueryResult; + +class inlineQueryResultsButton; + class inlineQueryResults final : public Object { public: int64 inline_query_id_; - string next_offset_; + object_ptr button_; array> results_; - string switch_pm_text_; - string switch_pm_parameter_; + string next_offset_; inlineQueryResults(); - inlineQueryResults(int64 inline_query_id_, string const &next_offset_, array> &&results_, string const &switch_pm_text_, string const &switch_pm_parameter_); + inlineQueryResults(int64 inline_query_id_, object_ptr &&button_, array> &&results_, string const &next_offset_); - static const std::int32_t ID = 1000709656; + static const std::int32_t ID = 1830685615; std::int32_t get_id() const final { return ID; } @@ -5903,6 +7380,63 @@ class inlineQueryResults final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class InlineQueryResultsButtonType; + +class inlineQueryResultsButton final : public Object { + public: + string text_; + object_ptr type_; + + inlineQueryResultsButton(); + + inlineQueryResultsButton(string const &text_, object_ptr &&type_); + + static const std::int32_t ID = -790689618; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class InlineQueryResultsButtonType: public Object { + public: +}; + +class inlineQueryResultsButtonTypeStartBot final : public InlineQueryResultsButtonType { + public: + string parameter_; + + inlineQueryResultsButtonTypeStartBot(); + + explicit inlineQueryResultsButtonTypeStartBot(string const ¶meter_); + + static const std::int32_t ID = -23400235; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class inlineQueryResultsButtonTypeWebApp final : public InlineQueryResultsButtonType { + public: + string url_; + + inlineQueryResultsButtonTypeWebApp(); + + explicit inlineQueryResultsButtonTypeWebApp(string const &url_); + + static const std::int32_t ID = -1197382814; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class InputFile; + class InputBackground: public Object { public: }; @@ -5939,6 +7473,26 @@ class inputBackgroundRemote final : public InputBackground { void store(TlStorerToString &s, const char *field_name) const final; }; +class inputBackgroundPrevious final : public InputBackground { + public: + int53 message_id_; + + inputBackgroundPrevious(); + + explicit inputBackgroundPrevious(int53 message_id_); + + static const std::int32_t ID = -351905954; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class InputFile; + +class chatPhotoSticker; + class InputChatPhoto: public Object { public: }; @@ -5992,6 +7546,22 @@ class inputChatPhotoAnimation final : public InputChatPhoto { void store(TlStorerToString &s, const char *field_name) const final; }; +class inputChatPhotoSticker final : public InputChatPhoto { + public: + object_ptr sticker_; + + inputChatPhotoSticker(); + + explicit inputChatPhotoSticker(object_ptr &&sticker_); + + static const std::int32_t ID = 1315861341; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + class InputCredentials: public Object { public: }; @@ -6117,13 +7687,13 @@ class inputFileGenerated final : public InputFile { public: string original_path_; string conversion_; - int32 expected_size_; + int53 expected_size_; inputFileGenerated(); - inputFileGenerated(string const &original_path_, string const &conversion_, int32 expected_size_); + inputFileGenerated(string const &original_path_, string const &conversion_, int53 expected_size_); - static const std::int32_t ID = -1781351885; + static const std::int32_t ID = -1333385216; std::int32_t get_id() const final { return ID; } @@ -6131,10 +7701,14 @@ class inputFileGenerated final : public InputFile { void store(TlStorerToString &s, const char *field_name) const final; }; +class InputFile; + +class date; + class inputIdentityDocument final : public Object { public: string number_; - object_ptr expiry_date_; + object_ptr expiration_date_; object_ptr front_side_; object_ptr reverse_side_; object_ptr selfie_; @@ -6142,9 +7716,9 @@ class inputIdentityDocument final : public Object { inputIdentityDocument(); - inputIdentityDocument(string const &number_, object_ptr &&expiry_date_, object_ptr &&front_side_, object_ptr &&reverse_side_, object_ptr &&selfie_, array> &&translation_); + inputIdentityDocument(string const &number_, object_ptr &&expiration_date_, object_ptr &&front_side_, object_ptr &&reverse_side_, object_ptr &&selfie_, array> &&translation_); - static const std::int32_t ID = -381776063; + static const std::int32_t ID = 767353688; std::int32_t get_id() const final { return ID; } @@ -6152,6 +7726,16 @@ class inputIdentityDocument final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class InputMessageContent; + +class ReplyMarkup; + +class contact; + +class location; + +class venue; + class InputInlineQueryResult: public Object { public: }; @@ -6433,6 +8017,85 @@ class inputInlineQueryResultVoiceNote final : public InputInlineQueryResult { void store(TlStorerToString &s, const char *field_name) const final; }; +class TelegramPaymentPurpose; + +class InputInvoice: public Object { + public: +}; + +class inputInvoiceMessage final : public InputInvoice { + public: + int53 chat_id_; + int53 message_id_; + + inputInvoiceMessage(); + + inputInvoiceMessage(int53 chat_id_, int53 message_id_); + + static const std::int32_t ID = 1490872848; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class inputInvoiceName final : public InputInvoice { + public: + string name_; + + inputInvoiceName(); + + explicit inputInvoiceName(string const &name_); + + static const std::int32_t ID = -1312155917; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class inputInvoiceTelegram final : public InputInvoice { + public: + object_ptr purpose_; + + inputInvoiceTelegram(); + + explicit inputInvoiceTelegram(object_ptr &&purpose_); + + static const std::int32_t ID = -1762853139; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class InputFile; + +class InputMessageContent; + +class MessageSelfDestructType; + +class PollType; + +class contact; + +class formattedText; + +class inputThumbnail; + +class invoice; + +class linkPreviewOptions; + +class location; + +class messageCopyOptions; + +class venue; + class InputMessageContent: public Object { public: }; @@ -6440,14 +8103,14 @@ class InputMessageContent: public Object { class inputMessageText final : public InputMessageContent { public: object_ptr text_; - bool disable_web_page_preview_; + object_ptr link_preview_options_; bool clear_draft_; inputMessageText(); - inputMessageText(object_ptr &&text_, bool disable_web_page_preview_, bool clear_draft_); + inputMessageText(object_ptr &&text_, object_ptr &&link_preview_options_, bool clear_draft_); - static const std::int32_t ID = 247050392; + static const std::int32_t ID = -212805484; std::int32_t get_id() const final { return ID; } @@ -6464,12 +8127,13 @@ class inputMessageAnimation final : public InputMessageContent { int32 width_; int32 height_; object_ptr caption_; + bool has_spoiler_; inputMessageAnimation(); - inputMessageAnimation(object_ptr &&animation_, object_ptr &&thumbnail_, array &&added_sticker_file_ids_, int32 duration_, int32 width_, int32 height_, object_ptr &&caption_); + inputMessageAnimation(object_ptr &&animation_, object_ptr &&thumbnail_, array &&added_sticker_file_ids_, int32 duration_, int32 width_, int32 height_, object_ptr &&caption_, bool has_spoiler_); - static const std::int32_t ID = 1208433535; + static const std::int32_t ID = 850750601; std::int32_t get_id() const final { return ID; } @@ -6525,13 +8189,14 @@ class inputMessagePhoto final : public InputMessageContent { int32 width_; int32 height_; object_ptr caption_; - int32 ttl_; + object_ptr self_destruct_type_; + bool has_spoiler_; inputMessagePhoto(); - inputMessagePhoto(object_ptr &&photo_, object_ptr &&thumbnail_, array &&added_sticker_file_ids_, int32 width_, int32 height_, object_ptr &&caption_, int32 ttl_); + inputMessagePhoto(object_ptr &&photo_, object_ptr &&thumbnail_, array &&added_sticker_file_ids_, int32 width_, int32 height_, object_ptr &&caption_, object_ptr &&self_destruct_type_, bool has_spoiler_); - static const std::int32_t ID = 1648801584; + static const std::int32_t ID = -1460959289; std::int32_t get_id() const final { return ID; } @@ -6569,13 +8234,14 @@ class inputMessageVideo final : public InputMessageContent { int32 height_; bool supports_streaming_; object_ptr caption_; - int32 ttl_; + object_ptr self_destruct_type_; + bool has_spoiler_; inputMessageVideo(); - inputMessageVideo(object_ptr &&video_, object_ptr &&thumbnail_, array &&added_sticker_file_ids_, int32 duration_, int32 width_, int32 height_, bool supports_streaming_, object_ptr &&caption_, int32 ttl_); + inputMessageVideo(object_ptr &&video_, object_ptr &&thumbnail_, array &&added_sticker_file_ids_, int32 duration_, int32 width_, int32 height_, bool supports_streaming_, object_ptr &&caption_, object_ptr &&self_destruct_type_, bool has_spoiler_); - static const std::int32_t ID = -2108486755; + static const std::int32_t ID = 1914220652; std::int32_t get_id() const final { return ID; } @@ -6719,12 +8385,13 @@ class inputMessageInvoice final : public InputMessageContent { string provider_token_; string provider_data_; string start_parameter_; + object_ptr extended_media_content_; inputMessageInvoice(); - inputMessageInvoice(object_ptr &&invoice_, string const &title_, string const &description_, string const &photo_url_, int32 photo_size_, int32 photo_width_, int32 photo_height_, bytes const &payload_, string const &provider_token_, string const &provider_data_, string const &start_parameter_); + inputMessageInvoice(object_ptr &&invoice_, string const &title_, string const &description_, string const &photo_url_, int32 photo_size_, int32 photo_width_, int32 photo_height_, bytes const &payload_, string const &provider_token_, string const &provider_data_, string const &start_parameter_, object_ptr &&extended_media_content_); - static const std::int32_t ID = 1038812175; + static const std::int32_t ID = 885857632; std::int32_t get_id() const final { return ID; } @@ -6754,6 +8421,23 @@ class inputMessagePoll final : public InputMessageContent { void store(TlStorerToString &s, const char *field_name) const final; }; +class inputMessageStory final : public InputMessageContent { + public: + int53 story_sender_chat_id_; + int32 story_id_; + + inputMessageStory(); + + inputMessageStory(int53 story_sender_chat_id_, int32 story_id_); + + static const std::int32_t ID = 554278243; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + class inputMessageForwarded final : public InputMessageContent { public: int53 from_chat_id_; @@ -6773,6 +8457,55 @@ class inputMessageForwarded final : public InputMessageContent { void store(TlStorerToString &s, const char *field_name) const final; }; +class formattedText; + +class InputMessageReplyTo: public Object { + public: +}; + +class inputMessageReplyToMessage final : public InputMessageReplyTo { + public: + int53 chat_id_; + int53 message_id_; + object_ptr quote_; + + inputMessageReplyToMessage(); + + inputMessageReplyToMessage(int53 chat_id_, int53 message_id_, object_ptr &"e_); + + static const std::int32_t ID = 548499206; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class inputMessageReplyToStory final : public InputMessageReplyTo { + public: + int53 story_sender_chat_id_; + int32 story_id_; + + inputMessageReplyToStory(); + + inputMessageReplyToStory(int53 story_sender_chat_id_, int32 story_id_); + + static const std::int32_t ID = 1370410616; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class address; + +class inputIdentityDocument; + +class inputPersonalDocument; + +class personalDetails; + class InputPassportElement: public Object { public: }; @@ -6985,6 +8718,10 @@ class inputPassportElementEmailAddress final : public InputPassportElement { void store(TlStorerToString &s, const char *field_name) const final; }; +class InputPassportElementErrorSource; + +class PassportElementType; + class inputPassportElementError final : public Object { public: object_ptr type_; @@ -7152,6 +8889,8 @@ class inputPassportElementErrorSourceFiles final : public InputPassportElementEr void store(TlStorerToString &s, const char *field_name) const final; }; +class InputFile; + class inputPersonalDocument final : public Object { public: array> files_; @@ -7169,21 +8908,22 @@ class inputPersonalDocument final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; -class InputSticker: public Object { - public: -}; +class InputFile; -class inputStickerStatic final : public InputSticker { +class maskPosition; + +class inputSticker final : public Object { public: object_ptr sticker_; string emojis_; object_ptr mask_position_; + array keywords_; - inputStickerStatic(); + inputSticker(); - inputStickerStatic(object_ptr &&sticker_, string const &emojis_, object_ptr &&mask_position_); + inputSticker(object_ptr &&sticker_, string const &emojis_, object_ptr &&mask_position_, array &&keywords_); - static const std::int32_t ID = 1409680603; + static const std::int32_t ID = 735226185; std::int32_t get_id() const final { return ID; } @@ -7191,16 +8931,20 @@ class inputStickerStatic final : public InputSticker { void store(TlStorerToString &s, const char *field_name) const final; }; -class inputStickerAnimated final : public InputSticker { +class InputStoryAreaType; + +class storyAreaPosition; + +class inputStoryArea final : public Object { public: - object_ptr sticker_; - string emojis_; + object_ptr position_; + object_ptr type_; - inputStickerAnimated(); + inputStoryArea(); - inputStickerAnimated(object_ptr &&sticker_, string const &emojis_); + inputStoryArea(object_ptr &&position_, object_ptr &&type_); - static const std::int32_t ID = -1127265952; + static const std::int32_t ID = 122859135; std::int32_t get_id() const final { return ID; } @@ -7208,6 +8952,144 @@ class inputStickerAnimated final : public InputSticker { void store(TlStorerToString &s, const char *field_name) const final; }; +class ReactionType; + +class location; + +class InputStoryAreaType: public Object { + public: +}; + +class inputStoryAreaTypeLocation final : public InputStoryAreaType { + public: + object_ptr location_; + + inputStoryAreaTypeLocation(); + + explicit inputStoryAreaTypeLocation(object_ptr &&location_); + + static const std::int32_t ID = 1749669730; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class inputStoryAreaTypeFoundVenue final : public InputStoryAreaType { + public: + int64 query_id_; + string result_id_; + + inputStoryAreaTypeFoundVenue(); + + inputStoryAreaTypeFoundVenue(int64 query_id_, string const &result_id_); + + static const std::int32_t ID = -1395809130; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class inputStoryAreaTypePreviousVenue final : public InputStoryAreaType { + public: + string venue_provider_; + string venue_id_; + + inputStoryAreaTypePreviousVenue(); + + inputStoryAreaTypePreviousVenue(string const &venue_provider_, string const &venue_id_); + + static const std::int32_t ID = 1846693388; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class inputStoryAreaTypeSuggestedReaction final : public InputStoryAreaType { + public: + object_ptr reaction_type_; + bool is_dark_; + bool is_flipped_; + + inputStoryAreaTypeSuggestedReaction(); + + inputStoryAreaTypeSuggestedReaction(object_ptr &&reaction_type_, bool is_dark_, bool is_flipped_); + + static const std::int32_t ID = 2101826003; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class inputStoryArea; + +class inputStoryAreas final : public Object { + public: + array> areas_; + + inputStoryAreas(); + + explicit inputStoryAreas(array> &&areas_); + + static const std::int32_t ID = -883247088; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class InputFile; + +class InputStoryContent: public Object { + public: +}; + +class inputStoryContentPhoto final : public InputStoryContent { + public: + object_ptr photo_; + array added_sticker_file_ids_; + + inputStoryContentPhoto(); + + inputStoryContentPhoto(object_ptr &&photo_, array &&added_sticker_file_ids_); + + static const std::int32_t ID = -309196727; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class inputStoryContentVideo final : public InputStoryContent { + public: + object_ptr video_; + array added_sticker_file_ids_; + double duration_; + bool is_animation_; + + inputStoryContentVideo(); + + inputStoryContentVideo(object_ptr &&video_, array &&added_sticker_file_ids_, double duration_, bool is_animation_); + + static const std::int32_t ID = -738542773; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class InputFile; + class inputThumbnail final : public Object { public: object_ptr thumbnail_; @@ -7226,6 +9108,14 @@ class inputThumbnail final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class ProxyType; + +class TargetChat; + +class chatAdministratorRights; + +class formattedText; + class InternalLinkType: public Object { public: }; @@ -7243,6 +9133,24 @@ class internalLinkTypeActiveSessions final : public InternalLinkType { void store(TlStorerToString &s, const char *field_name) const final; }; +class internalLinkTypeAttachmentMenuBot final : public InternalLinkType { + public: + object_ptr target_chat_; + string bot_username_; + string url_; + + internalLinkTypeAttachmentMenuBot(); + + internalLinkTypeAttachmentMenuBot(object_ptr &&target_chat_, string const &bot_username_, string const &url_); + + static const std::int32_t ID = 1682719269; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + class internalLinkTypeAuthenticationCode final : public InternalLinkType { public: string code_; @@ -7275,16 +9183,34 @@ class internalLinkTypeBackground final : public InternalLinkType { void store(TlStorerToString &s, const char *field_name) const final; }; +class internalLinkTypeBotAddToChannel final : public InternalLinkType { + public: + string bot_username_; + object_ptr administrator_rights_; + + internalLinkTypeBotAddToChannel(); + + internalLinkTypeBotAddToChannel(string const &bot_username_, object_ptr &&administrator_rights_); + + static const std::int32_t ID = 1401602752; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + class internalLinkTypeBotStart final : public InternalLinkType { public: string bot_username_; string start_parameter_; + bool autostart_; internalLinkTypeBotStart(); - internalLinkTypeBotStart(string const &bot_username_, string const &start_parameter_); + internalLinkTypeBotStart(string const &bot_username_, string const &start_parameter_, bool autostart_); - static const std::int32_t ID = -1206724291; + static const std::int32_t ID = 1066950637; std::int32_t get_id() const final { return ID; } @@ -7296,12 +9222,13 @@ class internalLinkTypeBotStartInGroup final : public InternalLinkType { public: string bot_username_; string start_parameter_; + object_ptr administrator_rights_; internalLinkTypeBotStartInGroup(); - internalLinkTypeBotStartInGroup(string const &bot_username_, string const &start_parameter_); + internalLinkTypeBotStartInGroup(string const &bot_username_, string const &start_parameter_, object_ptr &&administrator_rights_); - static const std::int32_t ID = -1040096100; + static const std::int32_t ID = -905081650; std::int32_t get_id() const final { return ID; } @@ -7322,6 +9249,51 @@ class internalLinkTypeChangePhoneNumber final : public InternalLinkType { void store(TlStorerToString &s, const char *field_name) const final; }; +class internalLinkTypeChatBoost final : public InternalLinkType { + public: + string url_; + + internalLinkTypeChatBoost(); + + explicit internalLinkTypeChatBoost(string const &url_); + + static const std::int32_t ID = -716571328; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class internalLinkTypeChatFolderInvite final : public InternalLinkType { + public: + string invite_link_; + + internalLinkTypeChatFolderInvite(); + + explicit internalLinkTypeChatFolderInvite(string const &invite_link_); + + static const std::int32_t ID = -1984804546; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class internalLinkTypeChatFolderSettings final : public InternalLinkType { + public: + + internalLinkTypeChatFolderSettings(); + + static const std::int32_t ID = -1073805988; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + class internalLinkTypeChatInvite final : public InternalLinkType { public: string invite_link_; @@ -7338,12 +9310,25 @@ class internalLinkTypeChatInvite final : public InternalLinkType { void store(TlStorerToString &s, const char *field_name) const final; }; -class internalLinkTypeFilterSettings final : public InternalLinkType { +class internalLinkTypeDefaultMessageAutoDeleteTimerSettings final : public InternalLinkType { public: - internalLinkTypeFilterSettings(); + internalLinkTypeDefaultMessageAutoDeleteTimerSettings(); - static const std::int32_t ID = 1501632411; + static const std::int32_t ID = 732625201; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class internalLinkTypeEditProfileSettings final : public InternalLinkType { + public: + + internalLinkTypeEditProfileSettings(); + + static const std::int32_t ID = -1022472090; std::int32_t get_id() const final { return ID; } @@ -7368,6 +9353,39 @@ class internalLinkTypeGame final : public InternalLinkType { void store(TlStorerToString &s, const char *field_name) const final; }; +class internalLinkTypeInstantView final : public InternalLinkType { + public: + string url_; + string fallback_url_; + + internalLinkTypeInstantView(); + + internalLinkTypeInstantView(string const &url_, string const &fallback_url_); + + static const std::int32_t ID = 1776607039; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class internalLinkTypeInvoice final : public InternalLinkType { + public: + string invoice_name_; + + internalLinkTypeInvoice(); + + explicit internalLinkTypeInvoice(string const &invoice_name_); + + static const std::int32_t ID = -213094996; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + class internalLinkTypeLanguagePack final : public InternalLinkType { public: string language_pack_id_; @@ -7384,6 +9402,19 @@ class internalLinkTypeLanguagePack final : public InternalLinkType { void store(TlStorerToString &s, const char *field_name) const final; }; +class internalLinkTypeLanguageSettings final : public InternalLinkType { + public: + + internalLinkTypeLanguageSettings(); + + static const std::int32_t ID = -1340479770; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + class internalLinkTypeMessage final : public InternalLinkType { public: string url_; @@ -7454,6 +9485,51 @@ class internalLinkTypePhoneNumberConfirmation final : public InternalLinkType { void store(TlStorerToString &s, const char *field_name) const final; }; +class internalLinkTypePremiumFeatures final : public InternalLinkType { + public: + string referrer_; + + internalLinkTypePremiumFeatures(); + + explicit internalLinkTypePremiumFeatures(string const &referrer_); + + static const std::int32_t ID = 1216892745; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class internalLinkTypePremiumGiftCode final : public InternalLinkType { + public: + string code_; + + internalLinkTypePremiumGiftCode(); + + explicit internalLinkTypePremiumGiftCode(string const &code_); + + static const std::int32_t ID = -564356974; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class internalLinkTypePrivacyAndSecuritySettings final : public InternalLinkType { + public: + + internalLinkTypePrivacyAndSecuritySettings(); + + static const std::int32_t ID = -1386255665; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + class internalLinkTypeProxy final : public InternalLinkType { public: string server_; @@ -7501,6 +9577,19 @@ class internalLinkTypeQrCodeAuthentication final : public InternalLinkType { void store(TlStorerToString &s, const char *field_name) const final; }; +class internalLinkTypeRestorePurchases final : public InternalLinkType { + public: + + internalLinkTypeRestorePurchases(); + + static const std::int32_t ID = 606090371; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + class internalLinkTypeSettings final : public InternalLinkType { public: @@ -7514,15 +9603,50 @@ class internalLinkTypeSettings final : public InternalLinkType { void store(TlStorerToString &s, const char *field_name) const final; }; +class internalLinkTypeSideMenuBot final : public InternalLinkType { + public: + string bot_username_; + string url_; + + internalLinkTypeSideMenuBot(); + + internalLinkTypeSideMenuBot(string const &bot_username_, string const &url_); + + static const std::int32_t ID = -1570707587; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + class internalLinkTypeStickerSet final : public InternalLinkType { public: string sticker_set_name_; + bool expect_custom_emoji_; internalLinkTypeStickerSet(); - explicit internalLinkTypeStickerSet(string const &sticker_set_name_); + internalLinkTypeStickerSet(string const &sticker_set_name_, bool expect_custom_emoji_); - static const std::int32_t ID = -529639751; + static const std::int32_t ID = -1589227614; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class internalLinkTypeStory final : public InternalLinkType { + public: + string story_sender_username_; + int32 story_id_; + + internalLinkTypeStory(); + + internalLinkTypeStory(string const &story_sender_username_, int32 story_id_); + + static const std::int32_t ID = 1471997511; std::int32_t get_id() const final { return ID; } @@ -7588,6 +9712,38 @@ class internalLinkTypeUnsupportedProxy final : public InternalLinkType { void store(TlStorerToString &s, const char *field_name) const final; }; +class internalLinkTypeUserPhoneNumber final : public InternalLinkType { + public: + string phone_number_; + + internalLinkTypeUserPhoneNumber(); + + explicit internalLinkTypeUserPhoneNumber(string const &phone_number_); + + static const std::int32_t ID = -1955751319; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class internalLinkTypeUserToken final : public InternalLinkType { + public: + string token_; + + internalLinkTypeUserToken(); + + explicit internalLinkTypeUserToken(string const &token_); + + static const std::int32_t ID = -1462248615; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + class internalLinkTypeVideoChat final : public InternalLinkType { public: string chat_username_; @@ -7606,12 +9762,77 @@ class internalLinkTypeVideoChat final : public InternalLinkType { void store(TlStorerToString &s, const char *field_name) const final; }; +class internalLinkTypeWebApp final : public InternalLinkType { + public: + string bot_username_; + string web_app_short_name_; + string start_parameter_; + + internalLinkTypeWebApp(); + + internalLinkTypeWebApp(string const &bot_username_, string const &web_app_short_name_, string const &start_parameter_); + + static const std::int32_t ID = -57094065; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class InviteLinkChatType: public Object { + public: +}; + +class inviteLinkChatTypeBasicGroup final : public InviteLinkChatType { + public: + + inviteLinkChatTypeBasicGroup(); + + static const std::int32_t ID = 1296287214; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class inviteLinkChatTypeSupergroup final : public InviteLinkChatType { + public: + + inviteLinkChatTypeSupergroup(); + + static const std::int32_t ID = 1038640984; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class inviteLinkChatTypeChannel final : public InviteLinkChatType { + public: + + inviteLinkChatTypeChannel(); + + static const std::int32_t ID = 806547211; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class labeledPricePart; + class invoice final : public Object { public: string currency_; array> price_parts_; int53 max_tip_amount_; array suggested_tip_amounts_; + string recurring_payment_terms_of_service_url_; + string terms_of_service_url_; bool is_test_; bool need_name_; bool need_phone_number_; @@ -7623,9 +9844,9 @@ class invoice final : public Object { invoice(); - invoice(string const ¤cy_, array> &&price_parts_, int53 max_tip_amount_, array &&suggested_tip_amounts_, bool is_test_, bool need_name_, bool need_phone_number_, bool need_email_address_, bool need_shipping_address_, bool send_phone_number_to_provider_, bool send_email_address_to_provider_, bool is_flexible_); + invoice(string const ¤cy_, array> &&price_parts_, int53 max_tip_amount_, array &&suggested_tip_amounts_, string const &recurring_payment_terms_of_service_url_, string const &terms_of_service_url_, bool is_test_, bool need_name_, bool need_phone_number_, bool need_email_address_, bool need_shipping_address_, bool send_phone_number_to_provider_, bool send_email_address_to_provider_, bool is_flexible_); - static const std::int32_t ID = 1479250728; + static const std::int32_t ID = 1039926674; std::int32_t get_id() const final { return ID; } @@ -7633,6 +9854,8 @@ class invoice final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class JsonValue; + class jsonObjectMember final : public Object { public: string key_; @@ -7650,6 +9873,10 @@ class jsonObjectMember final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class JsonValue; + +class jsonObjectMember; + class JsonValue: public Object { public: }; @@ -7747,6 +9974,8 @@ class jsonValueObject final : public JsonValue { void store(TlStorerToString &s, const char *field_name) const final; }; +class KeyboardButtonType; + class keyboardButton final : public Object { public: string text_; @@ -7764,6 +9993,8 @@ class keyboardButton final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class chatAdministratorRights; + class KeyboardButtonType: public Object { public: }; @@ -7824,6 +10055,67 @@ class keyboardButtonTypeRequestPoll final : public KeyboardButtonType { void store(TlStorerToString &s, const char *field_name) const final; }; +class keyboardButtonTypeRequestUser final : public KeyboardButtonType { + public: + int32 id_; + bool restrict_user_is_bot_; + bool user_is_bot_; + bool restrict_user_is_premium_; + bool user_is_premium_; + + keyboardButtonTypeRequestUser(); + + keyboardButtonTypeRequestUser(int32 id_, bool restrict_user_is_bot_, bool user_is_bot_, bool restrict_user_is_premium_, bool user_is_premium_); + + static const std::int32_t ID = -1996508112; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class keyboardButtonTypeRequestChat final : public KeyboardButtonType { + public: + int32 id_; + bool chat_is_channel_; + bool restrict_chat_is_forum_; + bool chat_is_forum_; + bool restrict_chat_has_username_; + bool chat_has_username_; + bool chat_is_created_; + object_ptr user_administrator_rights_; + object_ptr bot_administrator_rights_; + bool bot_is_member_; + + keyboardButtonTypeRequestChat(); + + keyboardButtonTypeRequestChat(int32 id_, bool chat_is_channel_, bool restrict_chat_is_forum_, bool chat_is_forum_, bool restrict_chat_has_username_, bool chat_has_username_, bool chat_is_created_, object_ptr &&user_administrator_rights_, object_ptr &&bot_administrator_rights_, bool bot_is_member_); + + static const std::int32_t ID = 272541602; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class keyboardButtonTypeWebApp final : public KeyboardButtonType { + public: + string url_; + + keyboardButtonTypeWebApp(); + + explicit keyboardButtonTypeWebApp(string const &url_); + + static const std::int32_t ID = 1892220770; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + class labeledPricePart final : public Object { public: string label_; @@ -7869,6 +10161,8 @@ class languagePackInfo final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class LanguagePackStringValue; + class languagePackString final : public Object { public: string key_; @@ -7940,6 +10234,8 @@ class languagePackStringValueDeleted final : public LanguagePackStringValue { void store(TlStorerToString &s, const char *field_name) const final; }; +class languagePackString; + class languagePackStrings final : public Object { public: array> strings_; @@ -7956,6 +10252,26 @@ class languagePackStrings final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class linkPreviewOptions final : public Object { + public: + bool is_disabled_; + string url_; + bool force_small_media_; + bool force_large_media_; + bool show_above_text_; + + linkPreviewOptions(); + + linkPreviewOptions(bool is_disabled_, string const &url_, bool force_small_media_, bool force_large_media_, bool show_above_text_); + + static const std::int32_t ID = 1046590451; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + class localFile final : public Object { public: string path_; @@ -7963,15 +10279,15 @@ class localFile final : public Object { bool can_be_deleted_; bool is_downloading_active_; bool is_downloading_completed_; - int32 download_offset_; - int32 downloaded_prefix_size_; - int32 downloaded_size_; + int53 download_offset_; + int53 downloaded_prefix_size_; + int53 downloaded_size_; localFile(); - localFile(string const &path_, bool can_be_downloaded_, bool can_be_deleted_, bool is_downloading_active_, bool is_downloading_completed_, int32 download_offset_, int32 downloaded_prefix_size_, int32 downloaded_size_); + localFile(string const &path_, bool can_be_downloaded_, bool can_be_deleted_, bool is_downloading_active_, bool is_downloading_completed_, int53 download_offset_, int53 downloaded_prefix_size_, int53 downloaded_size_); - static const std::int32_t ID = -1166400317; + static const std::int32_t ID = -1562732153; std::int32_t get_id() const final { return ID; } @@ -7979,6 +10295,8 @@ class localFile final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class languagePackInfo; + class localizationTargetInfo final : public Object { public: array> language_packs_; @@ -8100,13 +10418,13 @@ class LoginUrlInfo: public Object { class loginUrlInfoOpen final : public LoginUrlInfo { public: string url_; - bool skip_confirm_; + bool skip_confirmation_; loginUrlInfoOpen(); - loginUrlInfoOpen(string const &url_, bool skip_confirm_); + loginUrlInfoOpen(string const &url_, bool skip_confirmation_); - static const std::int32_t ID = -1079045420; + static const std::int32_t ID = 837282306; std::int32_t get_id() const final { return ID; } @@ -8189,6 +10507,8 @@ class maskPointChin final : public MaskPoint { void store(TlStorerToString &s, const char *field_name) const final; }; +class MaskPoint; + class maskPosition final : public Object { public: object_ptr point_; @@ -8208,6 +10528,28 @@ class maskPosition final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class MessageContent; + +class MessageReplyTo; + +class MessageSchedulingState; + +class MessageSelfDestructType; + +class MessageSender; + +class MessageSendingState; + +class ReplyMarkup; + +class messageForwardInfo; + +class messageImportInfo; + +class messageInteractionInfo; + +class unreadReaction; + class message final : public Object { public: int53 id_; @@ -8219,25 +10561,31 @@ class message final : public Object { bool is_pinned_; bool can_be_edited_; bool can_be_forwarded_; + bool can_be_replied_in_another_chat_; bool can_be_saved_; bool can_be_deleted_only_for_self_; bool can_be_deleted_for_all_users_; + bool can_get_added_reactions_; bool can_get_statistics_; bool can_get_message_thread_; bool can_get_viewers_; bool can_get_media_timestamp_links_; + bool can_report_reactions_; bool has_timestamped_media_; bool is_channel_post_; + bool is_topic_message_; bool contains_unread_mention_; int32 date_; int32 edit_date_; object_ptr forward_info_; + object_ptr import_info_; object_ptr interaction_info_; - int53 reply_in_chat_id_; - int53 reply_to_message_id_; + array> unread_reactions_; + object_ptr reply_to_; int53 message_thread_id_; - int32 ttl_; - double ttl_expires_in_; + object_ptr self_destruct_type_; + double self_destruct_in_; + double auto_delete_in_; int53 via_bot_user_id_; string author_signature_; int64 media_album_id_; @@ -8247,9 +10595,9 @@ class message final : public Object { message(); - message(int53 id_, object_ptr &&sender_id_, int53 chat_id_, object_ptr &&sending_state_, object_ptr &&scheduling_state_, bool is_outgoing_, bool is_pinned_, bool can_be_edited_, bool can_be_forwarded_, bool can_be_saved_, bool can_be_deleted_only_for_self_, bool can_be_deleted_for_all_users_, bool can_get_statistics_, bool can_get_message_thread_, bool can_get_viewers_, bool can_get_media_timestamp_links_, bool has_timestamped_media_, bool is_channel_post_, bool contains_unread_mention_, int32 date_, int32 edit_date_, object_ptr &&forward_info_, object_ptr &&interaction_info_, int53 reply_in_chat_id_, int53 reply_to_message_id_, int53 message_thread_id_, int32 ttl_, double ttl_expires_in_, int53 via_bot_user_id_, string const &author_signature_, int64 media_album_id_, string const &restriction_reason_, object_ptr &&content_, object_ptr &&reply_markup_); + message(int53 id_, object_ptr &&sender_id_, int53 chat_id_, object_ptr &&sending_state_, object_ptr &&scheduling_state_, bool is_outgoing_, bool is_pinned_, bool can_be_edited_, bool can_be_forwarded_, bool can_be_replied_in_another_chat_, bool can_be_saved_, bool can_be_deleted_only_for_self_, bool can_be_deleted_for_all_users_, bool can_get_added_reactions_, bool can_get_statistics_, bool can_get_message_thread_, bool can_get_viewers_, bool can_get_media_timestamp_links_, bool can_report_reactions_, bool has_timestamped_media_, bool is_channel_post_, bool is_topic_message_, bool contains_unread_mention_, int32 date_, int32 edit_date_, object_ptr &&forward_info_, object_ptr &&import_info_, object_ptr &&interaction_info_, array> &&unread_reactions_, object_ptr &&reply_to_, int53 message_thread_id_, object_ptr &&self_destruct_type_, double self_destruct_in_, double auto_delete_in_, int53 via_bot_user_id_, string const &author_signature_, int64 media_album_id_, string const &restriction_reason_, object_ptr &&content_, object_ptr &&reply_markup_); - static const std::int32_t ID = -961280585; + static const std::int32_t ID = -1237373187; std::int32_t get_id() const final { return ID; } @@ -8257,6 +10605,24 @@ class message final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class messageAutoDeleteTime final : public Object { + public: + int32 time_; + + messageAutoDeleteTime(); + + explicit messageAutoDeleteTime(int32 time_); + + static const std::int32_t ID = 1972045589; + std::int32_t get_id() const final { + return ID; + } + + void store(TlStorerToString &s, const char *field_name) const final; +}; + +class messageCalendarDay; + class messageCalendar final : public Object { public: int32 total_count_; @@ -8274,6 +10640,8 @@ class messageCalendar final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class message; + class messageCalendarDay final : public Object { public: int32 total_count_; @@ -8291,6 +10659,66 @@ class messageCalendarDay final : public Object { void store(TlStorerToString &s, const char *field_name) const final; }; +class BotWriteAccessAllowReason; + +class CallDiscardReason; + +class DiceStickers; + +class MessageExtendedMedia; + +class MessageSender; + +class PassportElementType; + +class animatedEmoji; + +class animation; + +class audio; + +class chatBackground; + +class chatPhoto; + +class contact; + +class document; + +class encryptedCredentials; + +class encryptedPassportElement; + +class formattedText; + +class forumTopicIcon; + +class game; + +class linkPreviewOptions; + +class location; + +class orderInfo; + +class photo; + +class poll; + +class premiumGiveawayParameters; + +class sticker; + +class venue; + +class video; + +class videoNote; + +class voiceNote; + +class webPage; + class MessageContent: public Object { public: }; @@ -8299,12 +10727,13 @@ class messageText final : public MessageContent { public: object_ptr text_; object_ptr web_page_; + object_ptr link_preview_options_; messageText(); - messageText(object_ptr &&text_, object_ptr &&web_page_); + messageText(object_ptr &&text_, object_ptr &&web_page_, object_ptr &&link_preview_options_); - static const std::int32_t ID = 1989037971; + static const std::int32_t ID = -1053465942; std::int32_t get_id() const final { return ID; } @@ -8316,13 +10745,14 @@ class messageAnimation final : public MessageContent { public: object_ptr animation_; object_ptr caption_; + bool has_spoiler_; bool is_secret_; messageAnimation(); - messageAnimation(object_ptr &&animation_, object_ptr &&caption_, bool is_secret_); + messageAnimation(object_ptr &&animation_, object_ptr &&caption_, bool has_spoiler_, bool is_secret_); - static const std::int32_t ID = 1306939396; + static const std::int32_t ID = 1051944700; std::int32_t get_id() const final { return ID; } @@ -8368,13 +10798,14 @@ class messagePhoto final : public MessageContent { public: object_ptr photo_; object_ptr caption_; + bool has_spoiler_; bool is_secret_; messagePhoto(); - messagePhoto(object_ptr &&photo_, object_ptr &&caption_, bool is_secret_); + messagePhoto(object_ptr &&photo_, object_ptr &&caption_, bool has_spoiler_, bool is_secret_); - static const std::int32_t ID = -1851395174; + static const std::int32_t ID = -448050478; std::int32_t get_id() const final { return ID; } @@ -8398,12 +10829,13 @@ class messageExpiredPhoto final : public MessageContent { class messageSticker final : public MessageContent { public: object_ptr sticker_; + bool is_premium_; messageSticker(); - explicit messageSticker(object_ptr &&sticker_); + messageSticker(object_ptr &&sticker_, bool is_premium_); - static const std::int32_t ID = 1779022878; + static const std::int32_t ID = -437199670; std::int32_t get_id() const final { return ID; } @@ -8415,13 +10847,14 @@ class messageVideo final : public MessageContent { public: object_ptr