pidgin: 6d613787: jabber/caps: Reorganize for the purpose ..

darkrain42 at pidgin.im darkrain42 at pidgin.im
Wed May 11 00:44:13 EDT 2011


----------------------------------------------------------------------
Revision: 6d613787422d177deecd8246bbbbaa1beb2a539d
Parent:   966a7ce9ff17146829f33951f30743c61727330c
Author:   darkrain42 at pidgin.im
Date:     05/11/11 00:20:12
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/6d613787422d177deecd8246bbbbaa1beb2a539d

Changelog: 

jabber/caps: Reorganize for the purpose of making clang's analyzer happier

Changes against parent 966a7ce9ff17146829f33951f30743c61727330c

  patched  libpurple/protocols/jabber/caps.c

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/caps.c	4838dbd3cd589fb7099183439f189e2a5f224b62
+++ libpurple/protocols/jabber/caps.c	6621a1aa9502eb19a737a7df1576fa81bea6d02b
@@ -285,34 +285,36 @@ jabber_caps_load(void)
 					 * work properly, that bug needs to be fixed in
 					 * xmlnode_from_str, not the output version... */
 					value->forms = g_list_append(value->forms, xmlnode_copy(child));
-				} else if (g_str_equal(child->name, "ext") && key->hash != NULL) {
-					purple_debug_warning("jabber", "Ignoring exts when reading new-style caps\n");
 				} else if (g_str_equal(child->name, "ext")) {
-					/* TODO: Do we care about reading in the identities listed here? */
-					const char *identifier = xmlnode_get_attrib(child, "identifier");
-					xmlnode *node;
-					GList *features = NULL;
+					if (key->hash != NULL)
+						purple_debug_warning("jabber", "Ignoring exts when reading new-style caps\n");
+					else {
+						/* TODO: Do we care about reading in the identities listed here? */
+						const char *identifier = xmlnode_get_attrib(child, "identifier");
+						xmlnode *node;
+						GList *features = NULL;
 
-					if (!identifier)
-						continue;
+						if (!identifier)
+							continue;
 
-					for (node = child->child; node; node = node->next) {
-						if (node->type != XMLNODE_TYPE_TAG)
-							continue;
-						if (g_str_equal(node->name, "feature")) {
-							const char *var = xmlnode_get_attrib(node, "var");
-							if (!var)
+						for (node = child->child; node; node = node->next) {
+							if (node->type != XMLNODE_TYPE_TAG)
 								continue;
-							features = g_list_prepend(features, g_strdup(var));
+							if (g_str_equal(node->name, "feature")) {
+								const char *var = xmlnode_get_attrib(node, "var");
+								if (!var)
+									continue;
+								features = g_list_prepend(features, g_strdup(var));
+							}
 						}
-					}
 
-					if (features) {
-						g_hash_table_insert(exts->exts, g_strdup(identifier),
-						                    features);
-					} else
-						purple_debug_warning("jabber", "Caps ext %s had no features.\n",
-						                     identifier);
+						if (features) {
+							g_hash_table_insert(exts->exts, g_strdup(identifier),
+							                    features);
+						} else
+							purple_debug_warning("jabber", "Caps ext %s had no features.\n",
+							                     identifier);
+					}
 				}
 			}
 


More information about the Commits mailing list