about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2016-05-22 19:21:36 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2016-05-22 19:21:36 -0400
commitf814c466e575ebf8e43cd1ff6b7fcb346e237cd7 (patch)
treec1d4d28455873427dd3384177454f4380cf1fa88
parente235bef2ece2543d440973a7367dc3ad0ba40f32 (diff)
downloadrawr-ebooks-f814c466e575ebf8e43cd1ff6b7fcb346e237cd7.tar.gz
rawr-ebooks-f814c466e575ebf8e43cd1ff6b7fcb346e237cd7.tar.bz2
rawr-ebooks-f814c466e575ebf8e43cd1ff6b7fcb346e237cd7.zip
ebooks now prefills replies correctly
It also now does not reply to itself.
-rw-r--r--ebooks.cpp4
m---------vendor/libtwittercpp0
2 files changed, 2 insertions, 2 deletions
diff --git a/ebooks.cpp b/ebooks.cpp index c01cdc9..8b567ed 100644 --- a/ebooks.cpp +++ b/ebooks.cpp
@@ -79,7 +79,7 @@ int main(int argc, char** args)
79 client.setUserStreamNotifyCallback([&] (twitter::notification n) { 79 client.setUserStreamNotifyCallback([&] (twitter::notification n) {
80 if (n.getType() == twitter::notification::type::tweet) 80 if (n.getType() == twitter::notification::type::tweet)
81 { 81 {
82 if (!n.getTweet().isRetweet()) 82 if ((!n.getTweet().isRetweet()) && (n.getTweet().getAuthor() != client.getUser()))
83 { 83 {
84 std::string original = n.getTweet().getText(); 84 std::string original = n.getTweet().getText();
85 std::string canonical; 85 std::string canonical;
@@ -89,7 +89,7 @@ int main(int argc, char** args)
89 89
90 if (canonical.find("@rawr_ebooks") != std::string::npos) 90 if (canonical.find("@rawr_ebooks") != std::string::npos)
91 { 91 {
92 std::string doc = "@" + n.getTweet().getAuthor().getScreenName() + " "; 92 std::string doc = client.generateReplyPrefill(n.getTweet());
93 { 93 {
94 std::lock_guard<std::mutex> stats_lock(stats_mutex); 94 std::lock_guard<std::mutex> stats_lock(stats_mutex);
95 doc += kgramstats.randomSentence(140 - doc.length()); 95 doc += kgramstats.randomSentence(140 - doc.length());
diff --git a/vendor/libtwittercpp b/vendor/libtwittercpp
Subproject cdea9154ff180e95dfbdd8e0647922ca8afa3d4 Subproject 62f6aae6c313b2a2a493c5147ec831a66eba01f