diff options
author | Oleg Morozenkov <reo7sp@users.noreply.github.com> | 2016-11-05 21:35:01 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-05 21:35:01 +0300 |
commit | 305471cb6a60b6033babf11f662ba93205acce23 (patch) | |
tree | 94517ab1bc9d0570648ae6bbbc0aa810fe274dbd /src/TgTypeParser.cpp | |
parent | 1dc0ee29b3ba8150cc57757b60cabed6e37c5aaf (diff) | |
parent | 54843ab5d5ddfa695f6873b0adb53ec333b9491f (diff) |
Merge pull request #26 from andijcr/master
added json->MessageEntity
Diffstat (limited to 'src/TgTypeParser.cpp')
-rw-r--r-- | src/TgTypeParser.cpp | 9 |
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"); |