aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/twitter/twitter.c
diff options
context:
space:
mode:
authorMarius Halden <marius.h@lden.org>2016-08-01 18:28:59 +0200
committerMarius Halden <marius.h@lden.org>2016-08-01 18:28:59 +0200
commit71feefea6f354637e633e0136aff15b688c6e305 (patch)
treee14068905f898ffd92379d5e216631653ad99841 /protocols/twitter/twitter.c
parentd68cb991f84498ecc54ae9f3c542f3201beab001 (diff)
Turn some lists into hashtables
Diffstat (limited to 'protocols/twitter/twitter.c')
-rw-r--r--protocols/twitter/twitter.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/protocols/twitter/twitter.c b/protocols/twitter/twitter.c
index c1f54681..468f9eaa 100644
--- a/protocols/twitter/twitter.c
+++ b/protocols/twitter/twitter.c
@@ -350,6 +350,7 @@ void twitter_login_finish(struct im_connection *ic)
} else if (!(td->flags & TWITTER_MODE_ONE) &&
!(td->flags & TWITTER_HAVE_FRIENDS)) {
imcb_log(ic, "Getting contact list");
+
twitter_get_friends_ids(ic, -1);
twitter_get_mutes_ids(ic, -1);
twitter_get_blocks_ids(ic, -1);
@@ -711,6 +712,10 @@ static void twitter_login(account_t * acc)
td->flags |= TWITTER_MODE_CHAT;
}
+ td->mutes_ids = g_hash_table_new_full(g_str_hash, (GEqualFunc)strcmp, (GDestroyNotify)g_free, NULL);
+ td->blocks_ids = g_hash_table_new_full(g_str_hash, (GEqualFunc)strcmp, (GDestroyNotify)g_free, NULL);
+ td->noretweets_ids = g_hash_table_new_full(g_str_hash, (GEqualFunc)strcmp, (GDestroyNotify)g_free, NULL);
+
twitter_login_finish(ic);
}
@@ -736,14 +741,9 @@ 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->blocks_ids, (GFunc) g_free, NULL);
- g_slist_free(td->blocks_ids);
-
- g_slist_foreach(td->noretweets_ids, (GFunc) g_free, NULL);
- g_slist_free(td->noretweets_ids);
+ g_hash_table_unref(td->mutes_ids);
+ g_hash_table_unref(td->blocks_ids);
+ g_hash_table_unref(td->noretweets_ids);
http_close(td->stream);
twitter_filter_remove_all(ic);