From c81f7d9d7a4fe9dc3b48b92fad633bd5c44b8e74 Mon Sep 17 00:00:00 2001 From: JellyBrick Date: Sun, 27 May 2018 17:50:32 +0900 Subject: Bot API 3.3 update --- src/TgTypeParser.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/TgTypeParser.cpp') diff --git a/src/TgTypeParser.cpp b/src/TgTypeParser.cpp index 0facf93..fafe94f 100644 --- a/src/TgTypeParser.cpp +++ b/src/TgTypeParser.cpp @@ -47,7 +47,7 @@ Chat::Ptr TgTypeParser::parseJsonAndGetChat(const ptree& data) const { } result->title = data.get("title", ""); result->username = data.get("username", ""); - result->firstName = data.get("first_name", ""); + result->firstName = data.get("first_name", ""); result->lastName = data.get("last_name", ""); result->allMembersAreAdministrators = data.get("all_members_are_administrators", false); result->photo = tryParseJson(&TgTypeParser::parseJsonAndGetChatPhoto, data, "photo"); @@ -88,6 +88,7 @@ string TgTypeParser::parseChat(const Chat::Ptr& object) const { User::Ptr TgTypeParser::parseJsonAndGetUser(const ptree& data) const { auto result(make_shared()); result->id = data.get("id"); + result->isBot = data.get("is_bot", false); result->firstName = data.get("first_name"); result->lastName = data.get("last_name", ""); result->username = data.get("username", ""); @@ -102,6 +103,7 @@ string TgTypeParser::parseUser(const User::Ptr& object) const { string result; result += '{'; appendToJson(result, "id", object->id); + appendToJson(result, "is_bot", object->isBot); appendToJson(result, "first_name", object->firstName); appendToJson(result, "last_name", object->lastName); appendToJson(result, "username", object->username); @@ -130,9 +132,11 @@ Message::Ptr TgTypeParser::parseJsonAndGetMessage(const ptree& data) const { result->forwardFrom = tryParseJson(&TgTypeParser::parseJsonAndGetUser, data, "forward_from"); result->forwardFromChat = tryParseJson(&TgTypeParser::parseJsonAndGetChat, data, "forward_from_chat"); result->forwardFromMessageId = data.get("forward_from_message_id", 0); + result->forwardSignature = data.get("forward_signature", ""); result->forwardDate = data.get("forward_date", 0); result->replyToMessage = tryParseJson(&TgTypeParser::parseJsonAndGetMessage, data, "reply_to_message"); result->editDate = data.get("edit_date", 0); + result->authorSignature = data.get("author_signature", ""); result->text = data.get("text", ""); result->entities = parseJsonAndGetArray(&TgTypeParser::parseJsonAndGetEntity, data, "entities"); result->audio = tryParseJson