From 2dcde94625f2ae1af1aef674c2aa1e2bc714d144 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Mon, 3 Dec 2012 23:30:33 +0000 Subject: Don't hide own tweets in streaming mode with fetch_mentions off, and move txs_free() to the right place - fixes a memory leak. --- protocols/twitter/twitter_lib.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'protocols/twitter/twitter_lib.c') diff --git a/protocols/twitter/twitter_lib.c b/protocols/twitter/twitter_lib.c index c7041a68..a8b203bb 100644 --- a/protocols/twitter/twitter_lib.c +++ b/protocols/twitter/twitter_lib.c @@ -813,7 +813,9 @@ static gboolean twitter_stream_handle_object(struct im_connection *ic, json_valu json_value *c; if ((txs = twitter_xt_get_status(o))) { - return twitter_stream_handle_status(ic, txs); + gboolean ret = twitter_stream_handle_status(ic, txs); + txs_free(txs); + return ret; } else if ((c = json_o_get(o, "direct_message")) && (txs = twitter_xt_get_dm(c))) { if (strcmp(txs->user->screen_name, td->user) != 0) @@ -846,12 +848,12 @@ static gboolean twitter_stream_handle_status(struct im_connection *ic, struct tw for (i = 0; i < TWITTER_LOG_LENGTH; i++) { if (td->log[i].id == txs->id) { /* Got a duplicate (RT, probably). Drop it. */ - txs_free(txs); return TRUE; } } - if (!(set_getbool(&ic->acc->set, "fetch_mentions") || + if (!(strcmp(txs->user->screen_name, td->user) == 0 || + set_getbool(&ic->acc->set, "fetch_mentions") || bee_user_by_handle(ic->bee, ic, txs->user->screen_name))) { /* Tweet is from an unknown person and the user does not want to see @mentions, so drop it. twitter_stream_handle_event() @@ -863,7 +865,6 @@ static gboolean twitter_stream_handle_status(struct im_connection *ic, struct tw } twitter_status_show(ic, txs); - txs_free(txs); return TRUE; } -- cgit v1.2.3