From d7f234fb19cb4ab1b7ed5dc2fc06f31c9cae53c8 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 10 Dec 2012 16:04:14 +0400 Subject: [PATCH] use retweeted_status when available --- backends/twitter/TwitterResponseParser.cpp | 6 ++++++ backends/twitter/TwitterResponseParser.h | 1 + 2 files changed, 7 insertions(+) diff --git a/backends/twitter/TwitterResponseParser.cpp b/backends/twitter/TwitterResponseParser.cpp index 8d87d509..47acd57b 100644 --- a/backends/twitter/TwitterResponseParser.cpp +++ b/backends/twitter/TwitterResponseParser.cpp @@ -46,6 +46,9 @@ EmbeddedStatus getEmbeddedStatus(const Swift::ParserElement::ref &element, const status.setRetweetCount( atoi( element->getChild(TwitterReponseTypes::retweet_count, xmlns)->getText().c_str() ) ); status.setFavorited( std::string( element->getChild(TwitterReponseTypes::favorited, xmlns)->getText() )=="true" ); status.setRetweeted( std::string( element->getChild(TwitterReponseTypes::retweeted, xmlns)->getText() )=="true" ); + if (status.isRetweeted()) { + status.setTweet( std::string( element->getChild(TwitterReponseTypes::retweeted_status, xmlns)->getText() ) ); + } return status; } @@ -88,6 +91,9 @@ Status getStatus(const Swift::ParserElement::ref &element, const std::string xml status.setRetweetCount( atoi( element->getChild(TwitterReponseTypes::retweet_count, xmlns)->getText().c_str() ) ); status.setFavorited( std::string( element->getChild(TwitterReponseTypes::favorited, xmlns)->getText() )=="true" ); status.setRetweeted( std::string( element->getChild(TwitterReponseTypes::retweeted, xmlns)->getText() )=="true" ); + if (status.isRetweeted()) { + status.setTweet( std::string( element->getChild(TwitterReponseTypes::retweeted_status, xmlns)->getText() ) ); + } return status; } diff --git a/backends/twitter/TwitterResponseParser.h b/backends/twitter/TwitterResponseParser.h index cbfa8d23..614dd869 100644 --- a/backends/twitter/TwitterResponseParser.h +++ b/backends/twitter/TwitterResponseParser.h @@ -20,6 +20,7 @@ namespace TwitterReponseTypes const std::string in_reply_to_user_id = "in_reply_to_user_id"; const std::string in_reply_to_screen_name = "in_reply_to_screen_name"; const std::string retweet_count = "retweet_count"; + const std::string retweeted_status = "retweeted_status"; const std::string favorited = "favorited"; const std::string retweeted = "retweeted"; const std::string user = "user";