From f0e420809011075f6fa8cfb7ab32b6b5b8d3d02b Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Thu, 1 Dec 2016 08:49:48 -0500 Subject: Updated libtwitter++ to fix non-reply tweets being ignored --- ebooks.cpp | 8 ++++---- vendor/libtwittercpp | 2 +- 2 files changed, 5 insertions(+), 5 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) return form; }); - twitter::stream user_stream(client, [&kgramstats] (const twitter::notification& n) { + twitter::stream user_stream(client, [&kgramstats, &client] (const twitter::notification& n) { if (n.getType() == twitter::notification::type::tweet) { - if ((!n.getTweet().isRetweet()) && (!n.getTweet().isMyTweet())) + if ((!n.getTweet().isRetweet()) && (n.getTweet().getAuthor() != client.getUser())) { std::string original = n.getTweet().getText(); std::string canonical; @@ -88,13 +88,13 @@ int main(int argc, char** args) if (canonical.find("@rawr_ebooks") != std::string::npos) { - std::string doc = n.getTweet().generateReplyPrefill(); + std::string doc = n.getTweet().generateReplyPrefill(client.getUser()); doc += kgramstats.randomSentence(140 - doc.length()); doc.resize(140); try { - n.getTweet().reply(doc); + client.replyToTweet(doc, n.getTweet()); } catch (const twitter::twitter_error& error) { std::cout << "Twitter error while tweeting: " << error.what() << std::endl; diff --git a/vendor/libtwittercpp b/vendor/libtwittercpp index d90a1e7..d783c17 160000 --- a/vendor/libtwittercpp +++ b/vendor/libtwittercpp @@ -1 +1 @@ -Subproject commit d90a1e74c77ba67f25a812609fd49d479bc464dd +Subproject commit d783c17151a98466e304b1e5f33bfca0be885fd8 -- cgit 1.4.1