libpurple/protocols/jabber/buddy.c

branch
cpw.resiak.disconnectreason
changeset 21503
b3cad646ba4a
parent 21281
3cfa8d1bffab
parent 21453
a90cf329cd48
child 21630
591a79c1b295
--- a/libpurple/protocols/jabber/buddy.c	Wed Nov 07 11:23:03 2007 +0000
+++ b/libpurple/protocols/jabber/buddy.c	Sat Nov 10 12:10:04 2007 +0000
@@ -279,7 +279,7 @@
 	char *tag;			/* tag text */
 	char *ptag;			/* parent tag "path" text */
 	char *url;			/* vCard display format if URL */
-} vcard_template_data[] = {
+} const vcard_template_data[] = {
 	{N_("Full Name"),          NULL, TRUE, TRUE, "FN",        NULL,  NULL},
 	{N_("Family Name"),        NULL, TRUE, TRUE, "FAMILY",    "N",   NULL},
 	{N_("Given Name"),         NULL, TRUE, TRUE, "GIVEN",     "N",   NULL},
@@ -311,7 +311,7 @@
 struct tag_attr {
 	char *attr;
 	char *value;
-} vcard_tag_attr_list[] = {
+} const vcard_tag_attr_list[] = {
 	{"prodid",   "-//HandGen//NONSGML vGen v1.0//EN"},
 	{"version",  "2.0",                             },
 	{"xmlns",    "vcard-temp",                      },
@@ -337,7 +337,7 @@
 	 * from the vCard template struct.
 	 */
 	if(parent_tag == NULL) {
-		struct vcard_template *vc_tp = vcard_template_data;
+		const struct vcard_template *vc_tp = vcard_template_data;
 
 		while(vc_tp->label != NULL) {
 			if(strcmp(vc_tp->tag, new_tag) == 0) {
@@ -395,7 +395,7 @@
 	JabberIq *iq;
 	JabberStream *js = gc->proto_data;
 	xmlnode *vc_node;
-	struct tag_attr *tag_attr;
+	const struct tag_attr *tag_attr;
 
 	/* if we have't grabbed the remote vcard yet, we can't
 	 * assume that what we have here is correct */
@@ -614,7 +614,7 @@
 	const char *text;
 	char *p;
 	const struct vcard_template *vc_tp;
-	struct tag_attr *tag_attr;
+	const struct tag_attr *tag_attr;
 
 	vc_node = xmlnode_new("vCard");
 
@@ -2252,6 +2252,16 @@
 	xmlnode *query;
 	JabberIq *iq;
 	char *dir_server = data;
+	const char *type;
+
+	/* if they've cancelled the search, we're
+	 * just going to get an error if we send
+	 * a cancel, so skip it */
+	type = xmlnode_get_attrib(result, "type");
+	if(type && !strcmp(type, "cancel")) {
+		g_free(dir_server);
+		return;
+	}
 
 	iq = jabber_iq_new_query(js, JABBER_IQ_SET, "jabber:iq:search");
 	query = xmlnode_get_child(iq->node, "query");

mercurial