summaryrefslogtreecommitdiff
path: root/src/TgTypeParser.cpp
diff options
context:
space:
mode:
authorAndrea Barbadoro <andij.cr@gmail.com>2016-11-04 21:29:08 +0100
committerGitHub <noreply@github.com>2016-11-04 21:29:08 +0100
commitddb907bffa2a85d2773b80714fca90de687e3fb9 (patch)
treef3524c0de34e25a5c4efa00e61d0e1559b589d36 /src/TgTypeParser.cpp
parent1dc0ee29b3ba8150cc57757b60cabed6e37c5aaf (diff)
Update TgTypeParser.cpp
Diffstat (limited to 'src/TgTypeParser.cpp')
-rw-r--r--src/TgTypeParser.cpp9
1 files changed, 9 insertions, 0 deletions
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<string>("type");
+ result->offset=data.get<int32_t>("offset");
+ result->length=data.get<int32_t>("length");
+ result->url=data.get<string>("url", "");
+ return result;
+}
+
Message::Ptr TgTypeParser::parseJsonAndGetMessage(const ptree& data) const {
Message::Ptr result(new Message);
result->messageId = data.get<int32_t>("message_id");