aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/bee_chat.c
diff options
context:
space:
mode:
authordequis <dx@dxzone.com.ar>2016-10-16 03:50:49 -0300
committerdequis <dx@dxzone.com.ar>2016-10-16 03:51:53 -0300
commit6e991a9464ce13fb742dcd50a37d5e00084b4233 (patch)
tree8ab635c766d37d6ae06d6caf415fc99be709b3b0 /protocols/bee_chat.c
parenta08b2db9575b276d7e6008e794fa728518671ec4 (diff)
Turn purple_chatlist_free() into a imcb_chat_list_free()
I found myself copypasting this to jabber. Might as well make it part of the API.
Diffstat (limited to 'protocols/bee_chat.c')
-rw-r--r--protocols/bee_chat.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/protocols/bee_chat.c b/protocols/bee_chat.c
index c5f2b262..31b37737 100644
--- a/protocols/bee_chat.c
+++ b/protocols/bee_chat.c
@@ -284,3 +284,20 @@ void bee_chat_list_finish(struct im_connection *ic)
imcb_log(ic, "Warning: using deprecated bee_chat_list_finish. This will be removed in the stable release.");
imcb_chat_list_finish(ic);
}
+
+void imcb_chat_list_free(struct im_connection *ic)
+{
+ bee_chat_info_t *ci;
+ GSList *l = ic->chatlist;
+
+ while (l) {
+ ci = l->data;
+ l = g_slist_delete_link(l, l);
+
+ g_free(ci->title);
+ g_free(ci->topic);
+ g_free(ci);
+ }
+
+ ic->chatlist = NULL;
+}