From 62f6aae6c313b2a2a493c5147ec831a66eba01ff Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sun, 22 May 2016 19:21:00 -0400 Subject: Added utility function to generate tweet reply prefill --- src/client.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/client.cpp') diff --git a/src/client.cpp b/src/client.cpp index bae563f..617af62 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -420,6 +420,22 @@ namespace twitter { _user_stream.stop(); } + std::string client::generateReplyPrefill(tweet _tweet) const + { + std::ostringstream output; + output << "@" << _tweet.getAuthor().getScreenName() << " "; + + for (auto mention : _tweet.getMentions()) + { + if ((mention.first != _tweet.getAuthor().getID()) && (mention.first != _current_user.getID())) + { + output << "@" << mention.second << " "; + } + } + + return output.str(); + } + bool client::performGet(std::string url, long& response_code, std::string& result) { std::ostringstream output; -- cgit 1.4.1