From ddb907bffa2a85d2773b80714fca90de687e3fb9 Mon Sep 17 00:00:00 2001 From: Andrea Barbadoro Date: Fri, 4 Nov 2016 21:29:08 +0100 Subject: Update TgTypeParser.cpp --- src/TgTypeParser.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/TgTypeParser.cpp') diff --git a/src/TgTypeParser.cpp b/src/TgTypeParser.cpp index 05a287d..63ff3ce 100644 --- a/src/TgTypeParser.cpp +++ b/src/TgTypeParser.cpp @@ -102,6 +102,15 @@ string TgTypeParser::parseUser(const User::Ptr& object) const { return result; } +MessageEntity::Ptr TgTypeParser::parseJsonAndGetEntity(const ptree& data) const{ + MessageEntity::Ptr result(new MessageEntity); + result->type=data.get("type"); + result->offset=data.get("offset"); + result->length=data.get("length"); + result->url=data.get("url", ""); + return result; +} + Message::Ptr TgTypeParser::parseJsonAndGetMessage(const ptree& data) const { Message::Ptr result(new Message); result->messageId = data.get("message_id"); -- cgit v1.2.3