diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2012-12-03 23:30:33 +0000 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2012-12-03 23:30:33 +0000 |
commit | 2dcde94625f2ae1af1aef674c2aa1e2bc714d144 (patch) | |
tree | ac148e8a1ad35c2b7b491b91479c9443685d5e91 | |
parent | 3ca001bcb054e861ef9ad6e818fbb6615a519804 (diff) |
Don't hide own tweets in streaming mode with fetch_mentions off, and move
txs_free() to the right place - fixes a memory leak.
-rw-r--r-- | protocols/twitter/twitter_lib.c | 9 |
1 files changed, 5 insertions, 4 deletions
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; } |