cpw.malu.ft_thumbnails: 98d8db26: Disable thumbnails for XMPP (in si.c) by...

malu at pidgin.im malu at pidgin.im
Wed Apr 28 15:30:49 EDT 2010


-----------------------------------------------------------------
Revision: 98d8db26c6d12378d0113a97c8b3f989233a5cbc
Ancestor: 28ba675454ee403fff38bd908382bfc4c33da084
Author: malu at pidgin.im
Date: 2010-04-28T19:26:58
Branch: im.pidgin.cpw.malu.ft_thumbnails
URL: http://d.pidgin.im/viewmtn/revision/info/98d8db26c6d12378d0113a97c8b3f989233a5cbc

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

ChangeLog: 

Disable thumbnails for XMPP (in si.c) by using an #define
This is a temporary measure until XEP 0264 gets draft status.

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/si.c	163e282ec09b37888c57e24add922225d65018a3
+++ libpurple/protocols/jabber/si.c	cce5a5177d5ff5efda43a71d3e5cb787dbdcf3d7
@@ -40,6 +40,7 @@
 #include "si.h"
 
 #define STREAMHOST_CONNECT_TIMEOUT 15
+#define ENABLE_FT_THUMBNAILS 0
 
 typedef struct _JabberSIXfer {
 	JabberStream *js;
@@ -1247,11 +1248,13 @@ static void jabber_si_xfer_send_request(
 	JabberIq *iq;
 	xmlnode *si, *file, *feature, *x, *field, *option, *value;
 	char buf[32];
+#if ENABLE_FT_THUMBNAILS
 	gconstpointer thumb;
 	gsize thumb_size;
 
-	xfer->filename = g_path_get_basename(xfer->local_filename);
 	purple_xfer_prepare_thumbnail(xfer, "jpeg,png");
+#endif
+	xfer->filename = g_path_get_basename(xfer->local_filename);
 	
 	iq = jabber_iq_new(jsx->js, JABBER_IQ_SET);
 	xmlnode_set_attrib(iq->node, "to", xfer->who);
@@ -1270,6 +1273,7 @@ static void jabber_si_xfer_send_request(
 	xmlnode_set_attrib(file, "size", buf);
 	/* maybe later we'll do hash and date attribs */
 
+#if ENABLE_FT_THUMBNAILS
 	/* add thumbnail, if appropriate */
 	if ((thumb = purple_xfer_get_thumbnail(xfer, &thumb_size))) {
 		const gchar *mimetype = purple_xfer_get_thumbnail_mimetype(xfer);
@@ -1284,6 +1288,7 @@ static void jabber_si_xfer_send_request(
 		/* cache data */
 		jabber_data_associate_local(thumbnail_data, NULL);
 	}
+#endif
 						  
 	feature = xmlnode_new_child(si, "feature");
 	xmlnode_set_namespace(feature, "http://jabber.org/protocol/feature-neg");
@@ -1663,6 +1668,7 @@ void jabber_si_xfer_send(PurpleConnectio
 		purple_xfer_request(xfer);
 }
 
+#if ENABLE_FT_THUMBNAILS
 static void
 jabber_si_thumbnail_cb(JabberData *data, gchar *alt, gpointer userdata)
 {
@@ -1677,6 +1683,7 @@ jabber_si_thumbnail_cb(JabberData *data,
 
 	purple_xfer_request(xfer);
 }
+#endif
 
 void jabber_si_parse(JabberStream *js, const char *from, JabberIqType type,
                      const char *id, xmlnode *si)
@@ -1768,6 +1775,7 @@ void jabber_si_parse(JabberStream *js, c
 				   
 	js->file_transfers = g_list_append(js->file_transfers, xfer);
 
+#if ENABLE_FT_THUMBNAILS
 	/* if there is a thumbnail, we should request it... */
 	if ((thumbnail = xmlnode_get_child_with_namespace(file, "thumbnail",
 		NS_THUMBS))) {
@@ -1781,6 +1789,9 @@ void jabber_si_parse(JabberStream *js, c
 	} else {
 		purple_xfer_request(xfer);
 	}
+#else
+	purple_xfer_request(xfer);
+#endif
 }
 
 void


More information about the Commits mailing list