Changeset - 7142ccb570ed
[Not reviewed]
0 3 0
Vitaly Takmazov - 13 years ago 2012-12-10 21:28:10
vitalyster@gmail.com
Use retweetID for displaying and ID everywhere else
3 files changed with 7 insertions and 4 deletions:
0 comments (0 inline, 0 general)
backends/twitter/TwitterPlugin.cpp
Show inline comments
 
@@ -659,7 +659,7 @@ void TwitterPlugin::displayTweets(std::string &user, std::string &userRequested,
 

	
 
		for(int i = tweets.size() - 1 ; i >= 0 ; i--) {
 
			if(userdb[user].twitterMode != CHATROOM) {
 
				std::string m = " - " + tweets[i].getUserData().getScreenName() + ": " + tweets[i].getTweet() + " (MsgId: " + tweets[i].getID() + ")\n";
 
				std::string m = " - " + tweets[i].getUserData().getScreenName() + ": " + tweets[i].getTweet() + " (MsgId: " + (tweets[i].getRetweetID().empty() ? tweets[i].getID() : tweets[i].getRetweetID()) + ")\n";
 
				handleMessage(user, adminLegacyName, m, "", "", tweets[i].getCreationTime());
 

	
 
				std::string scrname = tweets[i].getUserData().getScreenName();
 
@@ -667,7 +667,7 @@ void TwitterPlugin::displayTweets(std::string &user, std::string &userRequested,
 

	
 
			} else {
 
				handleMessage(user, userdb[user].twitterMode == CHATROOM ? adminChatRoom : adminLegacyName,
 
									tweets[i].getTweet() + " (MsgId: " + tweets[i].getID() + ")", tweets[i].getUserData().getScreenName(), "", tweets[i].getCreationTime());
 
									tweets[i].getTweet() + " (MsgId: " + (tweets[i].getRetweetID().empty() ? tweets[i].getID() : tweets[i].getRetweetID()) + ")", tweets[i].getUserData().getScreenName(), "", tweets[i].getCreationTime());
 
			}
 
		}
 
		
backends/twitter/TwitterResponseParser.cpp
Show inline comments
 
@@ -103,7 +103,7 @@ Status getStatus(const Swift::ParserElement::ref &element, const std::string xml
 
	Swift::ParserElement::ref rt = element->getChild(TwitterReponseTypes::retweeted_status, xmlns);
 
	if (rt != Swift::NullParserElement::element) {
 
		status.setTweet(unescape( std::string( rt->getChild(TwitterReponseTypes::text, xmlns)->getText() + " (RT by @" + status.getUserData().getScreenName() + ")") ) );
 
		status.setID( std::string ( rt->getChild(TwitterReponseTypes::id, xmlns)->getText() ) );
 
		status.setRetweetID( std::string ( rt->getChild(TwitterReponseTypes::id, xmlns)->getText() ) );
 
		status.setCreationTime( toIsoTime ( std::string (rt->getChild(TwitterReponseTypes::created_at, xmlns)->getText() ) ) );
 
		status.setUserData( getUser ( rt->getChild(TwitterReponseTypes::user, xmlns), xmlns ) );
 
	}
backends/twitter/TwitterResponseParser.h
Show inline comments
 
@@ -116,6 +116,7 @@ class Status
 
{
 
	std::string created_at;
 
	std::string ID;
 
	std::string retweetID;	
 
	std::string text;
 
	bool truncated;
 
	std::string in_reply_to_status_id;
 
@@ -127,12 +128,13 @@ class Status
 
	bool retweeted;
 

	
 
	public:
 
	Status():created_at(""),ID(""),text(""),truncated(false),in_reply_to_status_id(""),
 
		Status():created_at(""),ID(""),retweetID(""),text(""),truncated(false),in_reply_to_status_id(""),
 
	         in_reply_to_user_id(""),in_reply_to_screen_name(""),user(User()),retweet_count(0),
 
	         favorited(false),retweeted(0){}
 
	
 
	std::string getCreationTime() {return created_at;}
 
	std::string getID() {return ID;}
 
	std::string getRetweetID() {return retweetID;}	
 
	std::string getTweet() {return text;}
 
	bool isTruncated() {return truncated;}
 
	std::string getReplyToStatusID() {return in_reply_to_status_id;}
 
@@ -145,6 +147,7 @@ class Status
 
	
 
	void setCreationTime(std::string _created) {created_at = _created;}
 
	void setID(std::string _id) {ID = _id;}
 
	void setRetweetID(std::string _id) {retweetID = _id;}	
 
	void setTweet(std::string _text) {text = _text;}
 
	void setTruncated(bool val) {truncated = val;}
 
	void setReplyToStatusID(std::string _id) {in_reply_to_status_id = _id;}
0 comments (0 inline, 0 general)