cpw.darkrain42.xmpp.bosh: 09bced22: constify, ifdef out an old-caps remnant, ...

paul at darkrain42.org paul at darkrain42.org
Sat Jan 17 23:51:19 EST 2009


-----------------------------------------------------------------
Revision: 09bced2216f966a46e67ed881660aeb1b796afe9
Ancestor: 5a05b9bb5b31a1eb9c6633f8e214a45315f24d43
Author: paul at darkrain42.org
Date: 2008-11-21T08:28:50
Branch: im.pidgin.cpw.darkrain42.xmpp.bosh
URL: http://d.pidgin.im/viewmtn/revision/info/09bced2216f966a46e67ed881660aeb1b796afe9

Modified files:
        libpurple/protocols/jabber/caps.h
        libpurple/protocols/jabber/jabber.c

ChangeLog: 

constify, ifdef out an old-caps remnant, and rewrite a little

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/caps.h	7dce8ca9f4d56119c2ccd3fb474693bc538b19b3
+++ libpurple/protocols/jabber/caps.h	117a01db83012832600d1d277219ceb4d72f69c4
@@ -37,7 +37,9 @@ struct _JabberCapsClientInfo {
 	GList *forms; /* xmlnode * */
 };
 
+#if 0
 typedef struct _JabberCapsClientInfo JabberCapsValueExt;
+#endif
 
 typedef struct _JabberDataFormField {
 	gchar *var;
============================================================
--- libpurple/protocols/jabber/jabber.c	b2a3be597ea57a78fc8c0d84c566fc738620288e
+++ libpurple/protocols/jabber/jabber.c	ba4c9994a3e3992660f300ac5ee7957c53f7a3c5
@@ -2552,27 +2552,26 @@ static gboolean
  * @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();
 }
 


More information about the Commits mailing list