From ac260cef3c8c035e3975a8c412553b25cb2b6c06 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sun, 22 May 2016 21:25:29 -0400 Subject: Fixed retweet detection Because a retweet is a tweet referenced from another tweet, the current implementation dynamically allocates memory for the retweeted status and has to manually copy the pointed to data around. It's not a very pretty implementation and may get tweaked at some point soon. I don't like having to implement the big five. --- src/tweet.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/tweet.h') diff --git a/src/tweet.h b/src/tweet.h index 34a9cd7..387f73a 100644 --- a/src/tweet.h +++ b/src/tweet.h @@ -14,11 +14,18 @@ namespace twitter { public: tweet(); tweet(std::string data); + tweet(const tweet& other); + tweet(tweet&& other); + ~tweet(); + + tweet& operator=(tweet other); + friend void swap(tweet& first, tweet& second); tweet_id getID() const; std::string getText() const; const user& getAuthor() const; bool isRetweet() const; + tweet getRetweet() const; std::vector> getMentions() const; operator bool() const; @@ -28,7 +35,8 @@ namespace twitter { tweet_id _id; std::string _text; user _author; - bool _retweeted; + bool _is_retweet = false; + tweet* _retweeted_status = nullptr; std::vector> _mentions; }; -- cgit 1.4.1