# HG changeset patch # User Mikael Berthe # Date 1203971947 -3600 # Node ID c5d937d5530b5678ac12ecb8b725aee667209bcb # Parent 071c8170b7de1ea782eaa99b10c040544cc1ed6a g_hash_table_get_keys() is only in glib >= 2.14 This patch replaces g_hash_table_get_keys() with a foreach loop. diff -r 071c8170b7de -r c5d937d5530b mcabber/src/roster.c --- a/mcabber/src/roster.c Mon Feb 25 20:27:56 2008 +0100 +++ b/mcabber/src/roster.c Mon Feb 25 21:39:07 2008 +0100 @@ -1556,15 +1556,29 @@ return g_hash_table_remove(unread_jids, jid); } +// Helper function for unread_jid_get_list() +static void add_to_unreadjids(gpointer key, gpointer value, gpointer udata) +{ + GList **listp = udata; + *listp = g_list_append(*listp, key); +} + // unread_jid_get_list() // Return the JID list. // The content of the list should not be modified or freed. // The caller should call g_list_free() after use. GList *unread_jid_get_list(void) { + GList *list = NULL; + if (!unread_jids) return NULL; - return g_hash_table_get_keys(unread_jids); + + // g_hash_table_get_keys() is only in glib >= 2.14 + //return g_hash_table_get_keys(unread_jids); + + g_hash_table_foreach(unread_jids, add_to_unreadjids, &list); + return list; } /* vim: set expandtab cindent cinoptions=>2\:2(0: For Vim users... */