# HG changeset patch # User Paul Aurich # Date 1227256130 0 # Node ID 504c98a90ef59a0b76a4bad52213307c2bb72e77 # Parent 1eeeb33ed02123f45ed76068d6189f8f37706242 constify, ifdef out an old-caps remnant, and rewrite a little diff -r 1eeeb33ed021 -r 504c98a90ef5 libpurple/protocols/jabber/caps.h --- a/libpurple/protocols/jabber/caps.h Fri Nov 21 08:04:09 2008 +0000 +++ b/libpurple/protocols/jabber/caps.h Fri Nov 21 08:28:50 2008 +0000 @@ -37,7 +37,9 @@ GList *forms; /* xmlnode * */ }; +#if 0 typedef struct _JabberCapsClientInfo JabberCapsValueExt; +#endif typedef struct _JabberDataFormField { gchar *var; diff -r 1eeeb33ed021 -r 504c98a90ef5 libpurple/protocols/jabber/jabber.c --- a/libpurple/protocols/jabber/jabber.c Fri Nov 21 08:04:09 2008 +0000 +++ b/libpurple/protocols/jabber/jabber.c Fri Nov 21 08:28:50 2008 +0000 @@ -2552,27 +2552,26 @@ * @return TRUE if supports feature; else FALSE. */ static gboolean -jabber_ipc_contact_has_feature(gchar *fulljid, gchar *feature) +jabber_ipc_contact_has_feature(const gchar *fulljid, const gchar *feature) { - JabberCapsKey *caps_info = NULL; - JabberCapsValueExt *capabilities = NULL; - - caps_info = g_hash_table_lookup(jabber_contact_info, fulljid); - - if (!caps_info) return FALSE; - capabilities = g_hash_table_lookup(capstable, caps_info); - - if (g_list_find_custom(capabilities->features, feature, (GCompareFunc)strcmp) == NULL) return FALSE ; - return TRUE; + gpointer caps_hash = g_hash_table_lookup(jabber_contact_info, fulljid); + JabberCapsClientInfo *capabilities; + + if (!caps_hash) + return FALSE; + + capabilities = g_hash_table_lookup(capstable, caps_hash); + return g_list_find_custom(capabilities->features, feature, (GCompareFunc)strcmp) != NULL; } static void -jabber_ipc_add_feature(gchar *feature) +jabber_ipc_add_feature(const gchar *feature) { - if (feature == 0) return; + if (!feature) + return; jabber_add_feature(feature, 0); - - // send presence with new caps info for all connected accounts + + /* send presence with new caps info for all connected accounts */ jabber_caps_broadcast_change(); }