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 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'snitch.cpp') 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)); -- cgit 1.4.1