changeset 30225:4cfa6d49bee5

Added the "thumbs" namespace to namespaces.h Check the namespace on thumbnails elements on incoming transferes.
author Marcus Lundblad <ml@update.uu.se>
date Sun, 29 Nov 2009 19:14:39 +0000
parents b0f1698c52f8
children 172a37a43a30
files libpurple/protocols/jabber/namespaces.h libpurple/protocols/jabber/si.c
diffstat 2 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/namespaces.h	Sun Nov 29 19:06:30 2009 +0000
+++ b/libpurple/protocols/jabber/namespaces.h	Sun Nov 29 19:14:39 2009 +0000
@@ -85,6 +85,9 @@
 /* XEP-0231 BoB (Bits of Binary) */
 #define NS_BOB "urn:xmpp:bob"
 
+/* XEP-0264 File Transfer Thumbnails (Thumbs) */
+#define NS_THUMBS "urn:xmpp:thumbs:0"
+
 /* Google extensions */
 #define NS_GOOGLE_CAMERA "http://www.google.com/xmpp/protocol/camera/v1"
 #define NS_GOOGLE_VIDEO "http://www.google.com/xmpp/protocol/video/v1"
--- a/libpurple/protocols/jabber/si.c	Sun Nov 29 19:06:30 2009 +0000
+++ b/libpurple/protocols/jabber/si.c	Sun Nov 29 19:14:39 2009 +0000
@@ -1264,7 +1264,7 @@
 				purple_xfer_get_thumbnail_size(xfer), "image/jpeg", TRUE,
 				jsx->js);
 		xmlnode *thumbnail = xmlnode_new_child(file, "thumbnail");
-		xmlnode_set_namespace(thumbnail, "urn:xmpp:thumbs:0");
+		xmlnode_set_namespace(thumbnail, NS_THUMBS);
 		xmlnode_set_attrib(thumbnail, "cid", 
 			jabber_data_get_cid(thumbnail_data));
 		xmlnode_set_attrib(thumbnail, "mime-type", "image/jpeg");
@@ -1766,7 +1766,8 @@
 	js->file_transfers = g_list_append(js->file_transfers, xfer);
 
 	/* if there is a thumbnail, we should request it... */
-	if ((thumbnail = xmlnode_get_child(file, "thumbnail"))) {
+	if ((thumbnail = xmlnode_get_child_with_namespace(file, "thumbnail",
+		NS_THUMBS))) {
 		const char *cid = xmlnode_get_attrib(thumbnail, "cid");
 		if (cid) {
 			JabberIq *request =