--- a/libpurple/protocols/bonjour/bonjour.c Sun Oct 20 00:24:28 2019 +0300
+++ b/libpurple/protocols/bonjour/bonjour.c Thu Oct 24 22:28:48 2019 -0400
@@ -35,9 +35,9 @@
static PurpleProtocol *my_protocol = NULL;
@@ -104,12 +104,12 @@
bd = g_new0(BonjourData, 1);
purple_connection_set_protocol_data(gc, bd);
- /* Start waiting for jabber connections (iChat style) */
- bd->jabber_data = g_new0(BonjourJabber, 1);
- bd->jabber_data->port = purple_account_get_int(account, "port", BONJOUR_DEFAULT_PORT);
- bd->jabber_data->account = account;
+ /* Start waiting for xmpp connections (iChat style) */ + bd->xmpp_data = g_new0(BonjourXMPP, 1); + bd->xmpp_data->port = purple_account_get_int(account, "port", BONJOUR_DEFAULT_PORT); + bd->xmpp_data->account = account; - if (bonjour_jabber_start(bd->jabber_data) == -1) {
+ if (bonjour_xmpp_start(bd->xmpp_data) == -1) { /* Send a message about the connection error */
purple_connection_error (gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
@@ -121,7 +121,7 @@
bd->dns_sd_data = bonjour_dns_sd_new();
bd->dns_sd_data->first = g_strdup(purple_account_get_string(account, "first", default_firstname));
bd->dns_sd_data->last = g_strdup(purple_account_get_string(account, "last", default_lastname));
- bd->dns_sd_data->port_p2pj = bd->jabber_data->port;
+ bd->dns_sd_data->port_p2pj = bd->xmpp_data->port; /* Not engaged in AV conference */
bd->dns_sd_data->vc = g_strdup("!");
@@ -168,11 +168,11 @@
bonjour_dns_sd_free(bd->dns_sd_data);
- if (bd != NULL && bd->jabber_data != NULL)
+ if (bd != NULL && bd->xmpp_data != NULL) /* Stop waiting for conversations */
- bonjour_jabber_stop(bd->jabber_data);
- g_free(bd->jabber_data);
+ bonjour_xmpp_stop(bd->xmpp_data); /* Delete the bonjour group
@@ -206,7 +206,7 @@
if (purple_message_is_empty(msg) || !purple_message_get_recipient(msg))
- return bonjour_jabber_send_message(bd->jabber_data,
+ return bonjour_xmpp_send_message(bd->xmpp_data, purple_message_get_recipient(msg),
purple_message_get_contents(msg));
@@ -319,7 +319,7 @@
- bonjour_jabber_close_conversation(bb->conversation);
+ bonjour_xmpp_close_conversation(bb->conversation); --- a/libpurple/protocols/bonjour/bonjour_ft.c Sun Oct 20 00:24:28 2019 +0300
+++ b/libpurple/protocols/bonjour/bonjour_ft.c Thu Oct 24 22:28:48 2019 -0400
@@ -80,7 +80,7 @@
- iq = xep_iq_new(bd, XEP_IQ_ERROR, to, bonjour_get_jid(bd->jabber_data->account), id);
+ iq = xep_iq_new(bd, XEP_IQ_ERROR, to, bonjour_get_jid(bd->xmpp_data->account), id); @@ -213,29 +213,29 @@
xf->iq_id = g_strdup_printf("%u", next_id++);
- iq = xep_iq_new(xf->data, XEP_IQ_SET, to, bonjour_get_jid(bd->jabber_data->account), xf->iq_id);
+ iq = xep_iq_new(xf->data, XEP_IQ_SET, to, bonjour_get_jid(bd->xmpp_data->account), xf->iq_id); /*Construct Stream initialization offer message.*/
si_node = purple_xmlnode_new_child(iq->node, "si");
- purple_xmlnode_set_namespace(si_node, "http://jabber.org/protocol/si");
- purple_xmlnode_set_attrib(si_node, "profile", "http://jabber.org/protocol/si/profile/file-transfer");
+ purple_xmlnode_set_namespace(si_node, "http://xmpp.org/protocol/si"); + purple_xmlnode_set_attrib(si_node, "profile", "http://xmpp.org/protocol/si/profile/file-transfer"); xf->sid = g_strdup(xf->iq_id);
purple_xmlnode_set_attrib(si_node, "id", xf->sid);
file = purple_xmlnode_new_child(si_node, "file");
- purple_xmlnode_set_namespace(file, "http://jabber.org/protocol/si/profile/file-transfer");
+ purple_xmlnode_set_namespace(file, "http://xmpp.org/protocol/si/profile/file-transfer"); purple_xmlnode_set_attrib(file, "name", purple_xfer_get_filename(xfer));
g_snprintf(buf, sizeof(buf), "%" G_GOFFSET_FORMAT, purple_xfer_get_size(xfer));
purple_xmlnode_set_attrib(file, "size", buf);
feature = purple_xmlnode_new_child(si_node, "feature");
- purple_xmlnode_set_namespace(feature, "http://jabber.org/protocol/feature-neg");
+ purple_xmlnode_set_namespace(feature, "http://xmpp.org/protocol/feature-neg"); x = purple_xmlnode_new_child(feature, "x");
- purple_xmlnode_set_namespace(x, "jabber:x:data");
+ purple_xmlnode_set_namespace(x, "xmpp:x:data"); purple_xmlnode_set_attrib(x, "type", "form");
field = purple_xmlnode_new_child(x, "field");
@@ -245,12 +245,12 @@
if (xf->mode & XEP_BYTESTREAMS) {
PurpleXmlNode *option = purple_xmlnode_new_child(field, "option");
PurpleXmlNode *value = purple_xmlnode_new_child(option, "value");
- purple_xmlnode_insert_data(value, "http://jabber.org/protocol/bytestreams", -1);
+ purple_xmlnode_insert_data(value, "http://xmpp.org/protocol/bytestreams", -1); if (xf->mode & XEP_IBB) {
PurpleXmlNode *option = purple_xmlnode_new_child(field, "option");
PurpleXmlNode *value = purple_xmlnode_new_child(option, "value");
- purple_xmlnode_insert_data(value, "http://jabber.org/protocol/ibb", -1);
+ purple_xmlnode_insert_data(value, "http://xmpp.org/protocol/ibb", -1); xep_iq_send_and_free(iq);
@@ -271,26 +271,26 @@
purple_debug_info("bonjour", "xep file transfer stream initialization result.\n");
- iq = xep_iq_new(bd, XEP_IQ_RESULT, to, bonjour_get_jid(bd->jabber_data->account), xf->iq_id);
+ iq = xep_iq_new(bd, XEP_IQ_RESULT, to, bonjour_get_jid(bd->xmpp_data->account), xf->iq_id); si_node = purple_xmlnode_new_child(iq->node, "si");
- purple_xmlnode_set_namespace(si_node, "http://jabber.org/protocol/si");
- /*purple_xmlnode_set_attrib(si_node, "profile", "http://jabber.org/protocol/si/profile/file-transfer");*/
+ purple_xmlnode_set_namespace(si_node, "http://xmpp.org/protocol/si"); + /*purple_xmlnode_set_attrib(si_node, "profile", "http://xmpp.org/protocol/si/profile/file-transfer");*/ feature = purple_xmlnode_new_child(si_node, "feature");
- purple_xmlnode_set_namespace(feature, "http://jabber.org/protocol/feature-neg");
+ purple_xmlnode_set_namespace(feature, "http://xmpp.org/protocol/feature-neg"); x = purple_xmlnode_new_child(feature, "x");
- purple_xmlnode_set_namespace(x, "jabber:x:data");
+ purple_xmlnode_set_namespace(x, "xmpp:x:data"); purple_xmlnode_set_attrib(x, "type", "submit");
field = purple_xmlnode_new_child(x, "field");
purple_xmlnode_set_attrib(field, "var", "stream-method");
value = purple_xmlnode_new_child(field, "value");
- purple_xmlnode_insert_data(value, "http://jabber.org/protocol/bytestreams", -1);
+ purple_xmlnode_insert_data(value, "http://xmpp.org/protocol/bytestreams", -1); xep_iq_send_and_free(iq);
@@ -438,7 +438,7 @@
profile = purple_xmlnode_get_attrib(si, "profile");
- if (purple_strequal(profile, "http://jabber.org/protocol/si/profile/file-transfer")) {
+ if (purple_strequal(profile, "http://xmpp.org/protocol/si/profile/file-transfer")) { const char *filename = NULL, *filesize_str = NULL;
@@ -904,16 +904,16 @@
- iq = xep_iq_new(bd, XEP_IQ_SET, purple_xfer_get_remote_user(xfer), bonjour_get_jid(bd->jabber_data->account), xf->sid);
+ iq = xep_iq_new(bd, XEP_IQ_SET, purple_xfer_get_remote_user(xfer), bonjour_get_jid(bd->xmpp_data->account), xf->sid); query = purple_xmlnode_new_child(iq->node, "query");
- purple_xmlnode_set_namespace(query, "http://jabber.org/protocol/bytestreams");
+ purple_xmlnode_set_namespace(query, "http://xmpp.org/protocol/bytestreams"); purple_xmlnode_set_attrib(query, "sid", xf->sid);
purple_xmlnode_set_attrib(query, "mode", "tcp");
purple_xfer_set_local_port(xfer, purple_network_get_port_from_fd(sock));
- local_ips = bonjour_jabber_get_local_ips(sock);
+ local_ips = bonjour_xmpp_get_local_ips(sock); port = g_strdup_printf("%hu", purple_xfer_get_local_port(xfer));
@@ -981,9 +981,9 @@
/* Here, start the file transfer.*/
/* Notify Initiator of Connection */
- iq = xep_iq_new(bd, XEP_IQ_RESULT, purple_xfer_get_remote_user(xfer), bonjour_get_jid(bd->jabber_data->account), xf->iq_id);
+ iq = xep_iq_new(bd, XEP_IQ_RESULT, purple_xfer_get_remote_user(xfer), bonjour_get_jid(bd->xmpp_data->account), xf->iq_id); q_node = purple_xmlnode_new_child(iq->node, "query");
- purple_xmlnode_set_namespace(q_node, "http://jabber.org/protocol/bytestreams");
+ purple_xmlnode_set_namespace(q_node, "http://xmpp.org/protocol/bytestreams"); tmp_node = purple_xmlnode_new_child(q_node, "streamhost-used");
purple_xmlnode_set_attrib(tmp_node, "jid", xf->jid);
xep_iq_send_and_free(iq);
--- a/libpurple/protocols/bonjour/parser.c Sun Oct 20 00:24:28 2019 +0300
+++ b/libpurple/protocols/bonjour/parser.c Thu Oct 24 22:28:48 2019 -0400
@@ -1,5 +1,5 @@
- * purple - Bonjour Jabber XML parser stuff
+ * purple - Bonjour XMPP XML parser stuff * Purple is the legal property of its developers, whose names are too numerous
* to list here. Please refer to the COPYRIGHT file distributed with this
@@ -25,11 +25,11 @@
#include <libxml/parser.h>
-parse_from_attrib_and_find_buddy(BonjourJabberConversation *bconv, int nb_attributes, const xmlChar **attributes) {
+parse_from_attrib_and_find_buddy(BonjourXMPPConversation *bconv, int nb_attributes, const xmlChar **attributes) { /* If the "from" attribute is specified, attach it to the conversation. */
@@ -37,7 +37,7 @@
if(!xmlStrcmp(attributes[i], (xmlChar*) "from")) {
int len = attributes[i+4] - attributes[i+3];
bconv->buddy_name = g_strndup((char *)attributes[i+3], len);
- bonjour_jabber_conv_match_by_name(bconv);
+ bonjour_xmpp_conv_match_by_name(bconv); return (bconv->pb != NULL);
@@ -52,7 +52,7 @@
int nb_namespaces, const xmlChar **namespaces,
int nb_attributes, int nb_defaulted, const xmlChar **attributes)
- BonjourJabberConversation *bconv = user_data;
+ BonjourXMPPConversation *bconv = user_data; @@ -66,7 +66,7 @@
parse_from_attrib_and_find_buddy(bconv, nb_attributes, attributes);
- bonjour_jabber_stream_started(bconv);
+ bonjour_xmpp_stream_started(bconv); @@ -79,7 +79,7 @@
/* We've run out of options for finding who the conversation is from
using explicitly specified stuff; see if we can make a good match
- bonjour_jabber_conv_match_by_ip(bconv);
+ bonjour_xmpp_conv_match_by_ip(bconv); node = purple_xmlnode_new_child(bconv->current, (const char*) element_name);
@@ -113,7 +113,7 @@
bonjour_parser_element_end_libxml(void *user_data, const xmlChar *element_name,
const xmlChar *prefix, const xmlChar *namespace)
- BonjourJabberConversation *bconv = user_data;
+ BonjourXMPPConversation *bconv = user_data; /* We don't keep a reference to the start stream PurpleXmlNode,
@@ -121,7 +121,7 @@
if(!xmlStrcmp(element_name, (xmlChar*) "stream"))
/* Asynchronously close the conversation to prevent bonjour_parser_setup()
* being called from within this context */
- async_bonjour_jabber_close_conversation(bconv);
+ async_bonjour_xmpp_close_conversation(bconv); @@ -131,7 +131,7 @@
PurpleXmlNode *packet = bconv->current;
- bonjour_jabber_process_packet(bconv->pb, packet);
+ bonjour_xmpp_process_packet(bconv->pb, packet); purple_xmlnode_free(packet);
@@ -139,7 +139,7 @@
bonjour_parser_element_text_libxml(void *user_data, const xmlChar *text, int text_len)
- BonjourJabberConversation *bconv = user_data;
+ BonjourXMPPConversation *bconv = user_data; @@ -153,9 +153,9 @@
bonjour_parser_structured_error_handler(void *user_data, xmlErrorPtr error)
- BonjourJabberConversation *bconv = user_data;
+ BonjourXMPPConversation *bconv = user_data; - purple_debug_error("jabber", "XML parser error for BonjourJabberConversation %p: "
+ purple_debug_error("xmpp", "XML parser error for BonjourXMPPConversation %p: " "Domain %i, code %i, level %i: %s",
error->domain, error->code, error->level,
@@ -198,7 +198,7 @@
-bonjour_parser_setup(BonjourJabberConversation *bconv)
+bonjour_parser_setup(BonjourXMPPConversation *bconv) /* This seems backwards, but it makes sense. The libxml code creates
@@ -213,7 +213,7 @@
-void bonjour_parser_process(BonjourJabberConversation *bconv, const char *buf, int len)
+void bonjour_parser_process(BonjourXMPPConversation *bconv, const char *buf, int len) if (bconv->context == NULL) {
--- a/po/POTFILES.in Sun Oct 20 00:24:28 2019 +0300
+++ b/po/POTFILES.in Thu Oct 24 22:28:48 2019 -0400
@@ -100,11 +100,11 @@
libpurple/protocols/bonjour/bonjour_ft.c
libpurple/protocols/bonjour/buddy.c
libpurple/protocols/bonjour/dns_sd_proxy.c
-libpurple/protocols/bonjour/jabber.c
libpurple/protocols/bonjour/mdns_avahi.c
libpurple/protocols/bonjour/mdns_common.c
libpurple/protocols/bonjour/mdns_dns_sd.c
libpurple/protocols/bonjour/parser.c
+libpurple/protocols/bonjour/xmpp.c libpurple/protocols/facebook/api.c
libpurple/protocols/facebook/data.c