From d68cb991f84498ecc54ae9f3c542f3201beab001 Mon Sep 17 00:00:00 2001 From: Marius Halden Date: Mon, 1 Aug 2016 14:03:38 +0200 Subject: Ignore dm from blocked users --- protocols/twitter/twitter_lib.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'protocols') 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; -- cgit v1.2.3