pidgin: 8dbd11fe: jabber: Start putting all the namespaces...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Fri Nov 27 02:21:00 EST 2009


-----------------------------------------------------------------
Revision: 8dbd11fef62ff86c44ca7059674569c1414c9079
Ancestor: f7ead5868ef258537d84e4d3c48bd353bbc79341
Author: darkrain42 at pidgin.im
Date: 2009-11-26T22:35:07
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/8dbd11fef62ff86c44ca7059674569c1414c9079

Modified files:
        libpurple/protocols/jabber/data.c
        libpurple/protocols/jabber/data.h
        libpurple/protocols/jabber/disco.c
        libpurple/protocols/jabber/google.c
        libpurple/protocols/jabber/google.h
        libpurple/protocols/jabber/ibb.c
        libpurple/protocols/jabber/ibb.h
        libpurple/protocols/jabber/iq.c
        libpurple/protocols/jabber/jabber.c
        libpurple/protocols/jabber/jabber.h
        libpurple/protocols/jabber/message.c
        libpurple/protocols/jabber/message.h
        libpurple/protocols/jabber/ping.c
        libpurple/protocols/jabber/si.c
        libpurple/protocols/jabber/useravatar.h

ChangeLog: 

jabber: Start putting all the namespaces in one location with consistent naming.

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/data.c	8eb224bba182e7774187a2321d2c1469248c3b75
+++ libpurple/protocols/jabber/data.c	21eab265ddcc9e3640b7839d29e8bc453cf240d7
@@ -140,7 +140,7 @@ jabber_data_get_xml_definition(const Jab
 	xmlnode *tag = xmlnode_new("data");
 	char *base64data = purple_base64_encode(data->data, data->size);
 
-	xmlnode_set_namespace(tag, XEP_0231_NAMESPACE);
+	xmlnode_set_namespace(tag, NS_BOB);
 	xmlnode_set_attrib(tag, "cid", data->cid);
 	xmlnode_set_attrib(tag, "type", data->type);
 
@@ -169,7 +169,7 @@ jabber_data_get_xml_request(const gchar 
 {
 	xmlnode *tag = xmlnode_new("data");
 
-	xmlnode_set_namespace(tag, XEP_0231_NAMESPACE);
+	xmlnode_set_namespace(tag, NS_BOB);
 	xmlnode_set_attrib(tag, "cid", cid);
 
 	return tag;
@@ -254,7 +254,7 @@ jabber_data_init(void)
 	remote_data_by_cid = g_hash_table_new_full(g_str_hash, g_str_equal,
 		g_free, jabber_data_delete);
 
-	jabber_iq_register_handler("data", XEP_0231_NAMESPACE, jabber_data_parse);
+	jabber_iq_register_handler("data", NS_BOB, jabber_data_parse);
 }
 
 void
============================================================
--- libpurple/protocols/jabber/data.h	293702eae585ebaa2d3313e8d691debc4343c6ec
+++ libpurple/protocols/jabber/data.h	dcfa89336e98350268f3cc37b891b08db6ff9303
@@ -24,8 +24,6 @@
 #include "xmlnode.h"
 #include "jabber.h"
 
-#define XEP_0231_NAMESPACE "urn:xmpp:bob"
-
 #include <glib.h>
 
 typedef struct {
============================================================
--- libpurple/protocols/jabber/disco.c	eeeacee8d1f0c86ecbb098a4b5a1265d03517ae8
+++ libpurple/protocols/jabber/disco.c	78710aca03628159b03b222d103e842b57053aee
@@ -152,7 +152,7 @@ void jabber_disco_info_parse(JabberStrea
 			 * advertises as 'voice-v1'.
 			 */
 			xmlnode *feature = xmlnode_new_child(query, "feature");
-			xmlnode_set_attrib(feature, "var", "http://www.google.com/xmpp/protocol/voice/v1");
+			xmlnode_set_attrib(feature, "var", NS_GOOGLE_VOICE);
 		} else if (g_str_equal(node, CAPS0115_NODE "#" "video-v1")) {
 			/*
 			 * HUGE HACK! We advertise this ext (see jabber_presence_create_js
@@ -164,7 +164,7 @@ void jabber_disco_info_parse(JabberStrea
 			 * advertises as 'video-v1'.
 			 */
 			xmlnode *feature = xmlnode_new_child(query, "feature");
-			xmlnode_set_attrib(feature, "var", "http://www.google.com/xmpp/protocol/video/v1");
+			xmlnode_set_attrib(feature, "var", NS_GOOGLE_VIDEO);
 		} else if (g_str_equal(node, CAPS0115_NODE "#" "camera-v1")) {
 			/*
 			 * HUGE HACK! We advertise this ext (see jabber_presence_create_js
@@ -176,7 +176,7 @@ void jabber_disco_info_parse(JabberStrea
 			 * advertises as 'camera-v1'.
 			 */
 			xmlnode *feature = xmlnode_new_child(query, "feature");
-			xmlnode_set_attrib(feature, "var", "http://www.google.com/xmpp/protocol/camera/v1");
+			xmlnode_set_attrib(feature, "var", NS_GOOGLE_CAMERA);
 #endif
 		} else {
 			xmlnode *error, *inf;
@@ -290,7 +290,7 @@ static void jabber_disco_info_cb(JabberS
 					capabilities |= JABBER_CAP_IQ_SEARCH;
 				else if(!strcmp(var, "jabber:iq:register"))
 					capabilities |= JABBER_CAP_IQ_REGISTER;
-				else if(!strcmp(var, "urn:xmpp:ping"))
+				else if(!strcmp(var, NS_PING))
 					capabilities |= JABBER_CAP_PING;
 				else if(!strcmp(var, "http://jabber.org/protocol/disco#items"))
 					capabilities |= JABBER_CAP_ITEMS;
============================================================
--- libpurple/protocols/jabber/google.c	b9561388f6873e969ddb95ae032dab20e18ebb06
+++ libpurple/protocols/jabber/google.c	a082078fd126948e8410b57f71e2fc72cab88203
@@ -37,9 +37,6 @@
 
 #ifdef USE_VV
 
-#define NS_GOOGLE_VIDEO "http://www.google.com/session/video"
-#define NS_GOOGLE_PHONE "http://www.google.com/session/phone"
-
 typedef struct {
 	char *id;
 	char *initiator;
@@ -213,9 +210,9 @@ google_session_ready(GoogleSession *sess
 		xmlnode_insert_child(iq->node, sess);
 		desc = xmlnode_new_child(sess, "description");
 		if (session->video)
-			xmlnode_set_namespace(desc, NS_GOOGLE_VIDEO);
+			xmlnode_set_namespace(desc, NS_GOOGLE_SESSION_VIDEO);
 		else
-			xmlnode_set_namespace(desc, NS_GOOGLE_PHONE);
+			xmlnode_set_namespace(desc, NS_GOOGLE_SESSION_PHONE);
 
 		codecs = purple_media_get_codecs(media, "google-video");
 
@@ -248,7 +245,7 @@ google_session_ready(GoogleSession *sess
 					purple_media_codec_get_clock_rate(codec));
 			payload = xmlnode_new_child(desc, "payload-type");
 			if (session->video)
-				xmlnode_set_namespace(payload, NS_GOOGLE_PHONE);
+				xmlnode_set_namespace(payload, NS_GOOGLE_SESSION_PHONE);
 			xmlnode_set_attrib(payload, "id", id);
 			/*
 			 * Hack to make Gmail accept speex as the codec.
@@ -439,9 +436,9 @@ google_session_handle_initiate(JabberStr
 	desc_element = xmlnode_get_child(sess, "description");
 	xmlns = xmlnode_get_namespace(desc_element);
 
-	if (purple_strequal(xmlns, NS_GOOGLE_PHONE))
+	if (purple_strequal(xmlns, NS_GOOGLE_SESSION_PHONE))
 		session->video = FALSE;
-	else if (purple_strequal(xmlns, NS_GOOGLE_VIDEO))
+	else if (purple_strequal(xmlns, NS_GOOGLE_SESSION_VIDEO))
 		session->video = TRUE;
 	else {
 		purple_debug_error("jabber", "Received initiate with "
@@ -498,7 +495,7 @@ google_session_handle_initiate(JabberStr
 		id = xmlnode_get_attrib(codec_element, "id");
 
 		if (!session->video ||
-				(xmlns && !strcmp(xmlns, NS_GOOGLE_PHONE))) {
+				(xmlns && !strcmp(xmlns, NS_GOOGLE_SESSION_PHONE))) {
 			clock_rate = xmlnode_get_attrib(
 					codec_element, "clockrate");
 			video = FALSE;
@@ -623,7 +620,7 @@ google_session_handle_accept(JabberStrea
 	GList *codecs = NULL, *video_codecs = NULL;
 	JabberIq *result = NULL;
 	const gchar *xmlns = xmlnode_get_namespace(desc_element);
-	gboolean video = (xmlns && !strcmp(xmlns, NS_GOOGLE_VIDEO));
+	gboolean video = (xmlns && !strcmp(xmlns, NS_GOOGLE_SESSION_VIDEO));
 
 	for (; codec_element; codec_element = codec_element->next) {
 		const gchar *xmlns, *encoding_name, *id,
@@ -637,7 +634,7 @@ google_session_handle_accept(JabberStrea
 		encoding_name =	xmlnode_get_attrib(codec_element, "name");
 		id = xmlnode_get_attrib(codec_element, "id");
 
-		if (!video || purple_strequal(xmlns, NS_GOOGLE_PHONE))
+		if (!video || purple_strequal(xmlns, NS_GOOGLE_SESSION_PHONE))
 			clock_rate = xmlnode_get_attrib(
 					codec_element, "clockrate");
 		else {
@@ -1401,7 +1398,7 @@ jabber_google_jingle_info_cb(JabberStrea
                              xmlnode *packet, gpointer data)
 {
 	xmlnode *query = xmlnode_get_child_with_namespace(packet, "query",
-			GOOGLE_JINGLE_INFO_NAMESPACE);
+			NS_GOOGLE_JINGLE_INFO);
 
 	if (query)
 		jabber_google_jingle_info_common(js, from, type, query);
@@ -1421,7 +1418,7 @@ jabber_google_send_jingle_info(JabberStr
 jabber_google_send_jingle_info(JabberStream *js)
 {
 	JabberIq *jingle_info =
-		jabber_iq_new_query(js, JABBER_IQ_GET, GOOGLE_JINGLE_INFO_NAMESPACE);
+		jabber_iq_new_query(js, JABBER_IQ_GET, NS_GOOGLE_JINGLE_INFO);
 
 	jabber_iq_set_callback(jingle_info, jabber_google_jingle_info_cb,
 		NULL);
============================================================
--- libpurple/protocols/jabber/google.h	16ab49c5168cf8b70727bb35227825ddb7c0d5f1
+++ libpurple/protocols/jabber/google.h	6dcd8a11876e13bb0f302772c628492440b91c87
@@ -25,12 +25,7 @@
  * such that they don't intermingle with code for the XMPP RFCs and XEPs :) */
 
 #include "jabber.h"
-#include "media.h"
 
-#define GOOGLE_VOICE_CAP "http://www.google.com/xmpp/protocol/voice/v1"
-#define GOOGLE_VIDEO_CAP "http://www.google.com/xmpp/protocol/video/v1"
-#define GOOGLE_JINGLE_INFO_NAMESPACE "google:jingleinfo"
-
 #define GOOGLE_GROUPCHAT_SERVER "groupchat.google.com"
 
 void jabber_gmail_init(JabberStream *js);
============================================================
--- libpurple/protocols/jabber/ibb.c	2d1c07424e93a11c45347a72f9859fe4bdc2d980
+++ libpurple/protocols/jabber/ibb.c	340cdc40e222d2486519bc02dc4a19fe7bb993ab
@@ -228,7 +228,7 @@ jabber_ibb_session_open(JabberIBBSession
 		gchar block_size[10];
 
 		xmlnode_set_attrib(set->node, "to", jabber_ibb_session_get_who(sess));
-		xmlnode_set_namespace(open, XEP_0047_NAMESPACE);
+		xmlnode_set_namespace(open, NS_IBB);
 		xmlnode_set_attrib(open, "sid", jabber_ibb_session_get_sid(sess));
 		g_snprintf(block_size, sizeof(block_size), "%" G_GSIZE_FORMAT,
 			jabber_ibb_session_get_block_size(sess));
@@ -256,7 +256,7 @@ jabber_ibb_session_close(JabberIBBSessio
 		xmlnode *close = xmlnode_new("close");
 
 		xmlnode_set_attrib(set->node, "to", jabber_ibb_session_get_who(sess));
-		xmlnode_set_namespace(close, XEP_0047_NAMESPACE);
+		xmlnode_set_namespace(close, NS_IBB);
 		xmlnode_set_attrib(close, "sid", jabber_ibb_session_get_sid(sess));
 		xmlnode_insert_child(set->node, close);
 		jabber_iq_send(set);
@@ -333,7 +333,7 @@ jabber_ibb_session_send_data(JabberIBBSe
 		g_snprintf(seq, sizeof(seq), "%u", jabber_ibb_session_get_send_seq(sess));
 
 		xmlnode_set_attrib(set->node, "to", jabber_ibb_session_get_who(sess));
-		xmlnode_set_namespace(data_element, XEP_0047_NAMESPACE);
+		xmlnode_set_namespace(data_element, NS_IBB);
 		xmlnode_set_attrib(data_element, "sid", jabber_ibb_session_get_sid(sess));
 		xmlnode_set_attrib(data_element, "seq", seq);
 		xmlnode_insert_data(data_element, base64, -1);
@@ -507,11 +507,11 @@ jabber_ibb_init(void)
 {
 	jabber_ibb_sessions = g_hash_table_new(g_str_hash, g_str_equal);
 
-	jabber_add_feature(XEP_0047_NAMESPACE, NULL);
+	jabber_add_feature(NS_IBB, NULL);
 
-	jabber_iq_register_handler("close", XEP_0047_NAMESPACE, jabber_ibb_parse);
-	jabber_iq_register_handler("data", XEP_0047_NAMESPACE, jabber_ibb_parse);
-	jabber_iq_register_handler("open", XEP_0047_NAMESPACE, jabber_ibb_parse);
+	jabber_iq_register_handler("close", NS_IBB, jabber_ibb_parse);
+	jabber_iq_register_handler("data", NS_IBB, jabber_ibb_parse);
+	jabber_iq_register_handler("open", NS_IBB, jabber_ibb_parse);
 }
 
 void
============================================================
--- libpurple/protocols/jabber/ibb.h	51f6f1b0ea84920a8ef116ffd8c0b6963232288e
+++ libpurple/protocols/jabber/ibb.h	c5afef20541df6cfcdd2a30691ae582416f00cef
@@ -24,8 +24,6 @@
 #include "jabber.h"
 #include "iq.h"
 
-#define XEP_0047_NAMESPACE "http://jabber.org/protocol/ibb"
-
 typedef struct _JabberIBBSession JabberIBBSession;
 
 typedef void
============================================================
--- libpurple/protocols/jabber/iq.c	2abb1398ed899ddde8f6b9ab56fa46c58fd4426e
+++ libpurple/protocols/jabber/iq.c	6a1eca3bfb209e7192c0f189202cf3510576d016
@@ -462,8 +462,8 @@ void jabber_iq_init(void)
 			jabber_gmail_poke);
 	jabber_iq_register_handler("new-mail", "google:mail:notify",
 			jabber_gmail_poke);
-	jabber_iq_register_handler("ping", "urn:xmpp:ping", jabber_ping_parse);
-	jabber_iq_register_handler("query", GOOGLE_JINGLE_INFO_NAMESPACE,
+	jabber_iq_register_handler("ping", NS_PING, jabber_ping_parse);
+	jabber_iq_register_handler("query", NS_GOOGLE_JINGLE_INFO,
 			jabber_google_handle_jingle_info);
 	jabber_iq_register_handler("query", "http://jabber.org/protocol/bytestreams",
 			jabber_bytestreams_parse);
============================================================
--- libpurple/protocols/jabber/jabber.c	80eb4367a92a0b7ae0d294d52a96c6cd65dcca04
+++ libpurple/protocols/jabber/jabber.c	2a2103c185d19595c1814d57c234950068153ef7
@@ -2835,7 +2835,7 @@ static gboolean _jabber_send_buzz(Jabber
 		return FALSE;
 	}
 
-	if (jabber_resource_has_capability(jbr, XEP_0224_NAMESPACE)) {
+	if (jabber_resource_has_capability(jbr, NS_ATTENTION)) {
 		xmlnode *buzz, *msg = xmlnode_new("message");
 		gchar *to;
 
@@ -2847,7 +2847,7 @@ static gboolean _jabber_send_buzz(Jabber
 		xmlnode_set_attrib(msg, "type", "headline");
 
 		buzz = xmlnode_new_child(msg, "attention");
-		xmlnode_set_namespace(buzz, XEP_0224_NAMESPACE);
+		xmlnode_set_namespace(buzz, NS_ATTENTION);
 
 		jabber_send(js, msg);
 		xmlnode_free(msg);
@@ -3012,8 +3012,7 @@ jabber_initiate_media(PurpleAccount *acc
 		if (type & PURPLE_MEDIA_AUDIO &&
 				!jabber_resource_has_capability(jbr,
 				JINGLE_APP_RTP_SUPPORT_AUDIO) &&
-				jabber_resource_has_capability(jbr,
-				GOOGLE_VOICE_CAP))
+				jabber_resource_has_capability(jbr, NS_GOOGLE_VOICE))
 			return jabber_google_session_initiate(js, who, type);
 		else
 			return jingle_rtp_initiate_media(js, who, type);
@@ -3182,10 +3181,9 @@ PurpleMediaCaps jabber_get_media_caps(Pu
 				caps |= PURPLE_MEDIA_CAPS_MODIFY_SESSION |
 						PURPLE_MEDIA_CAPS_CHANGE_DIRECTION;
 		}
-		if (jabber_resource_has_capability(jbr, GOOGLE_VOICE_CAP)) {
+		if (jabber_resource_has_capability(jbr, NS_GOOGLE_VOICE)) {
 			caps |= PURPLE_MEDIA_CAPS_AUDIO;
-			if (jabber_resource_has_capability(jbr,
-					GOOGLE_VIDEO_CAP))
+			if (jabber_resource_has_capability(jbr, NS_GOOGLE_VIDEO))
 				caps |= PURPLE_MEDIA_CAPS_AUDIO_VIDEO;
 		}
 		return caps;
@@ -3263,8 +3261,7 @@ gboolean jabber_can_receive_file(PurpleC
 						"http://jabber.org/protocol/si/profile/file-transfer")
 			    	&& (jabber_resource_has_capability(jbr,
 			    			"http://jabber.org/protocol/bytestreams")
-			        	|| jabber_resource_has_capability(jbr,
-				           		XEP_0047_NAMESPACE))) {
+			        	|| jabber_resource_has_capability(jbr, NS_IBB))) {
 					return TRUE;
 				}
 			}
@@ -3485,28 +3482,28 @@ jabber_init_plugin(PurplePlugin *plugin)
 	jabber_add_feature("http://jabber.org/protocol/chatstates", 0);
 	jabber_add_feature("http://jabber.org/protocol/disco#info", 0);
 	jabber_add_feature("http://jabber.org/protocol/disco#items", 0);
-	jabber_add_feature("http://jabber.org/protocol/ibb", 0);
+	jabber_add_feature(NS_IBB, 0);
 	jabber_add_feature("http://jabber.org/protocol/muc", 0);
 	jabber_add_feature("http://jabber.org/protocol/muc#user", 0);
 	jabber_add_feature("http://jabber.org/protocol/si", 0);
 	jabber_add_feature("http://jabber.org/protocol/si/profile/file-transfer", 0);
 	jabber_add_feature("http://jabber.org/protocol/xhtml-im", 0);
-	jabber_add_feature("urn:xmpp:ping", 0);
+	jabber_add_feature(NS_PING, 0);
 
 	/* Buzz/Attention */
-	jabber_add_feature(XEP_0224_NAMESPACE, jabber_buzz_isenabled);
+	jabber_add_feature(NS_ATTENTION, jabber_buzz_isenabled);
 
 	/* Bits Of Binary */
-	jabber_add_feature(XEP_0231_NAMESPACE, 0);
+	jabber_add_feature(NS_BOB, 0);
 
 	/* Jingle features! */
 	jabber_add_feature(JINGLE, 0);
 
 #ifdef USE_VV
-	jabber_add_feature("http://www.google.com/xmpp/protocol/session", jabber_audio_enabled);
-	jabber_add_feature("http://www.google.com/xmpp/protocol/voice/v1", jabber_audio_enabled);
-	jabber_add_feature("http://www.google.com/xmpp/protocol/video/v1", jabber_video_enabled);
-	jabber_add_feature("http://www.google.com/xmpp/protocol/camera/v1", jabber_video_enabled);
+	jabber_add_feature(NS_GOOGLE_SESSION, jabber_audio_enabled);
+	jabber_add_feature(NS_GOOGLE_VOICE, jabber_audio_enabled);
+	jabber_add_feature(NS_GOOGLE_VIDEO, jabber_video_enabled);
+	jabber_add_feature(NS_GOOGLE_CAMERA, jabber_video_enabled);
 	jabber_add_feature(JINGLE_APP_RTP, 0);
 	jabber_add_feature(JINGLE_APP_RTP_SUPPORT_AUDIO, jabber_audio_enabled);
 	jabber_add_feature(JINGLE_APP_RTP_SUPPORT_VIDEO, jabber_video_enabled);
============================================================
--- libpurple/protocols/jabber/jabber.h	db11a9cb219a167f5864ef85c915ff2b9c7ab70f
+++ libpurple/protocols/jabber/jabber.h	62678e3c6ab00ec7e2cc86a331184accda626d9c
@@ -64,6 +64,8 @@ typedef struct _JabberStream JabberStrea
 #include "roomlist.h"
 #include "sslconn.h"
 
+#include "namespaces.h"
+
 #include "iq.h"
 #include "jutil.h"
 #include "xmlnode.h"
============================================================
--- libpurple/protocols/jabber/message.c	e783a4f7f3ff8a604c7fe5b52fc343c7dc1e1067
+++ libpurple/protocols/jabber/message.c	ea9d42479761affdb7cd94a1d4a0e6c1b309c7ce
@@ -460,7 +460,7 @@ jabber_message_add_remote_smileys(const 
 jabber_message_add_remote_smileys(const xmlnode *message)
 {
 	xmlnode *data_tag;
-	for (data_tag = xmlnode_get_child_with_namespace(message, "data", XEP_0231_NAMESPACE) ;
+	for (data_tag = xmlnode_get_child_with_namespace(message, "data", NS_BOB) ;
 		 data_tag ;
 		 data_tag = xmlnode_get_next_twin(data_tag)) {
 		const gchar *cid = xmlnode_get_attrib(data_tag, "cid");
@@ -740,7 +740,7 @@ void jabber_message_parse(JabberStream *
 			jm->type = JABBER_MESSAGE_EVENT;
 			for(items = xmlnode_get_child(child,"items"); items; items = items->next)
 				jm->eventitems = g_list_append(jm->eventitems, items);
-		} else if(!strcmp(child->name, "attention") && !strcmp(xmlns, XEP_0224_NAMESPACE)) {
+		} else if(!strcmp(child->name, "attention") && !strcmp(xmlns, NS_ATTENTION)) {
 			jm->hasBuzz = TRUE;
 		} else if(!strcmp(child->name, "delay") && !strcmp(xmlns,"urn:xmpp:delay")) {
 			const char *timestamp = xmlnode_get_attrib(child, "stamp");
@@ -946,7 +946,7 @@ jabber_conv_support_custom_smileys(const
 		case PURPLE_CONV_TYPE_IM:
 			jb = jabber_buddy_find(js, who, FALSE);
 			if (jb) {
-				return jabber_buddy_has_capability(jb, XEP_0231_NAMESPACE);
+				return jabber_buddy_has_capability(jb, NS_BOB);
 			} else {
 				return FALSE;
 			}
@@ -958,7 +958,7 @@ jabber_conv_support_custom_smileys(const
 				 10 people, to avoid getting too many BoB requests */
 				return jabber_chat_get_num_participants(chat) <= 10 &&
 					jabber_chat_all_participants_have_capability(chat,
-						XEP_0231_NAMESPACE);
+						NS_BOB);
 			} else {
 				return FALSE;
 			}
============================================================
--- libpurple/protocols/jabber/message.h	ff902e39a3c677b333a1c071c30bdd3ab9892c8f
+++ libpurple/protocols/jabber/message.h	bfe368970cc5ad3162ada879b76b69b73a2c7382
@@ -28,8 +28,6 @@
 #include "jabber.h"
 #include "xmlnode.h"
 
-#define XEP_0224_NAMESPACE "urn:xmpp:attention:0"
-
 typedef struct _JabberMessage {
 	JabberStream *js;
 	enum {
============================================================
--- libpurple/protocols/jabber/ping.c	240974948b2d1b46c3a669ab8d14917a97265c32
+++ libpurple/protocols/jabber/ping.c	9f11240d63436a3d17c0f08f78d0ceb866e9bca8
@@ -74,7 +74,7 @@ void jabber_keepalive_ping(JabberStream 
 
 	iq = jabber_iq_new(js, JABBER_IQ_GET);
 	ping = xmlnode_new_child(iq->node, "ping");
-	xmlnode_set_namespace(ping, "urn:xmpp:ping");
+	xmlnode_set_namespace(ping, NS_PING);
 
 	jabber_iq_set_callback(iq, jabber_keepalive_pong_cb, NULL);
 	jabber_iq_send(iq);
@@ -90,7 +90,7 @@ gboolean jabber_ping_jid(JabberStream *j
 		xmlnode_set_attrib(iq->node, "to", jid);
 
 	ping = xmlnode_new_child(iq->node, "ping");
-	xmlnode_set_namespace(ping, "urn:xmpp:ping");
+	xmlnode_set_namespace(ping, NS_PING);
 
 	jabber_iq_set_callback(iq, jabber_ping_result_cb, NULL);
 	jabber_iq_send(iq);
============================================================
--- libpurple/protocols/jabber/si.c	bb7944ad0868418c44c4f287228ca213db77c112
+++ libpurple/protocols/jabber/si.c	f68895c292d0223f6b998514460c9fb4556ab120
@@ -1210,7 +1210,7 @@ static void jabber_si_xfer_send_method_c
 					jabber_si_xfer_bytestreams_send_init(xfer);
 					jsx->stream_method |= STREAM_METHOD_BYTESTREAMS;
 					found_method = TRUE;
-				} else if (val && !strcmp(val, XEP_0047_NAMESPACE)) {
+				} else if (val && !strcmp(val, NS_IBB)) {
 					jsx->stream_method |= STREAM_METHOD_IBB;
 					if (!found_method) {
 						/* we haven't tried to init a bytestream session, yet
@@ -1452,7 +1452,7 @@ static void do_transfer_send(PurpleXfer 
 	if (jbr) {
 		char *msg;
 
-		if (jabber_resource_has_capability(jbr, XEP_0047_NAMESPACE))
+		if (jabber_resource_has_capability(jbr, NS_IBB))
 			jsx->stream_method |= STREAM_METHOD_IBB;
 		if (jabber_resource_has_capability(jbr, "http://jabber.org/protocol/si/profile/file-transfer")) {
 			jabber_si_xfer_send_request(xfer);
============================================================
--- libpurple/protocols/jabber/useravatar.h	5942079588fe48120cdffd055a10d1fe7f8c95e6
+++ libpurple/protocols/jabber/useravatar.h	f07e0facd4e323446b868b809c59206dc5ad7694
@@ -29,12 +29,6 @@
 
 /* Implementation of XEP-0084 */
 
-#define NS_AVATAR_0_12_DATA     "http://www.xmpp.org/extensions/xep-0084.html#ns-data"
-#define NS_AVATAR_0_12_METADATA "http://www.xmpp.org/extensions/xep-0084.html#ns-metadata"
-
-#define NS_AVATAR_1_1_DATA      "urn:xmpp:avatar:data"
-#define NS_AVATAR_1_1_METADATA  "urn:xmpp:avatar:metadata"
-
 void jabber_avatar_init(void);
 void jabber_avatar_set(JabberStream *js, PurpleStoredImage *img);
 


More information about the Commits mailing list