about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ebooks.cpp8
m---------vendor/libtwittercpp0
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