aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/jabber/jabber_util.c
diff options
context:
space:
mode:
authorSven Moritz Hallberg <pesco@khjk.org>2010-07-11 19:21:21 +0200
committerSven Moritz Hallberg <pesco@khjk.org>2010-07-11 19:21:21 +0200
commiteb6df6a280c458546ebc57126e63a828674b4cd8 (patch)
treeb8eead746fe97b7fb4bcf9a518c452ad87caed65 /protocols/jabber/jabber_util.c
parent37598495deeb42e1cd216a0a4ba8068e4a6da453 (diff)
parent00540d40be63b4db537a661d1a17c49a1790f79c (diff)
merge with upstraem bitlbee 1.2.8
Diffstat (limited to 'protocols/jabber/jabber_util.c')
-rw-r--r--protocols/jabber/jabber_util.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/protocols/jabber/jabber_util.c b/protocols/jabber/jabber_util.c
index b8b625f7..651b7068 100644
--- a/protocols/jabber/jabber_util.c
+++ b/protocols/jabber/jabber_util.c
@@ -664,6 +664,32 @@ int jabber_buddy_remove_bare( struct im_connection *ic, char *bare_jid )
}
}
+static gboolean jabber_buddy_remove_all_cb( gpointer key, gpointer value, gpointer data )
+{
+ struct jabber_buddy *bud, *next;
+
+ bud = value;
+ while( bud )
+ {
+ next = bud->next;
+ g_free( bud->ext_jid );
+ g_free( bud->full_jid );
+ g_free( bud->away_message );
+ g_free( bud );
+ bud = next;
+ }
+
+ return TRUE;
+}
+
+void jabber_buddy_remove_all( struct im_connection *ic )
+{
+ struct jabber_data *jd = ic->proto_data;
+
+ g_hash_table_foreach_remove( jd->buddies, jabber_buddy_remove_all_cb, NULL );
+ g_hash_table_destroy( jd->buddies );
+}
+
time_t jabber_get_timestamp( struct xt_node *xt )
{
struct xt_node *c;