From b729f89033dca0cd2b9606060e735abfaf41c1f4 Mon Sep 17 00:00:00 2001 From: llnulldisk <48621230+llnulldisk@users.noreply.github.com> Date: Mon, 29 Aug 2022 18:46:44 +0200 Subject: Update to API 4.5 --- src/TgTypeParser.cpp | 84 ++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 75 insertions(+), 9 deletions(-) (limited to 'src/TgTypeParser.cpp') diff --git a/src/TgTypeParser.cpp b/src/TgTypeParser.cpp index 13ae5d4..db2e750 100644 --- a/src/TgTypeParser.cpp +++ b/src/TgTypeParser.cpp @@ -30,6 +30,8 @@ Chat::Ptr TgTypeParser::parseJsonAndGetChat(const ptree& data) const { 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"); result->stickerSetName = data.get("sticker_set_name", ""); result->canSetStickerSet = data.get("can_set_sticker_set", false); @@ -56,6 +58,15 @@ string TgTypeParser::parseChat(const Chat::Ptr& object) const { appendToJson(result, "username", object->username); appendToJson(result, "first_name", object->firstName); appendToJson(result, "last_name", object->lastName); + appendToJson(result, "all_members_are_administrators", object->allMembersAreAdministrators); + appendToJson(result, "photo", parseChatPhoto(object->photo)); + 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, "sticker_set_name", object->stickerSetName); + appendToJson(result, "can_set_sticker_set", object->canSetStickerSet); removeLastComma(result); result += '}'; return result; @@ -220,6 +231,7 @@ string TgTypeParser::parseMessage(const Message::Ptr& object) const { PhotoSize::Ptr TgTypeParser::parseJsonAndGetPhotoSize(const ptree& data) const { auto result(make_shared()); result->fileId = data.get("file_id"); + result->fileUniqueId = data.get("file_unique_id"); result->width = data.get("width"); result->height = data.get("height"); result->fileSize = data.get("file_size", 0); @@ -233,6 +245,7 @@ string TgTypeParser::parsePhotoSize(const PhotoSize::Ptr& object) const { string result; result += '{'; appendToJson(result, "file_id", object->fileId); + appendToJson(result, "file_unique_id", object->fileUniqueId); appendToJson(result, "width", object->width); appendToJson(result, "height", object->height); appendToJson(result, "file_size", object->fileSize); @@ -244,6 +257,7 @@ string TgTypeParser::parsePhotoSize(const PhotoSize::Ptr& object) const { Audio::Ptr TgTypeParser::parseJsonAndGetAudio(const ptree& data) const { auto result(make_shared