From 4cf78a6371b4df02242bb055b8e15d9c9223dbb0 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Wed, 14 Dec 2016 02:16:27 -0500 Subject: Fixed bot ignoring non-reply tweets --- snitch.cpp | 8 ++++---- vendor/libtwittercpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/snitch.cpp b/snitch.cpp index 3758dc0..1155da7 100644 --- a/snitch.cpp +++ b/snitch.cpp @@ -73,7 +73,7 @@ int main(int argc, char** argv) try { long media_id = client.uploadMedia("image/jpeg", (const char*) img_buf, img_len); - client.replyToTweet(n.getTweet().generateReplyPrefill(), n.getTweet().getID(), {media_id}); + client.replyToTweet(n.getTweet().generateReplyPrefill(client.getUser()), n.getTweet().getID(), {media_id}); } catch (const twitter::twitter_error& e) { std::cout << "Twitter error: " << e.what() << std::endl; @@ -87,7 +87,7 @@ int main(int argc, char** argv) { try { - n.getUser().follow(); + client.follow(n.getUser()); } catch (const twitter::twitter_error& e) { std::cout << "Twitter error while following @" << n.getUser().getScreenName() << ": " << e.what() << std::endl; @@ -101,8 +101,8 @@ int main(int argc, char** argv) try { - std::set friends = client.getUser().getFriends(); - std::set followers = client.getUser().getFollowers(); + std::set friends = client.getFriends(); + std::set followers = client.getFollowers(); std::list old_friends, new_followers; std::set_difference(std::begin(friends), std::end(friends), std::begin(followers), std::end(followers), std::back_inserter(old_friends)); 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