diff options
Diffstat (limited to 'insult.cpp')
-rw-r--r-- | insult.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/insult.cpp b/insult.cpp index 6c60f72..db4f920 100644 --- a/insult.cpp +++ b/insult.cpp | |||
@@ -34,17 +34,20 @@ int main(int argc, char** argv) | |||
34 | 34 | ||
35 | try | 35 | try |
36 | { | 36 | { |
37 | std::set<twitter::user_id> blocks = client.getBlocks(); | ||
38 | |||
37 | verbly::database database(config["verbly_datafile"].as<std::string>()); | 39 | verbly::database database(config["verbly_datafile"].as<std::string>()); |
38 | patterner pgen(config["forms_file"].as<std::string>(), database, rng); | 40 | patterner pgen(config["forms_file"].as<std::string>(), database, rng); |
39 | 41 | ||
40 | std::cout << "Starting streaming..." << std::endl; | 42 | std::cout << "Starting streaming..." << std::endl; |
41 | 43 | ||
42 | twitter::stream userStream(client, [&pgen, &client] | 44 | twitter::stream userStream(client, [&pgen, &client, &blocks] |
43 | (const twitter::notification& n) { | 45 | (const twitter::notification& n) { |
44 | if (n.getType() == twitter::notification::type::tweet) | 46 | if (n.getType() == twitter::notification::type::tweet) |
45 | { | 47 | { |
46 | if ((!n.getTweet().isRetweet()) | 48 | if ((!n.getTweet().isRetweet()) |
47 | && (n.getTweet().getAuthor() != client.getUser())) | 49 | && (n.getTweet().getAuthor() != client.getUser()) |
50 | && (!blocks.count(n.getTweet().getAuthor().getID()))) | ||
48 | { | 51 | { |
49 | std::string original = n.getTweet().getText(); | 52 | std::string original = n.getTweet().getText(); |
50 | std::string canonical; | 53 | std::string canonical; |