diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-05-22 19:21:00 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-05-22 19:21:00 -0400 |
commit | 62f6aae6c313b2a2a493c5147ec831a66eba01ff (patch) | |
tree | a69adb7516ed3c54f3291dae14a582ecb9d0d5b2 /src/client.cpp | |
parent | cdea9154ff180e95dfbdd8e0647922ca8afa3d46 (diff) | |
download | libtwittercpp-62f6aae6c313b2a2a493c5147ec831a66eba01ff.tar.gz libtwittercpp-62f6aae6c313b2a2a493c5147ec831a66eba01ff.tar.bz2 libtwittercpp-62f6aae6c313b2a2a493c5147ec831a66eba01ff.zip |
Added utility function to generate tweet reply prefill
Diffstat (limited to 'src/client.cpp')
-rw-r--r-- | src/client.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
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 { | |||
420 | _user_stream.stop(); | 420 | _user_stream.stop(); |
421 | } | 421 | } |
422 | 422 | ||
423 | std::string client::generateReplyPrefill(tweet _tweet) const | ||
424 | { | ||
425 | std::ostringstream output; | ||
426 | output << "@" << _tweet.getAuthor().getScreenName() << " "; | ||
427 | |||
428 | for (auto mention : _tweet.getMentions()) | ||
429 | { | ||
430 | if ((mention.first != _tweet.getAuthor().getID()) && (mention.first != _current_user.getID())) | ||
431 | { | ||
432 | output << "@" << mention.second << " "; | ||
433 | } | ||
434 | } | ||
435 | |||
436 | return output.str(); | ||
437 | } | ||
438 | |||
423 | bool client::performGet(std::string url, long& response_code, std::string& result) | 439 | bool client::performGet(std::string url, long& response_code, std::string& result) |
424 | { | 440 | { |
425 | std::ostringstream output; | 441 | std::ostringstream output; |