# HG changeset patch # User Sean Egan # Date 1136331089 0 # Node ID 495856ce025b65d3b6b8bf10a7332e8e3378170e # Parent 0438f853fc89f87cfc85ef072f93b14acb19ee8f [gaim-migrate @ 15052] g_hash_table_find is only in 2.4 or later. committer: Tailor Script diff -r 0438f853fc89 -r 495856ce025b src/protocols/bonjour/jabber.c --- a/src/protocols/bonjour/jabber.c Tue Jan 03 22:44:41 2006 +0000 +++ b/src/protocols/bonjour/jabber.c Tue Jan 03 23:31:29 2006 +0000 @@ -218,21 +218,21 @@ g_free(html_body); } -static gboolean -_check_buddy_by_address(gpointer key, gpointer value, gpointer address) +struct _check_buddy_by_address_t { + char *address; + GaimBuddy **gb; +}; + +static void +_check_buddy_by_address(gpointer key, gpointer value, gpointer data) { GaimBuddy *gb = (GaimBuddy*)value; BonjourBuddy *bb = (BonjourBuddy*)gb->proto_data; + struct _check_buddy_by_address_t *d = (struct _check_buddy_by_address_t *)data; - if (bb != NULL) - { - if (g_strcasecmp(bb->ip, (char*)address) == 0) { - return TRUE; - } else { - return FALSE; - } - } else { - return FALSE; + if (bb != NULL) { + if (g_strcasecmp(bb->ip, (char*)d->address) == 0) + *(d->gb) = gb; } } @@ -386,7 +386,11 @@ /* Look for the buddy that has open the conversation and fill information */ address_text = inet_ntoa(their_addr.sin_addr); - gb = (GaimBuddy*)g_hash_table_find(bl->buddies, _check_buddy_by_address, address_text); + struct _check_buddy_by_address_t *cbba = g_new0(struct _check_buddy_by_address_t, 1); + cbba->address = address_text; + cbba->gb = &gb; + g_hash_table_foreach(bl->buddies, _check_buddy_by_address, address_text); + g_free(cbba); if (gb == NULL) { gaim_debug_info("bonjour", "We don't like invisible buddies, this is not a superheros comic\n");