summaryrefslogtreecommitdiff
path: root/src/TgTypeParser.cpp
diff options
context:
space:
mode:
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");