summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Lundblad <malu@pidgin.im>2009-11-29 19:14:39 +0000
committerMarcus Lundblad <malu@pidgin.im>2009-11-29 19:14:39 +0000
commit12f5119e4096813b49b7ec41bf58623839f4a9e4 (patch)
tree3c2978888a2378458feb55e4cd0392c79f50016b
parent85ab9876e38229972e0ecb7354d8af3072dc9488 (diff)
downloadpidgin-12f5119e4096813b49b7ec41bf58623839f4a9e4.tar.gz
Added the "thumbs" namespace to namespaces.h
Check the namespace on thumbnails elements on incoming transferes.
-rw-r--r--libpurple/protocols/jabber/namespaces.h3
-rw-r--r--libpurple/protocols/jabber/si.c5
2 files changed, 6 insertions, 2 deletions
diff --git a/libpurple/protocols/jabber/namespaces.h b/libpurple/protocols/jabber/namespaces.h
index 8beaa38a78..78c60e80f5 100644
--- a/libpurple/protocols/jabber/namespaces.h
+++ b/libpurple/protocols/jabber/namespaces.h
@@ -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"
diff --git a/libpurple/protocols/jabber/si.c b/libpurple/protocols/jabber/si.c
index e6bd83a785..1778448bf0 100644
--- a/libpurple/protocols/jabber/si.c
+++ b/libpurple/protocols/jabber/si.c
@@ -1264,7 +1264,7 @@ static void jabber_si_xfer_send_request(PurpleXfer *xfer)
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, const char *from, JabberIqType type,
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 =