diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-12-01 08:49:48 -0500 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-12-01 08:49:48 -0500 |
commit | f0e420809011075f6fa8cfb7ab32b6b5b8d3d02b (patch) | |
tree | e464e707e26307828319da856a0172397220a04d | |
parent | ba25493b55b4e4e35de3fca69afd15ddcbaa545c (diff) | |
download | rawr-ebooks-f0e420809011075f6fa8cfb7ab32b6b5b8d3d02b.tar.gz rawr-ebooks-f0e420809011075f6fa8cfb7ab32b6b5b8d3d02b.tar.bz2 rawr-ebooks-f0e420809011075f6fa8cfb7ab32b6b5b8d3d02b.zip |
Updated libtwitter++ to fix non-reply tweets being ignored
-rw-r--r-- | ebooks.cpp | 8 | ||||
m--------- | vendor/libtwittercpp | 0 |
2 files changed, 4 insertions, 4 deletions
diff --git a/ebooks.cpp b/ebooks.cpp index dd4e27b..1dfd474 100644 --- a/ebooks.cpp +++ b/ebooks.cpp | |||
@@ -75,10 +75,10 @@ int main(int argc, char** args) | |||
75 | return form; | 75 | return form; |
76 | }); | 76 | }); |
77 | 77 | ||
78 | twitter::stream user_stream(client, [&kgramstats] (const twitter::notification& n) { | 78 | twitter::stream user_stream(client, [&kgramstats, &client] (const twitter::notification& n) { |
79 | if (n.getType() == twitter::notification::type::tweet) | 79 | if (n.getType() == twitter::notification::type::tweet) |
80 | { | 80 | { |
81 | if ((!n.getTweet().isRetweet()) && (!n.getTweet().isMyTweet())) | 81 | if ((!n.getTweet().isRetweet()) && (n.getTweet().getAuthor() != client.getUser())) |
82 | { | 82 | { |
83 | std::string original = n.getTweet().getText(); | 83 | std::string original = n.getTweet().getText(); |
84 | std::string canonical; | 84 | std::string canonical; |
@@ -88,13 +88,13 @@ int main(int argc, char** args) | |||
88 | 88 | ||
89 | if (canonical.find("@rawr_ebooks") != std::string::npos) | 89 | if (canonical.find("@rawr_ebooks") != std::string::npos) |
90 | { | 90 | { |
91 | std::string doc = n.getTweet().generateReplyPrefill(); | 91 | std::string doc = n.getTweet().generateReplyPrefill(client.getUser()); |
92 | doc += kgramstats.randomSentence(140 - doc.length()); | 92 | doc += kgramstats.randomSentence(140 - doc.length()); |
93 | doc.resize(140); | 93 | doc.resize(140); |
94 | 94 | ||
95 | try | 95 | try |
96 | { | 96 | { |
97 | n.getTweet().reply(doc); | 97 | client.replyToTweet(doc, n.getTweet()); |
98 | } catch (const twitter::twitter_error& error) | 98 | } catch (const twitter::twitter_error& error) |
99 | { | 99 | { |
100 | std::cout << "Twitter error while tweeting: " << error.what() << std::endl; | 100 | std::cout << "Twitter error while tweeting: " << error.what() << std::endl; |
diff --git a/vendor/libtwittercpp b/vendor/libtwittercpp | |||
Subproject d90a1e74c77ba67f25a812609fd49d479bc464d | Subproject d783c17151a98466e304b1e5f33bfca0be885fd | ||