pidgin: 96a37da7: jabber: Delayed Delivery namespaces

darkrain42 at pidgin.im darkrain42 at pidgin.im
Fri Nov 27 23:15:51 EST 2009


-----------------------------------------------------------------
Revision: 96a37da71efc2f74d925f4e24205605d06fccbb1
Ancestor: 1aef3e39e4ed55f7af4eb47d5c9271d5de96391d
Author: darkrain42 at pidgin.im
Date: 2009-11-28T04:05:17
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/96a37da71efc2f74d925f4e24205605d06fccbb1

Modified files:
        libpurple/protocols/jabber/message.c
        libpurple/protocols/jabber/namespaces.h
        libpurple/protocols/jabber/presence.c

ChangeLog: 

jabber: Delayed Delivery namespaces

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/message.c	ed0d9b9f32d619ba1d18170986523fc2d0923c6b
+++ libpurple/protocols/jabber/message.c	a82d35fd7e226e872abf81ab50c2defd58c3bad8
@@ -742,13 +742,13 @@ void jabber_message_parse(JabberStream *
 				jm->eventitems = g_list_append(jm->eventitems, items);
 		} else if(!strcmp(child->name, "attention") && !strcmp(xmlns, NS_ATTENTION)) {
 			jm->hasBuzz = TRUE;
-		} else if(!strcmp(child->name, "delay") && !strcmp(xmlns,"urn:xmpp:delay")) {
+		} else if(!strcmp(child->name, "delay") && !strcmp(xmlns, NS_DELAYED_DELIVERY)) {
 			const char *timestamp = xmlnode_get_attrib(child, "stamp");
 			jm->delayed = TRUE;
 			if(timestamp)
 				jm->sent = purple_str_to_time(timestamp, TRUE, NULL, NULL, NULL);
 		} else if(!strcmp(child->name, "x")) {
-			if(!strcmp(xmlns, "jabber:x:delay")) {
+			if(!strcmp(xmlns, NS_DELAYED_DELIVERY_LEGACY)) {
 				const char *timestamp = xmlnode_get_attrib(child, "stamp");
 				jm->delayed = TRUE;
 				if(timestamp)
============================================================
--- libpurple/protocols/jabber/namespaces.h	86aa40602b6554679e545d7cb2d287e3d421b83b
+++ libpurple/protocols/jabber/namespaces.h	b95784d7ee6069ff850a75bd0b46b228fc2633ea
@@ -69,6 +69,10 @@
 /* XEP-0202 Entity Time */
 #define NS_ENTITY_TIME "urn:xmpp:time"
 
+/* XEP-0203 Delayed Delivery (and legacy delayed delivery) */
+#define NS_DELAYED_DELIVERY "urn:xmpp:delay"
+#define NS_DELAYED_DELIVERY_LEGACY "jabber:x:delay"
+
 /* XEP-0224 Attention */
 #define NS_ATTENTION "urn:xmpp:attention:0"
 
============================================================
--- libpurple/protocols/jabber/presence.c	bd0687baa39cdcc2481c7092e1be4f73e628fd8f
+++ libpurple/protocols/jabber/presence.c	0b7b9ca3f1ca84628f9232e72a1eeb52dfc73c42
@@ -633,7 +633,7 @@ void jabber_presence_parse(JabberStream 
 		} else if(xmlns == NULL) {
 			/* The rest of the cases used to check xmlns individually. */
 			continue;
-		} else if(!strcmp(y->name, "delay") && !strcmp(xmlns, "urn:xmpp:delay")) {
+		} else if(!strcmp(y->name, "delay") && !strcmp(xmlns, NS_DELAYED_DELIVERY)) {
 			/* XXX: compare the time.  jabber:x:delay can happen on presence packets that aren't really and truly delayed */
 			delayed = TRUE;
 			stamp = xmlnode_get_attrib(y, "stamp");
@@ -642,7 +642,7 @@ void jabber_presence_parse(JabberStream 
 		} else if (g_str_equal(y->name, "nick") && g_str_equal(xmlns, "http://jabber.org/protocol/nick")) {
 			nickname = xmlnode_get_data(y);
 		} else if(!strcmp(y->name, "x")) {
-			if(!strcmp(xmlns, "jabber:x:delay")) {
+			if(!strcmp(xmlns, NS_DELAYED_DELIVERY_LEGACY)) {
 				/* XXX: compare the time.  jabber:x:delay can happen on presence packets that aren't really and truly delayed */
 				delayed = TRUE;
 				stamp = xmlnode_get_attrib(y, "stamp");


More information about the Commits mailing list