From 5c9062ab3c3bff1fa1fb5b5288dda0cf5d0acf54 Mon Sep 17 00:00:00 2001 From: llnulldisk <48621230+llnulldisk@users.noreply.github.com> Date: Sun, 4 Sep 2022 21:18:17 +0200 Subject: Update to API 5.5 --- src/TgTypeParser.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/TgTypeParser.cpp') diff --git a/src/TgTypeParser.cpp b/src/TgTypeParser.cpp index ed75e21..e8a81d7 100644 --- a/src/TgTypeParser.cpp +++ b/src/TgTypeParser.cpp @@ -24,11 +24,14 @@ Chat::Ptr TgTypeParser::parseJsonAndGetChat(const boost::property_tree::ptree& d result->lastName = data.get("last_name", ""); result->photo = tryParseJson(&TgTypeParser::parseJsonAndGetChatPhoto, data, "photo"); result->bio = data.get("bio", ""); + result->hasPrivateForwards = data.get("has_private_forwards", false); result->description = data.get("description", ""); result->inviteLink = data.get("invite_link", ""); result->pinnedMessage = tryParseJson(&TgTypeParser::parseJsonAndGetMessage, data, "pinned_message"); result->permissions = tryParseJson(&TgTypeParser::parseJsonAndGetChatPermissions, data, "permissions"); result->slowModeDelay = data.get("slow_mode_delay", 0); + result->messageAutoDeleteTime = data.get("message_auto_delete_time", 0); + result->hasProtectedContent = data.get("has_protected_content", false); result->stickerSetName = data.get("sticker_set_name", ""); result->canSetStickerSet = data.get("can_set_sticker_set", false); result->linkedChatId = data.get("linked_chat_id", 0); @@ -58,11 +61,14 @@ std::string TgTypeParser::parseChat(const Chat::Ptr& object) const { appendToJson(result, "last_name", object->lastName); appendToJson(result, "photo", parseChatPhoto(object->photo)); appendToJson(result, "bio", object->bio); + appendToJson(result, "has_private_forwards", object->hasPrivateForwards); appendToJson(result, "description", object->description); appendToJson(result, "invite_link", object->inviteLink); appendToJson(result, "pinned_message", parseMessage(object->pinnedMessage)); appendToJson(result, "permissions", parseChatPermissions(object->permissions)); appendToJson(result, "slow_mode_delay", object->slowModeDelay); + appendToJson(result, "message_auto_delete_time", object->messageAutoDeleteTime); + appendToJson(result, "has_protected_content", object->hasProtectedContent); appendToJson(result, "sticker_set_name", object->stickerSetName); appendToJson(result, "can_set_sticker_set", object->canSetStickerSet); appendToJson(result, "linked_chat_id", object->linkedChatId); @@ -147,9 +153,11 @@ Message::Ptr TgTypeParser::parseJsonAndGetMessage(const boost::property_tree::pt result->forwardSignature = data.get("forward_signature", ""); result->forwardSenderName = data.get("forward_sender_name", ""); result->forwardDate = data.get("forward_date", 0); + result->isAutomaticForward = data.get("is_automatic_forward", false); result->replyToMessage = tryParseJson(&TgTypeParser::parseJsonAndGetMessage, data, "reply_to_message"); result->viaBot = tryParseJson(&TgTypeParser::parseJsonAndGetUser, data, "via_bot"); result->editDate = data.get("edit_date", 0); + result->hasProtectedContent = data.get("has_protected_content", false); result->mediaGroupId = data.get("media_group_id", ""); result->authorSignature = data.get("author_signature", ""); result->text = data.get("text", ""); @@ -193,7 +201,6 @@ Message::Ptr TgTypeParser::parseJsonAndGetMessage(const boost::property_tree::pt result->voiceChatEnded = tryParseJson(&TgTypeParser::parseJsonAndGetVoiceChatEnded, data, "voice_chat_ended"); result->voiceChatParticipantsInvited = tryParseJson(&TgTypeParser::parseJsonAndGetVoiceChatParticipantsInvited, data, "voice_chat_participants_invited"); result->replyMarkup = tryParseJson(&TgTypeParser::parseJsonAndGetInlineKeyboardMarkup, data, "reply_markup"); - result->automaticForward = data.get("is_automatic_forward", false); return result; } @@ -214,9 +221,11 @@ std::string TgTypeParser::parseMessage(const Message::Ptr& object) const { appendToJson(result, "forward_signature", object->forwardSignature); appendToJson(result, "forward_sender_name", object->forwardSenderName); appendToJson(result, "forward_date", object->forwardDate); + appendToJson(result, "is_automatic_forward", object->isAutomaticForward); appendToJson(result, "reply_to_message", parseMessage(object->replyToMessage)); appendToJson(result, "via_bot", parseUser(object->viaBot)); appendToJson(result, "edit_date", object->editDate); + appendToJson(result, "has_protected_content", object->hasProtectedContent); appendToJson(result, "media_group_id", object->mediaGroupId); appendToJson(result, "author_signature", object->authorSignature); appendToJson(result, "text", object->text); @@ -259,7 +268,6 @@ std::string TgTypeParser::parseMessage(const Message::Ptr& object) const { appendToJson(result, "voice_chat_ended", parseVoiceChatEnded(object->voiceChatEnded)); appendToJson(result, "voice_chat_participants_invited", parseVoiceChatParticipantsInvited(object->voiceChatParticipantsInvited)); appendToJson(result, "reply_markup", parseInlineKeyboardMarkup(object->replyMarkup)); - appendToJson(result, "is_automatic_forward", object->automaticForward); removeLastComma(result); result += '}'; return result; -- cgit v1.2.3