diff libpurple/protocols/jabber/presence.c @ 29031:9ae3e70a327b

jabber: More namespaces! This is a good stopping point for now.
author Paul Aurich <paul@darkrain42.org>
date Fri, 27 Nov 2009 17:07:19 +0000
parents 96ba7fd24177
children 31497213393c 5b449584fead c4f836780e1c
line wrap: on
line diff
--- a/libpurple/protocols/jabber/presence.c	Fri Nov 27 16:21:29 2009 +0000
+++ b/libpurple/protocols/jabber/presence.c	Fri Nov 27 17:07:19 2009 +0000
@@ -297,7 +297,7 @@
 		gchar seconds[10];
 		g_snprintf(seconds, 10, "%d", (int) (time(NULL) - js->idle));
 
-		xmlnode_set_namespace(query, "jabber:iq:last");
+		xmlnode_set_namespace(query, NS_LAST_ACTIVITY);
 		xmlnode_set_attrib(query, "seconds", seconds);
 	}
 
@@ -462,8 +462,8 @@
 		goto out;
 
 	if (!jbr->commands_fetched && jabber_resource_has_capability(jbr, "http://jabber.org/protocol/commands")) {
-		JabberIq *iq = jabber_iq_new_query(userdata->js, JABBER_IQ_GET, "http://jabber.org/protocol/disco#items");
-		xmlnode *query = xmlnode_get_child_with_namespace(iq->node, "query", "http://jabber.org/protocol/disco#items");
+		JabberIq *iq = jabber_iq_new_query(userdata->js, JABBER_IQ_GET, NS_DISCO_ITEMS);
+		xmlnode *query = xmlnode_get_child_with_namespace(iq->node, "query", NS_DISCO_ITEMS);
 		xmlnode_set_attrib(iq->node, "to", userdata->from);
 		xmlnode_set_attrib(query, "node", "http://jabber.org/protocol/commands");
 		jabber_iq_set_callback(iq, jabber_adhoc_disco_result_cb, NULL);
@@ -655,7 +655,7 @@
 				}
 			}
 		} else if (!strcmp(y->name, "query") &&
-			!strcmp(xmlnode_get_namespace(y), "jabber:iq:last")) {
+			!strcmp(xmlnode_get_namespace(y), NS_LAST_ACTIVITY)) {
 			/* resource has specified idle */
 			const gchar *seconds = xmlnode_get_attrib(y, "seconds");
 			if (seconds) {