diff options
author | Paul Aurich <darkrain42@pidgin.im> | 2009-11-28 04:05:17 +0000 |
---|---|---|
committer | Paul Aurich <darkrain42@pidgin.im> | 2009-11-28 04:05:17 +0000 |
commit | 8b79cd7bb5458d72013532c432763e3042edf7d7 (patch) | |
tree | 8250468ea368855459383ec5d166327a4a34a220 | |
parent | 3550c2b770f787035774e2089a6107b8edfa911f (diff) | |
download | pidgin-8b79cd7bb5458d72013532c432763e3042edf7d7.tar.gz |
jabber: Delayed Delivery namespaces
-rw-r--r-- | libpurple/protocols/jabber/message.c | 4 | ||||
-rw-r--r-- | libpurple/protocols/jabber/namespaces.h | 4 | ||||
-rw-r--r-- | libpurple/protocols/jabber/presence.c | 4 |
3 files changed, 8 insertions, 4 deletions
diff --git a/libpurple/protocols/jabber/message.c b/libpurple/protocols/jabber/message.c index 30e20f840a..ebae305397 100644 --- a/libpurple/protocols/jabber/message.c +++ b/libpurple/protocols/jabber/message.c @@ -742,13 +742,13 @@ void jabber_message_parse(JabberStream *js, xmlnode *packet) 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 --git a/libpurple/protocols/jabber/namespaces.h b/libpurple/protocols/jabber/namespaces.h index a340210be9..8ff3a9ddca 100644 --- a/libpurple/protocols/jabber/namespaces.h +++ b/libpurple/protocols/jabber/namespaces.h @@ -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 --git a/libpurple/protocols/jabber/presence.c b/libpurple/protocols/jabber/presence.c index 6a69b5a1ea..9748013c11 100644 --- a/libpurple/protocols/jabber/presence.c +++ b/libpurple/protocols/jabber/presence.c @@ -633,7 +633,7 @@ void jabber_presence_parse(JabberStream *js, xmlnode *packet) } 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 *js, xmlnode *packet) } 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"); |