Mercurial > pidgin
diff libpurple/protocols/jabber/si.c @ 29809:b0f1698c52f8
propagate from branch 'im.pidgin.pidgin' (head fd01d69465dca1c23c811963e2545236c2749d55)
to branch 'im.pidgin.cpw.malu.ft_thumbnails' (head a565e5aaa067913f555e96099205782f530ce9a7)
author | Marcus Lundblad <ml@update.uu.se> |
---|---|
date | Sun, 29 Nov 2009 19:06:30 +0000 |
parents | bc57ec419847 9ae3e70a327b |
children | 4cfa6d49bee5 |
line wrap: on
line diff
--- a/libpurple/protocols/jabber/si.c Tue Nov 03 18:27:07 2009 +0000 +++ b/libpurple/protocols/jabber/si.c Sun Nov 29 19:06:30 2009 +0000 @@ -145,7 +145,7 @@ if(xfer->type == PURPLE_XFER_SEND) { xmlnode *activate; - iq = jabber_iq_new_query(jsx->js, JABBER_IQ_SET, "http://jabber.org/protocol/bytestreams"); + iq = jabber_iq_new_query(jsx->js, JABBER_IQ_SET, NS_BYTESTREAMS); xmlnode_set_attrib(iq->node, "to", streamhost->jid); query = xmlnode_get_child(iq->node, "query"); xmlnode_set_attrib(query, "sid", jsx->stream_id); @@ -156,7 +156,7 @@ } else { - iq = jabber_iq_new_query(jsx->js, JABBER_IQ_RESULT, "http://jabber.org/protocol/bytestreams"); + iq = jabber_iq_new_query(jsx->js, JABBER_IQ_RESULT, NS_BYTESTREAMS); xmlnode_set_attrib(iq->node, "to", xfer->who); jabber_iq_set_id(iq, jsx->iq_id); query = xmlnode_get_child(iq->node, "query"); @@ -233,7 +233,7 @@ xmlnode_set_attrib(error, "code", "404"); xmlnode_set_attrib(error, "type", "cancel"); inf = xmlnode_new_child(error, "item-not-found"); - xmlnode_set_namespace(inf, "urn:ietf:params:xml:ns:xmpp-stanzas"); + xmlnode_set_namespace(inf, NS_XMPP_STANZAS); jabber_iq_send(iq); @@ -844,8 +844,7 @@ purple_xfer_unref(xfer); - iq = jabber_iq_new_query(jsx->js, JABBER_IQ_SET, - "http://jabber.org/protocol/bytestreams"); + iq = jabber_iq_new_query(jsx->js, JABBER_IQ_SET, NS_BYTESTREAMS); xmlnode_set_attrib(iq->node, "to", xfer->who); query = xmlnode_get_child(iq->node, "query"); @@ -1207,11 +1206,11 @@ if(var && !strcmp(var, "stream-method")) { if((value = xmlnode_get_child(field, "value"))) { char *val = xmlnode_get_data(value); - if(val && !strcmp(val, "http://jabber.org/protocol/bytestreams")) { + if(val && !strcmp(val, NS_BYTESTREAMS)) { jabber_si_xfer_bytestreams_send_init(xfer); jsx->stream_method |= STREAM_METHOD_BYTESTREAMS; found_method = TRUE; - } else if (val && !strcmp(val, XEP_0047_NAMESPACE)) { + } else if (val && !strcmp(val, NS_IBB)) { jsx->stream_method |= STREAM_METHOD_IBB; if (!found_method) { /* we haven't tried to init a bytestream session, yet @@ -1285,10 +1284,10 @@ behind troublesome firewalls */ option = xmlnode_new_child(field, "option"); value = xmlnode_new_child(option, "value"); - xmlnode_insert_data(value, "http://jabber.org/protocol/bytestreams", -1); + xmlnode_insert_data(value, NS_BYTESTREAMS, -1); option = xmlnode_new_child(field, "option"); value = xmlnode_new_child(option, "value"); - xmlnode_insert_data(value, "http://jabber.org/protocol/ibb", -1); + xmlnode_insert_data(value, NS_IBB, -1); jabber_iq_set_callback(iq, jabber_si_xfer_send_method_cb, xfer); @@ -1366,7 +1365,7 @@ jabber_ibb_session_close(jsx->ibb_session); } jabber_si_xfer_free(xfer); - purple_debug(PURPLE_DEBUG_INFO, "jabber", "in jabber_si_xfer_cancel_send\n"); + purple_debug_info("jabber", "in jabber_si_xfer_cancel_send\n"); } @@ -1389,16 +1388,16 @@ error = xmlnode_new_child(iq->node, "error"); xmlnode_set_attrib(error, "type", "cancel"); child = xmlnode_new_child(error, "forbidden"); - xmlnode_set_namespace(child, "urn:ietf:params:xml:ns:xmpp-stanzas"); + xmlnode_set_namespace(child, NS_XMPP_STANZAS); child = xmlnode_new_child(error, "text"); - xmlnode_set_namespace(child, "urn:ietf:params:xml:ns:xmpp-stanzas"); + xmlnode_set_namespace(child, NS_XMPP_STANZAS); xmlnode_insert_data(child, "Offer Declined", -1); jabber_iq_send(iq); } jabber_si_xfer_free(xfer); - purple_debug(PURPLE_DEBUG_INFO, "jabber", "in jabber_si_xfer_request_denied\n"); + purple_debug_info("jabber", "in jabber_si_xfer_request_denied\n"); } @@ -1410,7 +1409,7 @@ jabber_ibb_session_close(jsx->ibb_session); } jabber_si_xfer_free(xfer); - purple_debug(PURPLE_DEBUG_INFO, "jabber", "in jabber_si_xfer_cancel_recv\n"); + purple_debug_info("jabber", "in jabber_si_xfer_cancel_recv\n"); } @@ -1469,7 +1468,7 @@ if (jbr) { char *msg; - if (jabber_resource_has_capability(jbr, XEP_0047_NAMESPACE)) + if (jabber_resource_has_capability(jbr, NS_IBB)) jsx->stream_method |= STREAM_METHOD_IBB; if (jabber_resource_has_capability(jbr, "http://jabber.org/protocol/si/profile/file-transfer")) { jabber_si_xfer_send_request(xfer); @@ -1597,10 +1596,10 @@ for people who know their firewalls are very restrictive */ if (jsx->stream_method & STREAM_METHOD_BYTESTREAMS) { value = xmlnode_new_child(field, "value"); - xmlnode_insert_data(value, "http://jabber.org/protocol/bytestreams", -1); + xmlnode_insert_data(value, NS_BYTESTREAMS, -1); } else if(jsx->stream_method & STREAM_METHOD_IBB) { value = xmlnode_new_child(field, "value"); - xmlnode_insert_data(value, "http://jabber.org/protocol/ibb", -1); + xmlnode_insert_data(value, NS_IBB, -1); } jabber_iq_send(iq); @@ -1729,9 +1728,9 @@ if((value = xmlnode_get_child(option, "value"))) { char *val; if((val = xmlnode_get_data(value))) { - if(!strcmp(val, "http://jabber.org/protocol/bytestreams")) { + if(!strcmp(val, NS_BYTESTREAMS)) { jsx->stream_method |= STREAM_METHOD_BYTESTREAMS; - } else if(!strcmp(val, "http://jabber.org/protocol/ibb")) { + } else if(!strcmp(val, NS_IBB)) { jsx->stream_method |= STREAM_METHOD_IBB; } g_free(val);