# HG changeset patch # User Paul Aurich # Date 1259381117 0 # Node ID 5b449584feada09b4ba2e3d880b5939e4825b430 # Parent 5306a71c4eb2ef6228c77e7b6235dcb9ddaea763 jabber: Delayed Delivery namespaces diff -r 5306a71c4eb2 -r 5b449584fead libpurple/protocols/jabber/message.c --- a/libpurple/protocols/jabber/message.c Sat Nov 28 02:45:45 2009 +0000 +++ b/libpurple/protocols/jabber/message.c Sat Nov 28 04:05:17 2009 +0000 @@ -742,13 +742,13 @@ 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) diff -r 5306a71c4eb2 -r 5b449584fead libpurple/protocols/jabber/namespaces.h --- a/libpurple/protocols/jabber/namespaces.h Sat Nov 28 02:45:45 2009 +0000 +++ b/libpurple/protocols/jabber/namespaces.h Sat Nov 28 04:05:17 2009 +0000 @@ -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" diff -r 5306a71c4eb2 -r 5b449584fead libpurple/protocols/jabber/presence.c --- a/libpurple/protocols/jabber/presence.c Sat Nov 28 02:45:45 2009 +0000 +++ b/libpurple/protocols/jabber/presence.c Sat Nov 28 04:05:17 2009 +0000 @@ -633,7 +633,7 @@ } 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 @@ } 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");