aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/twitter/twitter_lib.c
diff options
context:
space:
mode:
authorMarius Halden <marius.h@lden.org>2016-08-01 14:03:38 +0200
committerMarius Halden <marius.h@lden.org>2016-08-01 14:03:38 +0200
commitd68cb991f84498ecc54ae9f3c542f3201beab001 (patch)
tree5026eabdc49cb82a6ee14a6cb93694fdc406a108 /protocols/twitter/twitter_lib.c
parentf02b57f2ed850f163c068ecaa144640e9f8e011a (diff)
Ignore dm from blocked users
Diffstat (limited to 'protocols/twitter/twitter_lib.c')
-rw-r--r--protocols/twitter/twitter_lib.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/protocols/twitter/twitter_lib.c b/protocols/twitter/twitter_lib.c
index 0201aff2..e4cb7257 100644
--- a/protocols/twitter/twitter_lib.c
+++ b/protocols/twitter/twitter_lib.c
@@ -1161,8 +1161,12 @@ static gboolean twitter_stream_handle_object(struct im_connection *ic, json_valu
} else if ((c = json_o_get(o, "direct_message")) &&
(txs = twitter_xt_get_dm(c))) {
if (g_strcasecmp(txs->user->screen_name, td->user) != 0) {
- imcb_buddy_msg(ic, txs->user->screen_name,
- txs->text, 0, txs->created_at);
+ char *uid_str = g_strdup_printf("%" PRIu64, txs->user->uid);
+ if (!g_slist_find_custom(td->blocks_ids, uid_str, (GCompareFunc)strcmp)) {
+ imcb_buddy_msg(ic, txs->user->screen_name,
+ txs->text, 0, txs->created_at);
+ }
+ g_free(uid_str);
}
txs_free(txs);
return TRUE;