changeset 27104:048bcf41deef

disapproval of revision 'a383ad6a4ae7e98bbcb32b4193531ccf960eb2bb' Legacy Delayed Delivery is still too widely deployed.
author Paul Aurich <paul@darkrain42.org>
date Sun, 12 Jul 2009 05:42:40 +0000
parents e49739413d73
children a08e84032814
files libpurple/protocols/jabber/message.c libpurple/protocols/jabber/presence.c
diffstat 2 files changed, 12 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/message.c	Thu Jun 11 22:33:33 2009 +0000
+++ b/libpurple/protocols/jabber/message.c	Sun Jul 12 05:42:40 2009 +0000
@@ -740,7 +740,12 @@
 			if(timestamp)
 				jm->sent = purple_str_to_time(timestamp, TRUE, NULL, NULL, NULL);
 		} else if(!strcmp(child->name, "x")) {
-			if(!strcmp(xmlns, "jabber:x:conference") &&
+			if(!strcmp(xmlns, "jabber:x:delay")) {
+				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(xmlns, "jabber:x:conference") &&
 					jm->type != JABBER_MESSAGE_GROUPCHAT_INVITE &&
 					jm->type != JABBER_MESSAGE_ERROR) {
 				const char *jid = xmlnode_get_attrib(child, "jid");
--- a/libpurple/protocols/jabber/presence.c	Thu Jun 11 22:33:33 2009 +0000
+++ b/libpurple/protocols/jabber/presence.c	Sun Jul 12 05:42:40 2009 +0000
@@ -576,7 +576,7 @@
 			/* The rest of the cases used to check xmlns individually. */
 			continue;
 		} else if(!strcmp(y->name, "delay") && !strcmp(xmlns, "urn:xmpp:delay")) {
-			/* XXX: compare the time.  urn:xmpp:delay can happen on presence packets that aren't really and truly delayed */
+			/* 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");
 		} else if(!strcmp(y->name, "c") && !strcmp(xmlns, "http://jabber.org/protocol/caps")) {
@@ -584,7 +584,11 @@
 		} 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, "http://jabber.org/protocol/muc#user")) {
+			if(!strcmp(xmlns, "jabber:x:delay")) {
+				/* 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");
+			} else if(!strcmp(xmlns, "http://jabber.org/protocol/muc#user")) {
 				xmlnode *z;
 
 				muc = TRUE;