diff options
author | John Bailey <rekkanoryo@rekkanoryo.org> | 2019-10-24 22:28:48 -0400 |
---|---|---|
committer | John Bailey <rekkanoryo@rekkanoryo.org> | 2019-10-24 22:28:48 -0400 |
commit | 6a1d26d99569e9ed87efc662550f942d737f2e19 (patch) | |
tree | e3b60bba1e4b1f0182709c197ad2c9aa01feb5f8 | |
parent | 27b6b18b8105b630bbffa903af8c2369ef321c33 (diff) | |
download | pidgin-6a1d26d99569e9ed87efc662550f942d737f2e19.tar.gz |
Rename Jabber to XMPP in Bonjour, as the official name is now XMPP and has been
for many years.
-rw-r--r-- | libpurple/protocols/bonjour/bonjour.c | 24 | ||||
-rw-r--r-- | libpurple/protocols/bonjour/bonjour.h | 6 | ||||
-rw-r--r-- | libpurple/protocols/bonjour/bonjour_ft.c | 42 | ||||
-rw-r--r-- | libpurple/protocols/bonjour/buddy.c | 2 | ||||
-rw-r--r-- | libpurple/protocols/bonjour/buddy.h | 4 | ||||
-rw-r--r-- | libpurple/protocols/bonjour/meson.build | 4 | ||||
-rw-r--r-- | libpurple/protocols/bonjour/parser.c | 30 | ||||
-rw-r--r-- | libpurple/protocols/bonjour/parser.h | 8 | ||||
-rw-r--r-- | libpurple/protocols/bonjour/xmpp.c (renamed from libpurple/protocols/bonjour/jabber.c) | 120 | ||||
-rw-r--r-- | libpurple/protocols/bonjour/xmpp.h (renamed from libpurple/protocols/bonjour/jabber.h) | 34 | ||||
-rw-r--r-- | po/POTFILES.in | 2 |
11 files changed, 138 insertions, 138 deletions
diff --git a/libpurple/protocols/bonjour/bonjour.c b/libpurple/protocols/bonjour/bonjour.c index 1e4240cc45..f00eb07aa7 100644 --- a/libpurple/protocols/bonjour/bonjour.c +++ b/libpurple/protocols/bonjour/bonjour.c @@ -35,9 +35,9 @@ #include "bonjour.h" #include "mdns_common.h" -#include "jabber.h" #include "buddy.h" #include "bonjour_ft.h" +#include "xmpp.h" static PurpleProtocol *my_protocol = NULL; @@ -104,12 +104,12 @@ bonjour_login(PurpleAccount *account) 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 @@ bonjour_login(PurpleAccount *account) 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_close(PurpleConnection *connection) 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); + g_free(bd->xmpp_data); } /* Delete the bonjour group @@ -206,7 +206,7 @@ bonjour_send_im(PurpleConnection *connection, PurpleMessage *msg) if (purple_message_is_empty(msg) || !purple_message_get_recipient(msg)) return 0; - 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_convo_closed(PurpleConnection *connection, const char *who) return; } - bonjour_jabber_close_conversation(bb->conversation); + bonjour_xmpp_close_conversation(bb->conversation); bb->conversation = NULL; } diff --git a/libpurple/protocols/bonjour/bonjour.h b/libpurple/protocols/bonjour/bonjour.h index 1ba24df770..5946b6ad5a 100644 --- a/libpurple/protocols/bonjour/bonjour.h +++ b/libpurple/protocols/bonjour/bonjour.h @@ -1,5 +1,5 @@ /** - * @file bonjour.h The Purple interface to mDNS and peer to peer Jabber. + * @file bonjour.h The Purple interface to mDNS and peer to peer XMPP. * * purple * @@ -32,7 +32,7 @@ #include <purple.h> #include "mdns_common.h" -#include "jabber.h" +#include "xmpp.h" #define BONJOUR_GROUP_NAME _("Bonjour") #define BONJOUR_PROTOCOL_NAME "bonjour" @@ -64,7 +64,7 @@ typedef struct typedef struct { BonjourDnsSd *dns_sd_data; - BonjourJabber *jabber_data; + BonjourXMPP *xmpp_data; GSList *xfer_lists; gchar *jid; } BonjourData; diff --git a/libpurple/protocols/bonjour/bonjour_ft.c b/libpurple/protocols/bonjour/bonjour_ft.c index 2a21087601..b0deb9141c 100644 --- a/libpurple/protocols/bonjour/bonjour_ft.c +++ b/libpurple/protocols/bonjour/bonjour_ft.c @@ -80,7 +80,7 @@ xep_ft_si_reject(BonjourData *bd, const char *id, const char *to, const char *er return; } - 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); if(iq == NULL) return; @@ -213,29 +213,29 @@ xep_ft_si_offer(PurpleXfer *xfer, const gchar *to) /* Assign stream id. */ g_free(xf->iq_id); 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); if(iq == NULL) return; /*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"); g_free(xf->sid); 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 @@ xep_ft_si_offer(PurpleXfer *xfer, const gchar *to) 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 @@ xep_ft_si_result(PurpleXfer *xfer, const char *to) bd = xf->data; 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); if(iq == NULL) return; 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 @@ xep_si_parse(PurpleConnection *pc, PurpleXmlNode *packet, PurpleBuddy *pb) 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; goffset filesize = 0; PurpleXmlNode *file; @@ -904,16 +904,16 @@ bonjour_bytestreams_listen(int sock, gpointer data) bd = xf->data; - 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)); while(local_ips) { @@ -981,9 +981,9 @@ bonjour_bytestreams_connect_cb(gpointer data, gint source, const gchar *error_me /* 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); diff --git a/libpurple/protocols/bonjour/buddy.c b/libpurple/protocols/bonjour/buddy.c index 70b52dc105..7df320f5dd 100644 --- a/libpurple/protocols/bonjour/buddy.c +++ b/libpurple/protocols/bonjour/buddy.c @@ -258,7 +258,7 @@ bonjour_buddy_delete(BonjourBuddy *buddy) g_free(buddy->node); g_free(buddy->ver); - bonjour_jabber_close_conversation(buddy->conversation); + bonjour_xmpp_close_conversation(buddy->conversation); buddy->conversation = NULL; /* Clean up any mdns implementation data */ diff --git a/libpurple/protocols/bonjour/buddy.h b/libpurple/protocols/bonjour/buddy.h index ae5e1ad5d3..54563d49c2 100644 --- a/libpurple/protocols/bonjour/buddy.h +++ b/libpurple/protocols/bonjour/buddy.h @@ -21,7 +21,7 @@ #include <purple.h> -#include "jabber.h" +#include "xmpp.h" typedef struct { @@ -45,7 +45,7 @@ typedef struct gchar *node; gchar *ver; - BonjourJabberConversation *conversation; + BonjourXMPPConversation *conversation; gpointer mdns_impl_data; } BonjourBuddy; diff --git a/libpurple/protocols/bonjour/meson.build b/libpurple/protocols/bonjour/meson.build index 7cb337d276..0a8cddf99d 100644 --- a/libpurple/protocols/bonjour/meson.build +++ b/libpurple/protocols/bonjour/meson.build @@ -3,8 +3,8 @@ BONJOURSOURCES = [ 'bonjour.h', 'buddy.c', 'buddy.h', - 'jabber.c', - 'jabber.h', + 'xmpp.c', + 'xmpp.h', 'mdns_common.c', 'mdns_common.h', 'mdns_interface.h', diff --git a/libpurple/protocols/bonjour/parser.c b/libpurple/protocols/bonjour/parser.c index 1b571820b3..54bf68478f 100644 --- a/libpurple/protocols/bonjour/parser.c +++ b/libpurple/protocols/bonjour/parser.c @@ -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> -#include "jabber.h" #include "parser.h" +#include "xmpp.h" static gboolean -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) { int i; /* If the "from" attribute is specified, attach it to the conversation. */ @@ -37,7 +37,7 @@ parse_from_attrib_and_find_buddy(BonjourJabberConversation *bconv, int nb_attrib 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 @@ bonjour_parser_element_start_libxml(void *user_data, int nb_namespaces, const xmlChar **namespaces, int nb_attributes, int nb_defaulted, const xmlChar **attributes) { - BonjourJabberConversation *bconv = user_data; + BonjourXMPPConversation *bconv = user_data; PurpleXmlNode *node; int i; @@ -66,7 +66,7 @@ bonjour_parser_element_start_libxml(void *user_data, if (bconv->pb == NULL) parse_from_attrib_and_find_buddy(bconv, nb_attributes, attributes); - bonjour_jabber_stream_started(bconv); + bonjour_xmpp_stream_started(bconv); } } else { @@ -79,7 +79,7 @@ bonjour_parser_element_start_libxml(void *user_data, /* 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 by using the IP */ - bonjour_jabber_conv_match_by_ip(bconv); + bonjour_xmpp_conv_match_by_ip(bconv); if(bconv->current) node = purple_xmlnode_new_child(bconv->current, (const char*) element_name); @@ -113,7 +113,7 @@ static void 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; if(!bconv->current) { /* We don't keep a reference to the start stream PurpleXmlNode, @@ -121,7 +121,7 @@ bonjour_parser_element_end_libxml(void *user_data, const xmlChar *element_name, 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); return; } @@ -131,7 +131,7 @@ bonjour_parser_element_end_libxml(void *user_data, const xmlChar *element_name, } else { PurpleXmlNode *packet = bconv->current; bconv->current = NULL; - 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_end_libxml(void *user_data, const xmlChar *element_name, static void bonjour_parser_element_text_libxml(void *user_data, const xmlChar *text, int text_len) { - BonjourJabberConversation *bconv = user_data; + BonjourXMPPConversation *bconv = user_data; if(!bconv->current) return; @@ -153,9 +153,9 @@ bonjour_parser_element_text_libxml(void *user_data, const xmlChar *text, int tex static void 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", bconv, error->domain, error->code, error->level, @@ -198,7 +198,7 @@ static xmlSAXHandler bonjour_parser_libxml = { }; void -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 @@ bonjour_parser_setup(BonjourJabberConversation *bconv) } -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) { diff --git a/libpurple/protocols/bonjour/parser.h b/libpurple/protocols/bonjour/parser.h index 0af733d62d..4fef5c5d7d 100644 --- a/libpurple/protocols/bonjour/parser.h +++ b/libpurple/protocols/bonjour/parser.h @@ -1,5 +1,5 @@ /** - * @file parser.h Bonjour Jabber XML parser functions + * @file parser.h Bonjour XMPP XML parser functions * * purple * @@ -26,9 +26,9 @@ #define PURPLE_BONJOUR_PARSER_H #include "buddy.h" -#include "jabber.h" +#include "xmpp.h" -void bonjour_parser_setup(BonjourJabberConversation *bconv); -void bonjour_parser_process(BonjourJabberConversation *bconv, const char *buf, int len); +void bonjour_parser_setup(BonjourXMPPConversation *bconv); +void bonjour_parser_process(BonjourXMPPConversation *bconv, const char *buf, int len); #endif /* PURPLE_BONJOUR_PARSER_H */ diff --git a/libpurple/protocols/bonjour/jabber.c b/libpurple/protocols/bonjour/xmpp.c index 10f461b0ca..ce803e9f00 100644 --- a/libpurple/protocols/bonjour/jabber.c +++ b/libpurple/protocols/bonjour/xmpp.c @@ -47,7 +47,7 @@ #include <ifaddrs.h> #endif -#include "jabber.h" +#include "xmpp.h" #include "parser.h" #include "bonjour.h" #include "buddy.h" @@ -62,7 +62,7 @@ #define STREAM_END "</stream:stream>" /* TODO: specify version='1.0' and send stream features */ #define DOCTYPE "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" \ - "<stream:stream xmlns=\"jabber:client\" xmlns:stream=\"http://etherx.jabber.org/streams\" from=\"%s\" to=\"%s\">" + "<stream:stream xmlns=\"xmpp:client\" xmlns:stream=\"http://etherx.xmpp.org/streams\" from=\"%s\" to=\"%s\">" enum sent_stream_start_types { NOT_SENT = 0, @@ -73,10 +73,10 @@ enum sent_stream_start_types { static void xep_iq_parse(PurpleXmlNode *packet, PurpleBuddy *pb); -static BonjourJabberConversation * -bonjour_jabber_conv_new(PurpleBuddy *pb, PurpleAccount *account, const char *ip) { +static BonjourXMPPConversation * +bonjour_xmpp_conv_new(PurpleBuddy *pb, PurpleAccount *account, const char *ip) { - BonjourJabberConversation *bconv = g_new0(BonjourJabberConversation, 1); + BonjourXMPPConversation *bconv = g_new0(BonjourXMPPConversation, 1); bconv->cancellable = g_cancellable_new(); bconv->tx_buf = purple_circular_buffer_new(512); bconv->tx_handler = 0; @@ -133,7 +133,7 @@ get_xmlnode_contents(PurpleXmlNode *node) } static void -_jabber_parse_and_write_message_to_ui(PurpleXmlNode *message_node, PurpleBuddy *pb) +_xmpp_parse_and_write_message_to_ui(PurpleXmlNode *message_node, PurpleBuddy *pb) { PurpleXmlNode *body_node, *html_node, *events_node; PurpleConnection *gc = purple_account_get_connection(purple_buddy_get_account(pb)); @@ -147,7 +147,7 @@ _jabber_parse_and_write_message_to_ui(PurpleXmlNode *message_node, PurpleBuddy * return; } - events_node = purple_xmlnode_get_child_with_namespace(message_node, "x", "jabber:x:event"); + events_node = purple_xmlnode_get_child_with_namespace(message_node, "x", "xmpp:x:event"); if (events_node != NULL) { if (purple_xmlnode_get_child(events_node, "id") != NULL) { /* The user is just typing */ @@ -262,7 +262,7 @@ _send_data_write_cb(GObject *stream, gpointer data) { PurpleBuddy *pb = data; BonjourBuddy *bb = purple_buddy_get_protocol_data(pb); - BonjourJabberConversation *bconv = bb->conversation; + BonjourXMPPConversation *bconv = bb->conversation; gsize writelen; gssize ret; GError *error = NULL; @@ -301,7 +301,7 @@ _send_data_write_cb(GObject *stream, gpointer data) _("Unable to send message."), PURPLE_MESSAGE_ERROR); - bonjour_jabber_close_conversation(bb->conversation); + bonjour_xmpp_close_conversation(bb->conversation); bb->conversation = NULL; g_clear_error(&error); return; @@ -314,7 +314,7 @@ static gint _send_data(PurpleBuddy *pb, char *message) { BonjourBuddy *bb = purple_buddy_get_protocol_data(pb); - BonjourJabberConversation *bconv = bb->conversation; + BonjourXMPPConversation *bconv = bb->conversation; gsize len = strlen(message); gssize ret; GError *error = NULL; @@ -354,7 +354,7 @@ _send_data(PurpleBuddy *pb, char *message) _("Unable to send message."), PURPLE_MESSAGE_ERROR); - bonjour_jabber_close_conversation(bb->conversation); + bonjour_xmpp_close_conversation(bb->conversation); bb->conversation = NULL; g_clear_error(&error); return -1; @@ -379,13 +379,13 @@ _send_data(PurpleBuddy *pb, char *message) return ret; } -void bonjour_jabber_process_packet(PurpleBuddy *pb, PurpleXmlNode *packet) { +void bonjour_xmpp_process_packet(PurpleBuddy *pb, PurpleXmlNode *packet) { g_return_if_fail(packet != NULL); g_return_if_fail(pb != NULL); if (purple_strequal(packet->name, "message")) - _jabber_parse_and_write_message_to_ui(packet, pb); + _xmpp_parse_and_write_message_to_ui(packet, pb); else if (purple_strequal(packet->name, "iq")) xep_iq_parse(packet, pb); else { @@ -394,7 +394,7 @@ void bonjour_jabber_process_packet(PurpleBuddy *pb, PurpleXmlNode *packet) { } } -static void bonjour_jabber_stream_ended(BonjourJabberConversation *bconv) { +static void bonjour_xmpp_stream_ended(BonjourXMPPConversation *bconv) { /* Inform the user that the conversation has been closed */ BonjourBuddy *bb = NULL; @@ -406,7 +406,7 @@ static void bonjour_jabber_stream_ended(BonjourJabberConversation *bconv) { bb = purple_buddy_get_protocol_data(bconv->pb); /* Close the socket, clear the watcher and free memory */ - bonjour_jabber_close_conversation(bconv); + bonjour_xmpp_close_conversation(bconv); if(bb) bb->conversation = NULL; } @@ -414,7 +414,7 @@ static void bonjour_jabber_stream_ended(BonjourJabberConversation *bconv) { static gboolean _client_socket_handler(GObject *stream, gpointer data) { - BonjourJabberConversation *bconv = data; + BonjourXMPPConversation *bconv = data; GError *error = NULL; gssize len; static char message[4096]; @@ -432,7 +432,7 @@ _client_socket_handler(GObject *stream, gpointer data) "receive of %" G_GSSIZE_FORMAT " error: %s", len, error ? error->message : "(null)"); - bonjour_jabber_close_conversation(bconv); + bonjour_xmpp_close_conversation(bconv); if (bconv->pb != NULL) { BonjourBuddy *bb = purple_buddy_get_protocol_data(bconv->pb); @@ -448,7 +448,7 @@ _client_socket_handler(GObject *stream, gpointer data) } else if (len == 0) { /* The other end has closed the socket */ const gchar *name = purple_buddy_get_name(bconv->pb); purple_debug_warning("bonjour", "Connection closed (without stream end) by %s.\n", (name) ? name : "(unknown)"); - bonjour_jabber_stream_ended(bconv); + bonjour_xmpp_stream_ended(bconv); return FALSE; } @@ -467,7 +467,7 @@ struct _stream_start_data { static void _start_stream(GObject *stream, gpointer data) { - BonjourJabberConversation *bconv = data; + BonjourXMPPConversation *bconv = data; struct _stream_start_data *ss = bconv->stream_data; GError *error = NULL; gsize len; @@ -505,7 +505,7 @@ _start_stream(GObject *stream, gpointer data) _("Unable to send the message, the conversation couldn't be started."), PURPLE_MESSAGE_ERROR); - bonjour_jabber_close_conversation(bconv); + bonjour_xmpp_close_conversation(bconv); if(bb != NULL) bb->conversation = NULL; @@ -530,11 +530,11 @@ _start_stream(GObject *stream, gpointer data) bconv->tx_handler = 0; bconv->sent_stream_start = FULLY_SENT; - bonjour_jabber_stream_started(bconv); + bonjour_xmpp_stream_started(bconv); } static gboolean -bonjour_jabber_send_stream_init(BonjourJabberConversation *bconv, +bonjour_xmpp_send_stream_init(BonjourXMPPConversation *bconv, GError **error) { gchar *stream_start; @@ -616,12 +616,12 @@ bonjour_jabber_send_stream_init(BonjourJabberConversation *bconv, /* This gets called when we've successfully sent our <stream:stream /> * AND when we've received a <stream:stream /> */ void -bonjour_jabber_stream_started(BonjourJabberConversation *bconv) +bonjour_xmpp_stream_started(BonjourXMPPConversation *bconv) { GError *error = NULL; if (bconv->sent_stream_start == NOT_SENT && - !bonjour_jabber_send_stream_init(bconv, &error)) { + !bonjour_xmpp_send_stream_init(bconv, &error)) { const char *bname = bconv->buddy_name; if (bconv->pb) @@ -653,7 +653,7 @@ bonjour_jabber_stream_started(BonjourJabberConversation *bconv) /* This must be asynchronous because it destroys the parser and we * may be in the middle of parsing. */ - async_bonjour_jabber_close_conversation(bconv); + async_bonjour_xmpp_close_conversation(bconv); g_clear_error(&error); return; } @@ -682,12 +682,12 @@ static void _server_socket_handler(GSocketService *service, GSocketConnection *connection, GObject *source_object, gpointer data) { - BonjourJabber *jdata = data; + BonjourXMPP *jdata = data; GSocketAddress *their_addr; /* connector's address information */ GInetAddress *their_inet_addr; gchar *address_text; struct _match_buddies_by_address *mbba; - BonjourJabberConversation *bconv; + BonjourXMPPConversation *bconv; GSList *buddies; GSource *source; @@ -733,7 +733,7 @@ _server_socket_handler(GSocketService *service, GSocketConnection *connection, /* We've established that this *could* be from one of our buddies. * Wait for the stream open to see if that matches too before assigning it. */ - bconv = bonjour_jabber_conv_new(NULL, jdata->account, address_text); + bconv = bonjour_xmpp_conv_new(NULL, jdata->account, address_text); /* We wait for the stream start before doing anything else */ bconv->socket = g_object_ref(connection); @@ -749,7 +749,7 @@ _server_socket_handler(GSocketService *service, GSocketConnection *connection, } gint -bonjour_jabber_start(BonjourJabber *jdata) +bonjour_xmpp_start(BonjourXMPP *jdata) { GError *error = NULL; guint16 port; @@ -858,7 +858,7 @@ _connected_to_buddy(GObject *source, GAsyncResult *res, gpointer user_data) _("Unable to send the message, the conversation couldn't be started."), PURPLE_MESSAGE_ERROR); - bonjour_jabber_close_conversation(bb->conversation); + bonjour_xmpp_close_conversation(bb->conversation); bb->conversation = NULL; return; } @@ -869,7 +869,7 @@ _connected_to_buddy(GObject *source, GAsyncResult *res, gpointer user_data) bb->conversation->output = g_io_stream_get_output_stream(G_IO_STREAM(conn)); - if (!bonjour_jabber_send_stream_init(bb->conversation, &error)) { + if (!bonjour_xmpp_send_stream_init(bb->conversation, &error)) { PurpleConversation *conv = NULL; PurpleAccount *account = NULL; @@ -888,7 +888,7 @@ _connected_to_buddy(GObject *source, GAsyncResult *res, gpointer user_data) _("Unable to send the message, the conversation couldn't be started."), PURPLE_MESSAGE_ERROR); - bonjour_jabber_close_conversation(bb->conversation); + bonjour_xmpp_close_conversation(bb->conversation); bb->conversation = NULL; g_clear_error(&error); return; @@ -904,7 +904,7 @@ _connected_to_buddy(GObject *source, GAsyncResult *res, gpointer user_data) } void -bonjour_jabber_conv_match_by_name(BonjourJabberConversation *bconv) { +bonjour_xmpp_conv_match_by_name(BonjourXMPPConversation *bconv) { PurpleBuddy *pb = NULL; BonjourBuddy *bb = NULL; @@ -925,7 +925,7 @@ bonjour_jabber_conv_match_by_name(BonjourJabberConversation *bconv) { if (ip != NULL && g_ascii_strcasecmp(ip, bconv->ip) == 0) { PurpleConnection *pc = purple_account_get_connection(bconv->account); BonjourData *bd = purple_connection_get_protocol_data(pc); - BonjourJabber *jdata = bd->jabber_data; + BonjourXMPP *jdata = bd->xmpp_data; purple_debug_info("bonjour", "Matched buddy %s to incoming conversation \"from\" attrib and IP (%s)\n", purple_buddy_get_name(pb), bconv->ip); @@ -935,7 +935,7 @@ bonjour_jabber_conv_match_by_name(BonjourJabberConversation *bconv) { /* Check if the buddy already has a conversation and, if so, replace it */ if(bb->conversation != NULL && bb->conversation != bconv) - bonjour_jabber_close_conversation(bb->conversation); + bonjour_xmpp_close_conversation(bb->conversation); bconv->pb = pb; bb->conversation = bconv; @@ -951,16 +951,16 @@ bonjour_jabber_conv_match_by_name(BonjourJabberConversation *bconv) { /* This must be asynchronous because it destroys the parser and we * may be in the middle of parsing. */ - async_bonjour_jabber_close_conversation(bconv); + async_bonjour_xmpp_close_conversation(bconv); } } void -bonjour_jabber_conv_match_by_ip(BonjourJabberConversation *bconv) { +bonjour_xmpp_conv_match_by_ip(BonjourXMPPConversation *bconv) { PurpleConnection *pc = purple_account_get_connection(bconv->account); BonjourData *bd = purple_connection_get_protocol_data(pc); - BonjourJabber *jdata = bd->jabber_data; + BonjourXMPP *jdata = bd->xmpp_data; struct _match_buddies_by_address *mbba; GSList *buddies; @@ -987,7 +987,7 @@ bonjour_jabber_conv_match_by_ip(BonjourJabberConversation *bconv) { /* Check if the buddy already has a conversation and, if so, replace it */ if (bb->conversation != NULL && bb->conversation != bconv) - bonjour_jabber_close_conversation(bb->conversation); + bonjour_xmpp_close_conversation(bb->conversation); bconv->pb = pb; bb->conversation = bconv; @@ -1000,7 +1000,7 @@ bonjour_jabber_conv_match_by_ip(BonjourJabberConversation *bconv) { /* This must be asynchronous because it destroys the parser and we * may be in the middle of parsing. */ - async_bonjour_jabber_close_conversation(bconv); + async_bonjour_xmpp_close_conversation(bconv); } g_slist_free(mbba->matched_buddies); @@ -1008,7 +1008,7 @@ bonjour_jabber_conv_match_by_ip(BonjourJabberConversation *bconv) { } static PurpleBuddy * -_find_or_start_conversation(BonjourJabber *jdata, const gchar *to) +_find_or_start_conversation(BonjourXMPP *jdata, const gchar *to) { PurpleBuddy *pb = NULL; BonjourBuddy *bb = NULL; @@ -1040,7 +1040,7 @@ _find_or_start_conversation(BonjourJabber *jdata, const gchar *to) return NULL; } - bb->conversation = bonjour_jabber_conv_new(pb, jdata->account, ip); + bb->conversation = bonjour_xmpp_conv_new(pb, jdata->account, ip); bb->conversation->ip_link = ip; g_socket_client_connect_to_host_async( @@ -1052,7 +1052,7 @@ _find_or_start_conversation(BonjourJabber *jdata, const gchar *to) } int -bonjour_jabber_send_message(BonjourJabber *jdata, const gchar *to, const gchar *body) +bonjour_xmpp_send_message(BonjourXMPP *jdata, const gchar *to, const gchar *body) { PurpleXmlNode *message_node, *node, *node2; gchar *message, *xhtml; @@ -1090,7 +1090,7 @@ bonjour_jabber_send_message(BonjourJabber *jdata, const gchar *to, const gchar * purple_xmlnode_insert_child(node, node2); node = purple_xmlnode_new_child(message_node, "x"); - purple_xmlnode_set_namespace(node, "jabber:x:event"); + purple_xmlnode_set_namespace(node, "xmpp:x:event"); purple_xmlnode_insert_child(node, purple_xmlnode_new("composing")); message = purple_xmlnode_to_str(message_node, NULL); @@ -1104,17 +1104,17 @@ bonjour_jabber_send_message(BonjourJabber *jdata, const gchar *to, const gchar * } static gboolean -_async_bonjour_jabber_close_conversation_cb(gpointer data) { - BonjourJabberConversation *bconv = data; - bonjour_jabber_close_conversation(bconv); +_async_bonjour_xmpp_close_conversation_cb(gpointer data) { + BonjourXMPPConversation *bconv = data; + bonjour_xmpp_close_conversation(bconv); return FALSE; } void -async_bonjour_jabber_close_conversation(BonjourJabberConversation *bconv) { +async_bonjour_xmpp_close_conversation(BonjourXMPPConversation *bconv) { PurpleConnection *pc = purple_account_get_connection(bconv->account); BonjourData *bd = purple_connection_get_protocol_data(pc); - BonjourJabber *jdata = bd->jabber_data; + BonjourXMPP *jdata = bd->xmpp_data; jdata->pending_conversations = g_slist_remove(jdata->pending_conversations, bconv); @@ -1125,11 +1125,11 @@ async_bonjour_jabber_close_conversation(BonjourJabberConversation *bconv) { bb->conversation = NULL; } - bconv->close_timeout = g_timeout_add(0, _async_bonjour_jabber_close_conversation_cb, bconv); + bconv->close_timeout = g_timeout_add(0, _async_bonjour_xmpp_close_conversation_cb, bconv); } void -bonjour_jabber_close_conversation(BonjourJabberConversation *bconv) +bonjour_xmpp_close_conversation(BonjourXMPPConversation *bconv) { BonjourData *bd = NULL; PurpleConnection *pc = NULL; @@ -1143,8 +1143,8 @@ bonjour_jabber_close_conversation(BonjourJabberConversation *bconv) bd = purple_connection_get_protocol_data(pc); if (bd) { - bd->jabber_data->pending_conversations = g_slist_remove( - bd->jabber_data->pending_conversations, bconv); + bd->xmpp_data->pending_conversations = g_slist_remove( + bd->xmpp_data->pending_conversations, bconv); } /* Cancel any file transfers that are waiting to begin */ @@ -1176,7 +1176,7 @@ bonjour_jabber_close_conversation(BonjourJabberConversation *bconv) STREAM_END, len, bconv->cancellable, NULL) != (gssize)len) { purple_debug_error("bonjour", - "bonjour_jabber_close_conversation: " + "bonjour_xmpp_close_conversation: " "couldn't send data\n"); } } @@ -1226,7 +1226,7 @@ bonjour_jabber_close_conversation(BonjourJabberConversation *bconv) } void -bonjour_jabber_stop(BonjourJabber *jdata) +bonjour_xmpp_stop(BonjourXMPP *jdata) { /* Close the server socket and remove the watcher */ if (jdata->service) { @@ -1245,7 +1245,7 @@ bonjour_jabber_stop(BonjourJabber *jdata) if (bb && bb->conversation) { /* Any ongoing connection attempt is cancelled * when a connection is destroyed */ - bonjour_jabber_close_conversation(bb->conversation); + bonjour_xmpp_close_conversation(bb->conversation); bb->conversation = NULL; } } @@ -1253,7 +1253,7 @@ bonjour_jabber_stop(BonjourJabber *jdata) g_slist_free(buddies); } - g_slist_free_full(jdata->pending_conversations, (GDestroyNotify)bonjour_jabber_close_conversation); + g_slist_free_full(jdata->pending_conversations, (GDestroyNotify)bonjour_xmpp_close_conversation); } XepIq * @@ -1293,7 +1293,7 @@ xep_iq_new(void *data, XepIqType type, const char *to, const char *from, const c iq = g_new0(XepIq, 1); iq->node = iq_node; iq->type = type; - iq->data = ((BonjourData*)data)->jabber_data; + iq->data = ((BonjourData*)data)->xmpp_data; iq->to = (char*)to; return iq; @@ -1347,7 +1347,7 @@ xep_iq_send_and_free(XepIq *iq) PurpleBuddy *pb = NULL; /* start the talk, reuse the message socket */ - pb = _find_or_start_conversation((BonjourJabber*) iq->data, iq->to); + pb = _find_or_start_conversation((BonjourXMPP*) iq->data, iq->to); /* Send the message */ if (pb != NULL) { /* Convert xml node into stream */ @@ -1365,7 +1365,7 @@ xep_iq_send_and_free(XepIq *iq) /* This returns a list containing all non-localhost IPs */ GSList * -bonjour_jabber_get_local_ips(int fd) +bonjour_xmpp_get_local_ips(int fd) { GSList *ips = NULL; const char *address_text; diff --git a/libpurple/protocols/bonjour/jabber.h b/libpurple/protocols/bonjour/xmpp.h index 20337f53b1..9ba22eda2a 100644 --- a/libpurple/protocols/bonjour/jabber.h +++ b/libpurple/protocols/bonjour/xmpp.h @@ -1,5 +1,5 @@ /** - * @file jabber.h The Purple interface to mDNS and peer to peer Jabber. + * @file xmpp.h The Purple interface to mDNS and peer to peer XMPP. * * purple * @@ -23,8 +23,8 @@ * */ -#ifndef PURPLE_BONJOUR_JABBER_H -#define PURPLE_BONJOUR_JABBER_H +#ifndef PURPLE_BONJOUR_XMPP_H +#define PURPLE_BONJOUR_XMPP_H #include <libxml/parser.h> @@ -36,7 +36,7 @@ typedef struct guint16 port; PurpleAccount *account; GSList *pending_conversations; -} BonjourJabber; +} BonjourXMPP; typedef struct { @@ -61,31 +61,31 @@ typedef struct gchar *ip; /* This points to a data entry in BonjourBuddy->ips */ const gchar *ip_link; -} BonjourJabberConversation; +} BonjourXMPPConversation; /** - * Start listening for jabber connections. + * Start listening for xmpp connections. * * @return -1 if there was a problem, else returns the listening * port number. */ -gint bonjour_jabber_start(BonjourJabber *data); +gint bonjour_xmpp_start(BonjourXMPP *data); -int bonjour_jabber_send_message(BonjourJabber *data, const char *to, const char *body); +int bonjour_xmpp_send_message(BonjourXMPP *data, const char *to, const char *body); -void bonjour_jabber_close_conversation(BonjourJabberConversation *bconv); +void bonjour_xmpp_close_conversation(BonjourXMPPConversation *bconv); -void async_bonjour_jabber_close_conversation(BonjourJabberConversation *bconv); +void async_bonjour_xmpp_close_conversation(BonjourXMPPConversation *bconv); -void bonjour_jabber_stream_started(BonjourJabberConversation *bconv); +void bonjour_xmpp_stream_started(BonjourXMPPConversation *bconv); -void bonjour_jabber_process_packet(PurpleBuddy *pb, PurpleXmlNode *packet); +void bonjour_xmpp_process_packet(PurpleBuddy *pb, PurpleXmlNode *packet); -void bonjour_jabber_stop(BonjourJabber *data); +void bonjour_xmpp_stop(BonjourXMPP *data); -void bonjour_jabber_conv_match_by_ip(BonjourJabberConversation *bconv); +void bonjour_xmpp_conv_match_by_ip(BonjourXMPPConversation *bconv); -void bonjour_jabber_conv_match_by_name(BonjourJabberConversation *bconv); +void bonjour_xmpp_conv_match_by_name(BonjourXMPPConversation *bconv); typedef enum { XEP_IQ_SET, @@ -105,8 +105,8 @@ typedef struct { XepIq *xep_iq_new(void *data, XepIqType type, const char *to, const char *from, const char *id); int xep_iq_send_and_free(XepIq *iq); -GSList * bonjour_jabber_get_local_ips(int fd); +GSList * bonjour_xmpp_get_local_ips(int fd); void append_iface_if_linklocal(char *ip, guint32 interface_param); -#endif /* PURPLE_BONJOUR_JABBER_H */ +#endif /* PURPLE_BONJOUR_XMPP_H */ diff --git a/po/POTFILES.in b/po/POTFILES.in index 4171aa5751..58d056791a 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -100,11 +100,11 @@ libpurple/protocols/bonjour/bonjour.c 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.c libpurple/protocols/facebook/api.c libpurple/protocols/facebook/data.c |