aboutsummaryrefslogtreecommitdiffstats
path: root/protocols
diff options
context:
space:
mode:
Diffstat (limited to 'protocols')
-rw-r--r--protocols/twitter/twitter.c6
-rw-r--r--protocols/twitter/twitter_lib.c12
2 files changed, 10 insertions, 8 deletions
diff --git a/protocols/twitter/twitter.c b/protocols/twitter/twitter.c
index e543f86e..4fe509bb 100644
--- a/protocols/twitter/twitter.c
+++ b/protocols/twitter/twitter.c
@@ -686,6 +686,12 @@ static void twitter_logout(struct im_connection *ic)
b_event_remove(td->filter_update_id);
}
+ g_slist_foreach(td->mutes_ids, (GFunc) g_free, NULL);
+ g_slist_free(td->mutes_ids);
+
+ g_slist_foreach(td->noretweets_ids, (GFunc) g_free, NULL);
+ g_slist_free(td->noretweets_ids);
+
http_close(td->stream);
twitter_filter_remove_all(ic);
oauth_info_free(td->oauth_info);
diff --git a/protocols/twitter/twitter_lib.c b/protocols/twitter/twitter_lib.c
index 82765201..77f487ae 100644
--- a/protocols/twitter/twitter_lib.c
+++ b/protocols/twitter/twitter_lib.c
@@ -954,13 +954,7 @@ static void twitter_status_show(struct im_connection *ic, struct twitter_xml_sta
/* Check this is not a tweet that should be muted */
uid_str = g_strdup_printf("%" PRIu64, status->user->uid);
- if (getenv("BITLBEE_DEBUG")) {
- GSList *item;
- fprintf(stderr, "Checking mutes; this uid=%s\n", uid_str);
- for (item = td->mutes_ids; item != NULL; item = item->next) {
- fprintf(stderr, " id: %s\n", (char *)item->data);
- }
- }
+
if (g_slist_find_custom(td->mutes_ids, uid_str, (GCompareFunc)strcmp)) {
g_free(uid_str);
return;
@@ -1163,7 +1157,9 @@ static gboolean twitter_stream_handle_event(struct im_connection *ic, json_value
uid_str = g_strdup_printf("%" PRIu64, ut->uid);
if ((found = g_slist_find_custom(td->mutes_ids, uid_str,
(GCompareFunc)strcmp))) {
- td->mutes_ids = g_slist_remove(td->mutes_ids, found);
+ char *found_str = found->data;
+ td->mutes_ids = g_slist_delete_link(td->mutes_ids, found);
+ g_free(found_str);
}
g_free(uid_str);
twitter_log(ic, "Unmuted user %s", ut->screen_name);