Mercurial > pidgin
changeset 28648:1a4b6f47258c
merge of '5e1784d5a975dc0726e72521fbf6024dfa281d84'
and 'e28bbfa3c8184843c6f30c7fe26da08ade3873c2'
author | Paul Aurich <paul@darkrain42.org> |
---|---|
date | Fri, 27 Nov 2009 07:13:38 +0000 |
parents | f1437342cc0e (diff) c31f166d25a0 (current diff) |
children | 8d8a1afc4268 |
files | libpurple/protocols/jabber/jabber.c |
diffstat | 62 files changed, 171 insertions(+), 147 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/certificate.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/certificate.c Fri Nov 27 07:13:38 2009 +0000 @@ -26,8 +26,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ -#include <glib.h> - #include "internal.h" #include "certificate.h" #include "dbus-maybe.h"
--- a/libpurple/cmds.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/cmds.c Fri Nov 27 07:13:38 2009 +0000 @@ -21,8 +21,6 @@ * */ -#include <string.h> - #include "internal.h" #include "account.h"
--- a/libpurple/dbus-server.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/dbus-server.c Fri Nov 27 07:13:38 2009 +0000 @@ -25,6 +25,8 @@ #define DBUS_API_SUBJECT_TO_CHANGE #endif +#include "internal.h" + #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -42,7 +44,6 @@ #include "dbus-bindings.h" #include "debug.h" #include "core.h" -#include "internal.h" #include "savedstatuses.h" #include "smiley.h" #include "util.h"
--- a/libpurple/debug.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/debug.c Fri Nov 27 07:13:38 2009 +0000 @@ -23,8 +23,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ +#include "internal.h" #include "debug.h" -#include "internal.h" #include "prefs.h" #include "util.h"
--- a/libpurple/desktopitem.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/desktopitem.c Fri Nov 27 07:13:38 2009 +0000 @@ -53,12 +53,12 @@ * Boston, MA 02111-1301, USA. */ +#include "internal.h" #include <errno.h> #include <stdio.h> #include <string.h> #include <time.h> #include "desktopitem.h" -#include "internal.h" struct _PurpleDesktopItem { int refcount;
--- a/libpurple/eventloop.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/eventloop.c Fri Nov 27 07:13:38 2009 +0000 @@ -23,8 +23,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ +#include "internal.h" #include "eventloop.h" -#include "internal.h" static PurpleEventLoopUiOps *eventloop_ui_ops = NULL;
--- a/libpurple/imgstore.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/imgstore.c Fri Nov 27 07:13:38 2009 +0000 @@ -25,7 +25,6 @@ * */ -#include <glib.h> #include "internal.h" #include "dbus-maybe.h"
--- a/libpurple/media.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/media.c Fri Nov 27 07:13:38 2009 +0000 @@ -24,8 +24,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ -#include <string.h> - #include "internal.h" #include "account.h"
--- a/libpurple/mime.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/mime.c Fri Nov 27 07:13:38 2009 +0000 @@ -21,11 +21,6 @@ * USA. */ -#include <stdio.h> -#include <string.h> - -#include <glib.h> - #include "internal.h" /* this should become "util.h" if we ever get this into purple proper */
--- a/libpurple/nat-pmp.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/nat-pmp.c Fri Nov 27 07:13:38 2009 +0000 @@ -29,8 +29,8 @@ * OF SUCH DAMAGE. */ +#include "internal.h" #include "nat-pmp.h" -#include "internal.h" #include "debug.h" #include "signals.h" #include "network.h"
--- a/libpurple/ntlm.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/ntlm.c Fri Nov 27 07:13:38 2009 +0000 @@ -24,8 +24,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ -#include <glib.h> -#include <stdlib.h> #include "internal.h" #include "util.h"
--- a/libpurple/plugins/log_reader.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/plugins/log_reader.c Fri Nov 27 07:13:38 2009 +0000 @@ -1,7 +1,7 @@ +#include "internal.h" + #include <stdio.h> -#include "internal.h" - #include "debug.h" #include "log.h" #include "plugin.h"
--- a/libpurple/plugins/signals-test.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/plugins/signals-test.c Fri Nov 27 07:13:38 2009 +0000 @@ -20,9 +20,10 @@ */ #define SIGNAL_TEST_PLUGIN_ID "core-signals-test" +#include "internal.h" + #include <stdio.h> -#include "internal.h" #include "cipher.h" #include "connection.h" #include "conversation.h"
--- a/libpurple/protocols/jabber/Makefile.am Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/protocols/jabber/Makefile.am Fri Nov 27 07:13:38 2009 +0000 @@ -5,12 +5,17 @@ pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION) -JABBERSOURCES = auth.c \ +JABBERSOURCES = \ + adhoccommands.c \ + adhoccommands.h \ + auth.c \ auth.h \ buddy.c \ buddy.h \ bosh.c \ bosh.h \ + caps.c \ + caps.h \ chat.c \ chat.h \ data.c \ @@ -43,10 +48,13 @@ jutil.h \ message.c \ message.h \ + namespaces.h \ oob.c \ oob.h \ parser.c \ parser.h \ + pep.c \ + pep.h \ ping.c \ ping.h \ presence.c \ @@ -55,14 +63,6 @@ roster.h \ si.c \ si.h \ - xdata.c \ - xdata.h \ - caps.c \ - caps.h \ - adhoccommands.c \ - adhoccommands.h \ - pep.c \ - pep.h \ useravatar.c \ useravatar.h \ usermood.c \ @@ -70,7 +70,9 @@ usernick.c \ usernick.h \ usertune.c \ - usertune.h + usertune.h \ + xdata.c \ + xdata.h AM_CFLAGS = $(st)
--- a/libpurple/protocols/jabber/data.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/protocols/jabber/data.c Fri Nov 27 07:13:38 2009 +0000 @@ -18,11 +18,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ +#include "internal.h" + #include <stdlib.h> #include <glib.h> #include <string.h> -#include "internal.h" #include "data.h" #include "debug.h" #include "xmlnode.h" @@ -140,7 +141,7 @@ xmlnode *tag = xmlnode_new("data"); char *base64data = purple_base64_encode(data->data, data->size); - xmlnode_set_namespace(tag, XEP_0231_NAMESPACE); + xmlnode_set_namespace(tag, NS_BOB); xmlnode_set_attrib(tag, "cid", data->cid); xmlnode_set_attrib(tag, "type", data->type); @@ -169,7 +170,7 @@ { xmlnode *tag = xmlnode_new("data"); - xmlnode_set_namespace(tag, XEP_0231_NAMESPACE); + xmlnode_set_namespace(tag, NS_BOB); xmlnode_set_attrib(tag, "cid", cid); return tag; @@ -254,7 +255,7 @@ remote_data_by_cid = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, jabber_data_delete); - jabber_iq_register_handler("data", XEP_0231_NAMESPACE, jabber_data_parse); + jabber_iq_register_handler("data", NS_BOB, jabber_data_parse); } void
--- a/libpurple/protocols/jabber/data.h Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/protocols/jabber/data.h Fri Nov 27 07:13:38 2009 +0000 @@ -24,8 +24,6 @@ #include "xmlnode.h" #include "jabber.h" -#define XEP_0231_NAMESPACE "urn:xmpp:bob" - #include <glib.h> typedef struct {
--- a/libpurple/protocols/jabber/disco.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/protocols/jabber/disco.c Fri Nov 27 07:13:38 2009 +0000 @@ -152,7 +152,7 @@ * advertises as 'voice-v1'. */ xmlnode *feature = xmlnode_new_child(query, "feature"); - xmlnode_set_attrib(feature, "var", "http://www.google.com/xmpp/protocol/voice/v1"); + xmlnode_set_attrib(feature, "var", NS_GOOGLE_VOICE); } else if (g_str_equal(node, CAPS0115_NODE "#" "video-v1")) { /* * HUGE HACK! We advertise this ext (see jabber_presence_create_js @@ -164,7 +164,7 @@ * advertises as 'video-v1'. */ xmlnode *feature = xmlnode_new_child(query, "feature"); - xmlnode_set_attrib(feature, "var", "http://www.google.com/xmpp/protocol/video/v1"); + xmlnode_set_attrib(feature, "var", NS_GOOGLE_VIDEO); } else if (g_str_equal(node, CAPS0115_NODE "#" "camera-v1")) { /* * HUGE HACK! We advertise this ext (see jabber_presence_create_js @@ -176,7 +176,7 @@ * advertises as 'camera-v1'. */ xmlnode *feature = xmlnode_new_child(query, "feature"); - xmlnode_set_attrib(feature, "var", "http://www.google.com/xmpp/protocol/camera/v1"); + xmlnode_set_attrib(feature, "var", NS_GOOGLE_CAMERA); #endif } else { xmlnode *error, *inf; @@ -290,7 +290,7 @@ capabilities |= JABBER_CAP_IQ_SEARCH; else if(!strcmp(var, "jabber:iq:register")) capabilities |= JABBER_CAP_IQ_REGISTER; - else if(!strcmp(var, "urn:xmpp:ping")) + else if(!strcmp(var, NS_PING)) capabilities |= JABBER_CAP_PING; else if(!strcmp(var, "http://jabber.org/protocol/disco#items")) capabilities |= JABBER_CAP_ITEMS;
--- a/libpurple/protocols/jabber/google.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/protocols/jabber/google.c Fri Nov 27 07:13:38 2009 +0000 @@ -37,9 +37,6 @@ #ifdef USE_VV -#define NS_GOOGLE_VIDEO "http://www.google.com/session/video" -#define NS_GOOGLE_PHONE "http://www.google.com/session/phone" - typedef struct { char *id; char *initiator; @@ -84,7 +81,7 @@ google_session_create_xmlnode(GoogleSession *session, const char *type) { xmlnode *node = xmlnode_new("session"); - xmlnode_set_namespace(node, "http://www.google.com/session"); + xmlnode_set_namespace(node, NS_GOOGLE_SESSION); xmlnode_set_attrib(node, "id", session->id.id); xmlnode_set_attrib(node, "initiator", session->id.initiator); xmlnode_set_attrib(node, "type", type); @@ -213,9 +210,9 @@ xmlnode_insert_child(iq->node, sess); desc = xmlnode_new_child(sess, "description"); if (session->video) - xmlnode_set_namespace(desc, NS_GOOGLE_VIDEO); + xmlnode_set_namespace(desc, NS_GOOGLE_SESSION_VIDEO); else - xmlnode_set_namespace(desc, NS_GOOGLE_PHONE); + xmlnode_set_namespace(desc, NS_GOOGLE_SESSION_PHONE); codecs = purple_media_get_codecs(media, "google-video"); @@ -248,7 +245,7 @@ purple_media_codec_get_clock_rate(codec)); payload = xmlnode_new_child(desc, "payload-type"); if (session->video) - xmlnode_set_namespace(payload, NS_GOOGLE_PHONE); + xmlnode_set_namespace(payload, NS_GOOGLE_SESSION_PHONE); xmlnode_set_attrib(payload, "id", id); /* * Hack to make Gmail accept speex as the codec. @@ -439,9 +436,9 @@ desc_element = xmlnode_get_child(sess, "description"); xmlns = xmlnode_get_namespace(desc_element); - if (purple_strequal(xmlns, NS_GOOGLE_PHONE)) + if (purple_strequal(xmlns, NS_GOOGLE_SESSION_PHONE)) session->video = FALSE; - else if (purple_strequal(xmlns, NS_GOOGLE_VIDEO)) + else if (purple_strequal(xmlns, NS_GOOGLE_SESSION_VIDEO)) session->video = TRUE; else { purple_debug_error("jabber", "Received initiate with " @@ -498,7 +495,7 @@ id = xmlnode_get_attrib(codec_element, "id"); if (!session->video || - (xmlns && !strcmp(xmlns, NS_GOOGLE_PHONE))) { + (xmlns && !strcmp(xmlns, NS_GOOGLE_SESSION_PHONE))) { clock_rate = xmlnode_get_attrib( codec_element, "clockrate"); video = FALSE; @@ -623,7 +620,7 @@ GList *codecs = NULL, *video_codecs = NULL; JabberIq *result = NULL; const gchar *xmlns = xmlnode_get_namespace(desc_element); - gboolean video = (xmlns && !strcmp(xmlns, NS_GOOGLE_VIDEO)); + gboolean video = (xmlns && !strcmp(xmlns, NS_GOOGLE_SESSION_VIDEO)); for (; codec_element; codec_element = codec_element->next) { const gchar *xmlns, *encoding_name, *id, @@ -637,7 +634,7 @@ encoding_name = xmlnode_get_attrib(codec_element, "name"); id = xmlnode_get_attrib(codec_element, "id"); - if (!video || purple_strequal(xmlns, NS_GOOGLE_PHONE)) + if (!video || purple_strequal(xmlns, NS_GOOGLE_SESSION_PHONE)) clock_rate = xmlnode_get_attrib( codec_element, "clockrate"); else { @@ -1401,7 +1398,7 @@ xmlnode *packet, gpointer data) { xmlnode *query = xmlnode_get_child_with_namespace(packet, "query", - GOOGLE_JINGLE_INFO_NAMESPACE); + NS_GOOGLE_JINGLE_INFO); if (query) jabber_google_jingle_info_common(js, from, type, query); @@ -1421,7 +1418,7 @@ jabber_google_send_jingle_info(JabberStream *js) { JabberIq *jingle_info = - jabber_iq_new_query(js, JABBER_IQ_GET, GOOGLE_JINGLE_INFO_NAMESPACE); + jabber_iq_new_query(js, JABBER_IQ_GET, NS_GOOGLE_JINGLE_INFO); jabber_iq_set_callback(jingle_info, jabber_google_jingle_info_cb, NULL);
--- a/libpurple/protocols/jabber/google.h Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/protocols/jabber/google.h Fri Nov 27 07:13:38 2009 +0000 @@ -25,11 +25,6 @@ * such that they don't intermingle with code for the XMPP RFCs and XEPs :) */ #include "jabber.h" -#include "media.h" - -#define GOOGLE_VOICE_CAP "http://www.google.com/xmpp/protocol/voice/v1" -#define GOOGLE_VIDEO_CAP "http://www.google.com/xmpp/protocol/video/v1" -#define GOOGLE_JINGLE_INFO_NAMESPACE "google:jingleinfo" #define GOOGLE_GROUPCHAT_SERVER "groupchat.google.com"
--- a/libpurple/protocols/jabber/ibb.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/protocols/jabber/ibb.c Fri Nov 27 07:13:38 2009 +0000 @@ -228,7 +228,7 @@ gchar block_size[10]; xmlnode_set_attrib(set->node, "to", jabber_ibb_session_get_who(sess)); - xmlnode_set_namespace(open, XEP_0047_NAMESPACE); + xmlnode_set_namespace(open, NS_IBB); xmlnode_set_attrib(open, "sid", jabber_ibb_session_get_sid(sess)); g_snprintf(block_size, sizeof(block_size), "%" G_GSIZE_FORMAT, jabber_ibb_session_get_block_size(sess)); @@ -256,7 +256,7 @@ xmlnode *close = xmlnode_new("close"); xmlnode_set_attrib(set->node, "to", jabber_ibb_session_get_who(sess)); - xmlnode_set_namespace(close, XEP_0047_NAMESPACE); + xmlnode_set_namespace(close, NS_IBB); xmlnode_set_attrib(close, "sid", jabber_ibb_session_get_sid(sess)); xmlnode_insert_child(set->node, close); jabber_iq_send(set); @@ -333,7 +333,7 @@ g_snprintf(seq, sizeof(seq), "%u", jabber_ibb_session_get_send_seq(sess)); xmlnode_set_attrib(set->node, "to", jabber_ibb_session_get_who(sess)); - xmlnode_set_namespace(data_element, XEP_0047_NAMESPACE); + xmlnode_set_namespace(data_element, NS_IBB); xmlnode_set_attrib(data_element, "sid", jabber_ibb_session_get_sid(sess)); xmlnode_set_attrib(data_element, "seq", seq); xmlnode_insert_data(data_element, base64, -1); @@ -507,11 +507,11 @@ { jabber_ibb_sessions = g_hash_table_new(g_str_hash, g_str_equal); - jabber_add_feature(XEP_0047_NAMESPACE, NULL); + jabber_add_feature(NS_IBB, NULL); - jabber_iq_register_handler("close", XEP_0047_NAMESPACE, jabber_ibb_parse); - jabber_iq_register_handler("data", XEP_0047_NAMESPACE, jabber_ibb_parse); - jabber_iq_register_handler("open", XEP_0047_NAMESPACE, jabber_ibb_parse); + jabber_iq_register_handler("close", NS_IBB, jabber_ibb_parse); + jabber_iq_register_handler("data", NS_IBB, jabber_ibb_parse); + jabber_iq_register_handler("open", NS_IBB, jabber_ibb_parse); } void
--- a/libpurple/protocols/jabber/ibb.h Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/protocols/jabber/ibb.h Fri Nov 27 07:13:38 2009 +0000 @@ -24,8 +24,6 @@ #include "jabber.h" #include "iq.h" -#define XEP_0047_NAMESPACE "http://jabber.org/protocol/ibb" - typedef struct _JabberIBBSession JabberIBBSession; typedef void
--- a/libpurple/protocols/jabber/iq.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/protocols/jabber/iq.c Fri Nov 27 07:13:38 2009 +0000 @@ -462,8 +462,8 @@ jabber_gmail_poke); jabber_iq_register_handler("new-mail", "google:mail:notify", jabber_gmail_poke); - jabber_iq_register_handler("ping", "urn:xmpp:ping", jabber_ping_parse); - jabber_iq_register_handler("query", GOOGLE_JINGLE_INFO_NAMESPACE, + jabber_iq_register_handler("ping", NS_PING, jabber_ping_parse); + jabber_iq_register_handler("query", NS_GOOGLE_JINGLE_INFO, jabber_google_handle_jingle_info); jabber_iq_register_handler("query", "http://jabber.org/protocol/bytestreams", jabber_bytestreams_parse); @@ -480,7 +480,7 @@ jabber_iq_register_handler("query", "jabber:iq:version", jabber_iq_version_parse); #ifdef USE_VV - jabber_iq_register_handler("session", "http://www.google.com/session", + jabber_iq_register_handler("session", NS_GOOGLE_SESSION, jabber_google_session_parse); #endif jabber_iq_register_handler("block", "urn:xmpp:blocking", jabber_blocklist_parse_push);
--- a/libpurple/protocols/jabber/jabber.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/protocols/jabber/jabber.c Fri Nov 27 07:13:38 2009 +0000 @@ -2842,7 +2842,7 @@ return FALSE; } - if (jabber_resource_has_capability(jbr, XEP_0224_NAMESPACE)) { + if (jabber_resource_has_capability(jbr, NS_ATTENTION)) { xmlnode *buzz, *msg = xmlnode_new("message"); gchar *to; @@ -2854,7 +2854,7 @@ xmlnode_set_attrib(msg, "type", "headline"); buzz = xmlnode_new_child(msg, "attention"); - xmlnode_set_namespace(buzz, XEP_0224_NAMESPACE); + xmlnode_set_namespace(buzz, NS_ATTENTION); jabber_send(js, msg); xmlnode_free(msg); @@ -3019,8 +3019,7 @@ if (type & PURPLE_MEDIA_AUDIO && !jabber_resource_has_capability(jbr, JINGLE_APP_RTP_SUPPORT_AUDIO) && - jabber_resource_has_capability(jbr, - GOOGLE_VOICE_CAP)) + jabber_resource_has_capability(jbr, NS_GOOGLE_VOICE)) return jabber_google_session_initiate(js, who, type); else return jingle_rtp_initiate_media(js, who, type); @@ -3189,10 +3188,9 @@ caps |= PURPLE_MEDIA_CAPS_MODIFY_SESSION | PURPLE_MEDIA_CAPS_CHANGE_DIRECTION; } - if (jabber_resource_has_capability(jbr, GOOGLE_VOICE_CAP)) { + if (jabber_resource_has_capability(jbr, NS_GOOGLE_VOICE)) { caps |= PURPLE_MEDIA_CAPS_AUDIO; - if (jabber_resource_has_capability(jbr, - GOOGLE_VIDEO_CAP)) + if (jabber_resource_has_capability(jbr, NS_GOOGLE_VIDEO)) caps |= PURPLE_MEDIA_CAPS_AUDIO_VIDEO; } return caps; @@ -3270,8 +3268,7 @@ "http://jabber.org/protocol/si/profile/file-transfer") && (jabber_resource_has_capability(jbr, "http://jabber.org/protocol/bytestreams") - || jabber_resource_has_capability(jbr, - XEP_0047_NAMESPACE))) { + || jabber_resource_has_capability(jbr, NS_IBB))) { return TRUE; } } @@ -3492,28 +3489,28 @@ jabber_add_feature("http://jabber.org/protocol/chatstates", 0); jabber_add_feature("http://jabber.org/protocol/disco#info", 0); jabber_add_feature("http://jabber.org/protocol/disco#items", 0); - jabber_add_feature("http://jabber.org/protocol/ibb", 0); + jabber_add_feature(NS_IBB, 0); jabber_add_feature("http://jabber.org/protocol/muc", 0); jabber_add_feature("http://jabber.org/protocol/muc#user", 0); jabber_add_feature("http://jabber.org/protocol/si", 0); jabber_add_feature("http://jabber.org/protocol/si/profile/file-transfer", 0); jabber_add_feature("http://jabber.org/protocol/xhtml-im", 0); - jabber_add_feature("urn:xmpp:ping", 0); + jabber_add_feature(NS_PING, 0); /* Buzz/Attention */ - jabber_add_feature(XEP_0224_NAMESPACE, jabber_buzz_isenabled); + jabber_add_feature(NS_ATTENTION, jabber_buzz_isenabled); /* Bits Of Binary */ - jabber_add_feature(XEP_0231_NAMESPACE, 0); + jabber_add_feature(NS_BOB, 0); /* Jingle features! */ jabber_add_feature(JINGLE, 0); #ifdef USE_VV - jabber_add_feature("http://www.google.com/xmpp/protocol/session", jabber_audio_enabled); - jabber_add_feature("http://www.google.com/xmpp/protocol/voice/v1", jabber_audio_enabled); - jabber_add_feature("http://www.google.com/xmpp/protocol/video/v1", jabber_video_enabled); - jabber_add_feature("http://www.google.com/xmpp/protocol/camera/v1", jabber_video_enabled); + jabber_add_feature(NS_GOOGLE_PROTOCOL_SESSION, jabber_audio_enabled); + jabber_add_feature(NS_GOOGLE_VOICE, jabber_audio_enabled); + jabber_add_feature(NS_GOOGLE_VIDEO, jabber_video_enabled); + jabber_add_feature(NS_GOOGLE_CAMERA, jabber_video_enabled); jabber_add_feature(JINGLE_APP_RTP, 0); jabber_add_feature(JINGLE_APP_RTP_SUPPORT_AUDIO, jabber_audio_enabled); jabber_add_feature(JINGLE_APP_RTP_SUPPORT_VIDEO, jabber_video_enabled);
--- a/libpurple/protocols/jabber/jabber.h Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/protocols/jabber/jabber.h Fri Nov 27 07:13:38 2009 +0000 @@ -64,6 +64,8 @@ #include "roomlist.h" #include "sslconn.h" +#include "namespaces.h" + #include "iq.h" #include "jutil.h" #include "xmlnode.h"
--- a/libpurple/protocols/jabber/jingle/session.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/protocols/jabber/jingle/session.c Fri Nov 27 07:13:38 2009 +0000 @@ -360,11 +360,15 @@ JingleSession * jingle_session_find_by_sid(JabberStream *js, const gchar *sid) { + JingleSession *session = NULL; + + if (js->sessions) + session = g_hash_table_lookup(js->sessions, sid); + purple_debug_info("jingle", "find_by_id %s\n", sid); - purple_debug_info("jingle", "lookup: %p\n", (js->sessions) ? - g_hash_table_lookup(js->sessions, sid) : NULL); - return (JingleSession *) (js->sessions) ? - g_hash_table_lookup(js->sessions, sid) : NULL; + purple_debug_info("jingle", "lookup: %p\n", session); + + return session; } #if GLIB_CHECK_VERSION(2,4,0)
--- a/libpurple/protocols/jabber/message.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/protocols/jabber/message.c Fri Nov 27 07:13:38 2009 +0000 @@ -460,7 +460,7 @@ jabber_message_add_remote_smileys(const xmlnode *message) { xmlnode *data_tag; - for (data_tag = xmlnode_get_child_with_namespace(message, "data", XEP_0231_NAMESPACE) ; + for (data_tag = xmlnode_get_child_with_namespace(message, "data", NS_BOB) ; data_tag ; data_tag = xmlnode_get_next_twin(data_tag)) { const gchar *cid = xmlnode_get_attrib(data_tag, "cid"); @@ -740,7 +740,7 @@ jm->type = JABBER_MESSAGE_EVENT; for(items = xmlnode_get_child(child,"items"); items; items = items->next) jm->eventitems = g_list_append(jm->eventitems, items); - } else if(!strcmp(child->name, "attention") && !strcmp(xmlns, XEP_0224_NAMESPACE)) { + } else if(!strcmp(child->name, "attention") && !strcmp(xmlns, NS_ATTENTION)) { jm->hasBuzz = TRUE; } else if(!strcmp(child->name, "delay") && !strcmp(xmlns,"urn:xmpp:delay")) { const char *timestamp = xmlnode_get_attrib(child, "stamp"); @@ -946,7 +946,7 @@ case PURPLE_CONV_TYPE_IM: jb = jabber_buddy_find(js, who, FALSE); if (jb) { - return jabber_buddy_has_capability(jb, XEP_0231_NAMESPACE); + return jabber_buddy_has_capability(jb, NS_BOB); } else { return FALSE; } @@ -958,7 +958,7 @@ 10 people, to avoid getting too many BoB requests */ return jabber_chat_get_num_participants(chat) <= 10 && jabber_chat_all_participants_have_capability(chat, - XEP_0231_NAMESPACE); + NS_BOB); } else { return FALSE; }
--- a/libpurple/protocols/jabber/message.h Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/protocols/jabber/message.h Fri Nov 27 07:13:38 2009 +0000 @@ -28,8 +28,6 @@ #include "jabber.h" #include "xmlnode.h" -#define XEP_0224_NAMESPACE "urn:xmpp:attention:0" - typedef struct _JabberMessage { JabberStream *js; enum {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libpurple/protocols/jabber/namespaces.h Fri Nov 27 07:13:38 2009 +0000 @@ -0,0 +1,60 @@ +/* + * purple - Jabber Protocol Plugin + * + * 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 + * source distribution. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA + * + */ + +#ifndef PURPLE_JABBER_NAMESPACES_H_ +#define PURPLE_JABBER_NAMESPACES_H_ + +/* Implementation of XEP-0084 */ + +/* XEP-0047 IBB (In-band bytestreams) */ +#define NS_IBB "http://jabber.org/protocol/ibb" + +/* XEP-0084 v0.12 User Avatar */ +#define NS_AVATAR_0_12_DATA "http://www.xmpp.org/extensions/xep-0084.html#ns-data" +#define NS_AVATAR_0_12_METADATA "http://www.xmpp.org/extensions/xep-0084.html#ns-metadata" + +/* XEP-0084 v1.1 User Avatar */ +#define NS_AVATAR_1_1_DATA "urn:xmpp:avatar:data" +#define NS_AVATAR_1_1_METADATA "urn:xmpp:avatar:metadata" + +/* XEP-0224 Attention */ +#define NS_ATTENTION "urn:xmpp:attention:0" + +/* XEP-0231 BoB (Bits of Binary) */ +#define NS_BOB "urn:xmpp:bob" + +/* XEP-???? Ping */ +#define NS_PING "urn:xmpp:ping" + +/* 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" +#define NS_GOOGLE_VOICE "http://www.google.com/xmpp/protocol/voice/v1" +#define NS_GOOGLE_JINGLE_INFO "google:jingleinfo" + +#define NS_GOOGLE_PROTOCOL_SESSION "http://www.google.com/xmpp/protocol/session" +#define NS_GOOGLE_SESSION "http://www.google.com/session" +#define NS_GOOGLE_SESSION_PHONE "http://www.google.com/session/phone" +#define NS_GOOGLE_SESSION_VIDEO "http://www.google.com/session/video" + +#endif /* PURPLE_JABBER_NAMESPACES_H_ */
--- a/libpurple/protocols/jabber/ping.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/protocols/jabber/ping.c Fri Nov 27 07:13:38 2009 +0000 @@ -74,7 +74,7 @@ iq = jabber_iq_new(js, JABBER_IQ_GET); ping = xmlnode_new_child(iq->node, "ping"); - xmlnode_set_namespace(ping, "urn:xmpp:ping"); + xmlnode_set_namespace(ping, NS_PING); jabber_iq_set_callback(iq, jabber_keepalive_pong_cb, NULL); jabber_iq_send(iq); @@ -90,7 +90,7 @@ xmlnode_set_attrib(iq->node, "to", jid); ping = xmlnode_new_child(iq->node, "ping"); - xmlnode_set_namespace(ping, "urn:xmpp:ping"); + xmlnode_set_namespace(ping, NS_PING); jabber_iq_set_callback(iq, jabber_ping_result_cb, NULL); jabber_iq_send(iq);
--- a/libpurple/protocols/jabber/si.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/protocols/jabber/si.c Fri Nov 27 07:13:38 2009 +0000 @@ -1210,7 +1210,7 @@ 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 @@ -1452,7 +1452,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);
--- a/libpurple/protocols/jabber/useravatar.h Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/protocols/jabber/useravatar.h Fri Nov 27 07:13:38 2009 +0000 @@ -29,12 +29,6 @@ /* Implementation of XEP-0084 */ -#define NS_AVATAR_0_12_DATA "http://www.xmpp.org/extensions/xep-0084.html#ns-data" -#define NS_AVATAR_0_12_METADATA "http://www.xmpp.org/extensions/xep-0084.html#ns-metadata" - -#define NS_AVATAR_1_1_DATA "urn:xmpp:avatar:data" -#define NS_AVATAR_1_1_METADATA "urn:xmpp:avatar:metadata" - void jabber_avatar_init(void); void jabber_avatar_set(JabberStream *js, PurpleStoredImage *img);
--- a/libpurple/protocols/msn/msn.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/protocols/msn/msn.c Fri Nov 27 07:13:38 2009 +0000 @@ -23,8 +23,6 @@ */ #define PHOTO_SUPPORT 1 -#include <glib.h> - #include "msn.h" #include "accountopt.h" #include "contact.h"
--- a/libpurple/protocols/msn/object.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/protocols/msn/object.c Fri Nov 27 07:13:38 2009 +0000 @@ -21,6 +21,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ + +#include "msn.h" #include "object.h" #include "debug.h" /* Sha1 stuff */
--- a/libpurple/protocols/myspace/myspace.h Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/protocols/myspace/myspace.h Fri Nov 27 07:13:38 2009 +0000 @@ -20,6 +20,8 @@ #ifndef _MYSPACE_MYSPACE_H #define _MYSPACE_MYSPACE_H +#include "internal.h" + /* Other includes */ #include <string.h> #include <errno.h>/* for EAGAIN */ @@ -36,8 +38,6 @@ #include <sys/socket.h> #endif -#include "internal.h" - #include "notify.h" #include "plugin.h" #include "accountopt.h"
--- a/libpurple/protocols/novell/nmuser.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/protocols/novell/nmuser.c Fri Nov 27 07:13:38 2009 +0000 @@ -18,9 +18,8 @@ * */ -#include <glib.h> +#include "internal.h" #include <string.h> -#include "internal.h" #include "nmfield.h" #include "nmuser.h" #include "nmconn.h"
--- a/libpurple/protocols/oscar/oscar.h Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/protocols/oscar/oscar.h Fri Nov 27 07:13:38 2009 +0000 @@ -29,10 +29,10 @@ #ifndef _OSCAR_H_ #define _OSCAR_H_ +#include "internal.h" #include "circbuffer.h" #include "debug.h" #include "eventloop.h" -#include "internal.h" #include "proxy.h" #include "sslconn.h"
--- a/libpurple/protocols/qq/buddy_list.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/protocols/qq/buddy_list.c Fri Nov 27 07:13:38 2009 +0000 @@ -22,8 +22,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ -#include <string.h> - #include "qq.h" #include "debug.h"
--- a/libpurple/protocols/qq/buddy_opt.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/protocols/qq/buddy_opt.c Fri Nov 27 07:13:38 2009 +0000 @@ -22,8 +22,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ +#include "internal.h" #include "debug.h" -#include "internal.h" #include "notify.h" #include "request.h" #include "privacy.h"
--- a/libpurple/protocols/qq/char_conv.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/protocols/qq/char_conv.c Fri Nov 27 07:13:38 2009 +0000 @@ -22,8 +22,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ +#include "internal.h" #include "debug.h" -#include "internal.h" #include "char_conv.h" #include "packet_parse.h"
--- a/libpurple/protocols/qq/qq.h Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/protocols/qq/qq.h Fri Nov 27 07:13:38 2009 +0000 @@ -25,7 +25,6 @@ #ifndef _QQ_QQ_H_ #define _QQ_QQ_H_ -#include <glib.h> #include "internal.h" #include "ft.h" #include "circbuffer.h"
--- a/libpurple/protocols/qq/qq_base.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/protocols/qq/qq_base.c Fri Nov 27 07:13:38 2009 +0000 @@ -22,8 +22,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ +#include "internal.h" #include "debug.h" -#include "internal.h" #include "server.h" #include "cipher.h" #include "request.h"
--- a/libpurple/protocols/qq/qq_network.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/protocols/qq/qq_network.c Fri Nov 27 07:13:38 2009 +0000 @@ -22,9 +22,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ +#include "internal.h" #include "cipher.h" #include "debug.h" -#include "internal.h" #include "buddy_info.h" #include "group_info.h"
--- a/libpurple/protocols/qq/qq_process.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/protocols/qq/qq_process.c Fri Nov 27 07:13:38 2009 +0000 @@ -22,9 +22,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ +#include "internal.h" #include "cipher.h" #include "debug.h" -#include "internal.h" #include "buddy_info.h" #include "buddy_list.h"
--- a/libpurple/protocols/qq/utils.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/protocols/qq/utils.c Fri Nov 27 07:13:38 2009 +0000 @@ -22,6 +22,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ +#include "internal.h" + #include "limits.h" #include "stdlib.h" #include "string.h"
--- a/libpurple/protocols/sametime/sametime.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/protocols/sametime/sametime.c Fri Nov 27 07:13:38 2009 +0000 @@ -21,6 +21,7 @@ USA. */ +#include "internal.h" /* system includes */ #include <stdlib.h> @@ -30,9 +31,6 @@ #include <glib.h> /* purple includes */ -#include "internal.h" -#include "config.h" - #include "account.h" #include "accountopt.h" #include "circbuffer.h"
--- a/libpurple/protocols/silc/buddy.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/protocols/silc/buddy.c Fri Nov 27 07:13:38 2009 +0000 @@ -17,6 +17,7 @@ */ +#include "internal.h" #include "silc.h" #include "silcclient.h" #include "silcpurple.h"
--- a/libpurple/protocols/silc/chat.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/protocols/silc/chat.c Fri Nov 27 07:13:38 2009 +0000 @@ -17,6 +17,7 @@ */ +#include "internal.h" #include "silc.h" #include "silcclient.h" #include "silcpurple.h"
--- a/libpurple/protocols/silc/ft.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/protocols/silc/ft.c Fri Nov 27 07:13:38 2009 +0000 @@ -17,6 +17,7 @@ */ +#include "internal.h" #include "silc.h" #include "silcclient.h" #include "silcpurple.h"
--- a/libpurple/protocols/silc/ops.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/protocols/silc/ops.c Fri Nov 27 07:13:38 2009 +0000 @@ -17,6 +17,7 @@ */ +#include "internal.h" #include "silc.h" #include "silcclient.h" #include "silcpurple.h"
--- a/libpurple/protocols/silc/pk.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/protocols/silc/pk.c Fri Nov 27 07:13:38 2009 +0000 @@ -17,6 +17,7 @@ */ +#include "internal.h" #include "silc.h" #include "silcclient.h" #include "silcpurple.h"
--- a/libpurple/protocols/silc/silc.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/protocols/silc/silc.c Fri Nov 27 07:13:38 2009 +0000 @@ -17,6 +17,7 @@ */ +#include "internal.h" #include "silc.h" #include "silcclient.h" #include "silcpurple.h"
--- a/libpurple/protocols/silc/util.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/protocols/silc/util.c Fri Nov 27 07:13:38 2009 +0000 @@ -17,6 +17,7 @@ */ +#include "internal.h" #include "silc.h" #include "silcclient.h" #include "silcpurple.h"
--- a/libpurple/protocols/silc/wb.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/protocols/silc/wb.c Fri Nov 27 07:13:38 2009 +0000 @@ -17,6 +17,7 @@ */ +#include "internal.h" #include "silc.h" #include "silcclient.h" #include "silcpurple.h"
--- a/libpurple/roomlist.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/roomlist.c Fri Nov 27 07:13:38 2009 +0000 @@ -24,8 +24,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ -#include <glib.h> - #include "internal.h" #include "account.h"
--- a/libpurple/theme-manager.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/theme-manager.c Fri Nov 27 07:13:38 2009 +0000 @@ -20,9 +20,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ -#include <glib.h> -#include <string.h> - #include "internal.h" #include "theme-manager.h" #include "util.h"
--- a/libpurple/theme.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/theme.c Fri Nov 27 07:13:38 2009 +0000 @@ -20,9 +20,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ -#include <glib.h> -#include <string.h> - #include "internal.h" #include "theme.h" #include "util.h"
--- a/libpurple/whiteboard.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/whiteboard.c Fri Nov 27 07:13:38 2009 +0000 @@ -21,8 +21,6 @@ * */ -#include <string.h> - #include "internal.h" #include "whiteboard.h" #include "prpl.h"
--- a/libpurple/xmlnode.c Thu Nov 26 21:47:25 2009 +0000 +++ b/libpurple/xmlnode.c Fri Nov 27 07:13:38 2009 +0000 @@ -29,8 +29,8 @@ * as I want to be. Thank you libxode for giving me a good starting point */ #define _PURPLE_XMLNODE_C_ +#include "internal.h" #include "debug.h" -#include "internal.h" #include <libxml/parser.h> #include <string.h>
--- a/pidgin/gtkcertmgr.c Thu Nov 26 21:47:25 2009 +0000 +++ b/pidgin/gtkcertmgr.c Fri Nov 27 07:13:38 2009 +0000 @@ -25,10 +25,8 @@ * */ -#include <glib.h> - +#include "internal.h" #include "core.h" -#include "internal.h" #include "pidgin.h" #include "pidginstock.h"
--- a/pidgin/gtkmedia.c Thu Nov 26 21:47:25 2009 +0000 +++ b/pidgin/gtkmedia.c Fri Nov 27 07:13:38 2009 +0000 @@ -23,9 +23,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ -#include <string.h> +#include "internal.h" #include "debug.h" -#include "internal.h" #include "connection.h" #include "media.h" #include "mediamanager.h"
--- a/pidgin/gtkwhiteboard.c Thu Nov 26 21:47:25 2009 +0000 +++ b/pidgin/gtkwhiteboard.c Fri Nov 27 07:13:38 2009 +0000 @@ -21,8 +21,6 @@ * */ -#include <stdlib.h> - #include "internal.h" #include "blist.h" #include "debug.h"
--- a/pidgin/plugins/gtk-signals-test.c Thu Nov 26 21:47:25 2009 +0000 +++ b/pidgin/plugins/gtk-signals-test.c Fri Nov 27 07:13:38 2009 +0000 @@ -20,9 +20,10 @@ */ #define GTK_SIGNAL_TEST_PLUGIN_ID "gtk-signals-test" +#include "internal.h" + #include <gtk/gtk.h> -#include "internal.h" #include "debug.h" #include "version.h"