cpw.malu.ft_thumbnails: f8076388: Added the "thumbs" namespace to namespac...

malu at pidgin.im malu at pidgin.im
Sun Nov 29 14:20:42 EST 2009


-----------------------------------------------------------------
Revision: f8076388ea2ac1a1fbc83a196fd460fb550b91e4
Ancestor: 9f12665ed0e1d293d3fd72494821e8c6f9f3ccc2
Author: malu at pidgin.im
Date: 2009-11-29T19:14:39
Branch: im.pidgin.cpw.malu.ft_thumbnails
URL: http://d.pidgin.im/viewmtn/revision/info/f8076388ea2ac1a1fbc83a196fd460fb550b91e4

Modified files:
        libpurple/protocols/jabber/namespaces.h
        libpurple/protocols/jabber/si.c

ChangeLog: 

Added the "thumbs" namespace to namespaces.h
Check the namespace on thumbnails elements on incoming transferes.

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/namespaces.h	5f7ae06cbc1020cf121a48cc1718caeccbddf5f2
+++ libpurple/protocols/jabber/namespaces.h	605391c3d508b906fb3073d46a2e97052dbdc685
@@ -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"
============================================================
--- libpurple/protocols/jabber/si.c	5307004a837993de914d2e59af6075ba2f8c542a
+++ libpurple/protocols/jabber/si.c	074f9c83acd1f700199a0361c363437b83151ac5
@@ -1264,7 +1264,7 @@ static void jabber_si_xfer_send_request(
 				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 @@ void jabber_si_parse(JabberStream *js, c
 	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 = 


More information about the Commits mailing list