[Adium-commits] adium 2067:14561a053c78: Update for libpurple changes.

adium-commits at adiumx.com adium-commits at adiumx.com
Sat May 2 20:16:56 UTC 2009


details:	http://hg.adiumx.com/adium/rev/14561a053c78
revision:	2067:14561a053c78
author:		Zachary West <zacw at adiumx.com>
date:		Sat May 02 16:11:27 2009 -0400

Update for libpurple changes.
Subject: adium 2068:9ede946ad8ee: Update for new libpurple header we need to steal.

details:	http://hg.adiumx.com/adium/rev/9ede946ad8ee
revision:	2068:9ede946ad8ee
author:		Zachary West <zacw at adiumx.com>
date:		Sat May 02 16:11:38 2009 -0400

Update for new libpurple header we need to steal.
Subject: adium 2069:1346acdb9a2b: Since I keep forgetting that `mtn propagate` doesn't update my working copy, actual im.pidgin.adium at 6f2ee12a3da60beab8a2df575653fce061b7e8b1, which has facebookchat at r463.

details:	http://hg.adiumx.com/adium/rev/1346acdb9a2b
revision:	2069:1346acdb9a2b
author:		Zachary West <zacw at adiumx.com>
date:		Sat May 02 16:16:26 2009 -0400

Since I keep forgetting that `mtn propagate` doesn't update my working copy, actual im.pidgin.adium at 6f2ee12a3da60beab8a2df575653fce061b7e8b1, which has facebookchat at r463.

diffstat:

 Frameworks/libpurple.framework/Versions/0.6.0/Headers/blist.h         |  43 +++-
 Frameworks/libpurple.framework/Versions/0.6.0/Headers/bosh.h          |  41 +++++
 Frameworks/libpurple.framework/Versions/0.6.0/Headers/buddy.h         |  11 +-
 Frameworks/libpurple.framework/Versions/0.6.0/Headers/caps.h          |  73 +++++++-
 Frameworks/libpurple.framework/Versions/0.6.0/Headers/dnssrv.h        |  50 ++++++-
 Frameworks/libpurple.framework/Versions/0.6.0/Headers/jabber.h        |  53 +++++-
 Frameworks/libpurple.framework/Versions/0.6.0/Headers/media.h         |  30 ++-
 Frameworks/libpurple.framework/Versions/0.6.0/Headers/mediamanager.h  |   2 +-
 Frameworks/libpurple.framework/Versions/0.6.0/Headers/presence.h      |  12 +-
 Frameworks/libpurple.framework/Versions/0.6.0/Headers/prpl.h          |  14 +
 Frameworks/libpurple.framework/Versions/0.6.0/Headers/smiley.h        |  71 ++++----
 Frameworks/libpurple.framework/Versions/0.6.0/Headers/sound-theme.h   |   7 +-
 Frameworks/libpurple.framework/Versions/0.6.0/Headers/theme-loader.h  |   3 +-
 Frameworks/libpurple.framework/Versions/0.6.0/Headers/theme-manager.h |   2 +-
 Frameworks/libpurple.framework/Versions/0.6.0/Headers/xmlnode.h       |  11 +-
 Frameworks/libpurple.framework/Versions/0.6.0/libpurple               |     
 Plugins/Purple Service/AMPurpleJabberAdHocServer.m                    |   2 +-
 Plugins/Purple Service/ESPurpleJabberAccount.m                        |  28 ---
 Utilities/dep-build-scripts/purple_make.sh                            |   1 +
 19 files changed, 324 insertions(+), 130 deletions(-)

diffs (truncated from 1034 to 1000 lines):

diff -r becca8ee45f7 -r 1346acdb9a2b Frameworks/libpurple.framework/Versions/0.6.0/Headers/blist.h
--- a/Frameworks/libpurple.framework/Versions/0.6.0/Headers/blist.h	Sat May 02 15:51:45 2009 -0400
+++ b/Frameworks/libpurple.framework/Versions/0.6.0/Headers/blist.h	Sat May 02 16:16:26 2009 -0400
@@ -118,8 +118,8 @@
 
 /**
  * A Buddy list node.  This can represent a group, a buddy, or anything else.
- * This is a base class for struct buddy and struct group and for anything
- * else that wants to put itself in the buddy list. */
+ * This is a base class for PurpleBuddy, PurpleContact, PurpleGroup, and for
+ * anything else that wants to put itself in the buddy list. */
 struct _PurpleBlistNode {
 	PurpleBlistNodeType type;             /**< The type of node this is       */
 	PurpleBlistNode *prev;                /**< The sibling before this buddy. */
@@ -207,7 +207,7 @@
 		       PurpleBlistNode *node);       /**< This will update a node in the buddy list. */
 	void (*remove)(PurpleBuddyList *list,
 		       PurpleBlistNode *node);       /**< This removes a node from the list */
-	void (*destroy)(PurpleBuddyList *list);  /**< When the list gets destroyed, this gets called to destroy the UI. */
+	void (*destroy)(PurpleBuddyList *list);  /**< When the list is destroyed, this is called to destroy the UI. */
 	void (*set_visible)(PurpleBuddyList *list,
 			    gboolean show);            /**< Hides or unhides the buddy list */
 	void (*request_add_buddy)(PurpleAccount *account, const char *username,
@@ -276,7 +276,7 @@
  *
  * @since 2.6.0
  */
-void *purple_blist_get_ui_data(void);
+gpointer purple_blist_get_ui_data(void);
 
 /**
  * Sets the UI data for the list.
@@ -285,7 +285,7 @@
  *
  * @since 2.6.0
  */
-void purple_blist_set_ui_data(void *ui_data);
+void purple_blist_set_ui_data(gpointer ui_data);
 
 /**
  * Returns the next node of a given node. This function is to be used to iterate
@@ -360,7 +360,7 @@
  * @return The UI data.
  * @since 2.6.0
  */
-void *purple_blist_node_get_ui_data(const PurpleBlistNode *node);
+gpointer purple_blist_node_get_ui_data(const PurpleBlistNode *node);
 
 /**
  * Sets the UI data of a given node.
@@ -370,7 +370,7 @@
  *
  * @since 2.6.0
  */
-void purple_blist_node_set_ui_data(PurpleBlistNode *node, void *ui_data);
+void purple_blist_node_set_ui_data(PurpleBlistNode *node, gpointer ui_data);
 
 /**
  * Shows the buddy list, creating a new one if necessary.
@@ -393,6 +393,8 @@
 /**
  * Updates a buddy's status.
  *
+ * This should only be called from within Purple.
+ *
  * @param buddy      The buddy whose status has changed.
  * @param old_status The status from which we are changing.
  */
@@ -499,12 +501,19 @@
 void purple_blist_add_chat(PurpleChat *chat, PurpleGroup *group, PurpleBlistNode *node);
 
 /**
- * Creates a new buddy
+ * Creates a new buddy.
+ *
+ * This function only creates the PurpleBuddy. Use purple_blist_add_buddy
+ * to add the buddy to the list and purple_account_add_buddy to sync up
+ * with the server.
  *
  * @param account    The account this buddy will get added to
  * @param name       The name of the new buddy
  * @param alias      The alias of the new buddy (or NULL if unaliased)
  * @return           A newly allocated buddy
+ *
+ * @see purple_account_add_buddy
+ * @see purple_blist_add_buddy
  */
 PurpleBuddy *purple_buddy_new(PurpleAccount *account, const char *name, const char *alias);
 
@@ -618,7 +627,7 @@
  * Creates a new group
  *
  * You can't have more than one group with the same name.  Sorry.  If you pass
- * this the * name of a group that already exists, it will return that group.
+ * this the name of a group that already exists, it will return that group.
  *
  * @param name   The name of the new group
  * @return       A new group struct
@@ -727,18 +736,22 @@
 
 /**
  * Removes a buddy from the buddy list and frees the memory allocated to it.
- * This doesn't actually try to remove the buddy from the server list, nor does
- * it clean up the prpl_data.
+ * This doesn't actually try to remove the buddy from the server list.
  *
  * @param buddy   The buddy to be removed
+ *
+ * @see purple_account_remove_buddy
  */
 void purple_blist_remove_buddy(PurpleBuddy *buddy);
 
 /**
  * Removes a contact, and any buddies it contains, and frees the memory
- * allocated to it.
+ * allocated to it. This calls purple_blist_remove_buddy and therefore
+ * doesn't remove the buddies from the server list.
  *
  * @param contact The contact to be removed
+ *
+ * @see purple_blist_remove_buddy
  */
 void purple_blist_remove_contact(PurpleContact *contact);
 
@@ -850,7 +863,7 @@
  * Finds all PurpleBuddy structs given a name and an account
  *
  * @param account The account this buddy belongs to
- * @param name    The buddy's name (or NULL to return all buddies in the account)
+ * @param name    The buddy's name (or NULL to return all buddies for the account)
  *
  * @return        A GSList of buddies (which must be freed), or NULL if the buddy doesn't exist
  */
@@ -945,7 +958,7 @@
 const char *purple_group_get_name(PurpleGroup *group);
 
 /**
- * Called when an account gets signed on.  Tells the UI to update all the
+ * Called when an account connects.  Tells the UI to update all the
  * buddies.
  *
  * @param account   The account
@@ -954,7 +967,7 @@
 
 
 /**
- * Called when an account gets signed off.  Sets the presence of all the buddies to 0
+ * Called when an account disconnects.  Sets the presence of all the buddies to 0
  * and tells the UI to update them.
  *
  * @param account   The account
diff -r becca8ee45f7 -r 1346acdb9a2b Frameworks/libpurple.framework/Versions/0.6.0/Headers/bosh.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Frameworks/libpurple.framework/Versions/0.6.0/Headers/bosh.h	Sat May 02 16:16:26 2009 -0400
@@ -0,0 +1,41 @@
+/**
+ * @file bosh.h Bidirectional-streams over Synchronous HTTP (BOSH) (XEP-0124 and XEP-0206)
+ *
+ * purple
+ *
+ * Copyright (C) 2008, Tobias Markmann <tmarkmann at googlemail.com>
+ *
+ * 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_BOSH_H_
+#define PURPLE_JABBER_BOSH_H_
+
+typedef struct _PurpleBOSHConnection PurpleBOSHConnection;
+
+#include "jabber.h"
+
+void jabber_bosh_init(void);
+void jabber_bosh_uninit(void);
+
+PurpleBOSHConnection* jabber_bosh_connection_init(JabberStream *js, const char *url);
+void jabber_bosh_connection_destroy(PurpleBOSHConnection *conn);
+
+gboolean jabber_bosh_connection_is_ssl(PurpleBOSHConnection *conn);
+
+void jabber_bosh_connection_connect(PurpleBOSHConnection *conn);
+void jabber_bosh_connection_close(PurpleBOSHConnection *conn);
+void jabber_bosh_connection_send_raw(PurpleBOSHConnection *conn, const char *data);
+void jabber_bosh_connection_refresh(PurpleBOSHConnection *conn);
+#endif /* PURPLE_JABBER_BOSH_H_ */
diff -r becca8ee45f7 -r 1346acdb9a2b Frameworks/libpurple.framework/Versions/0.6.0/Headers/buddy.h
--- a/Frameworks/libpurple.framework/Versions/0.6.0/Headers/buddy.h	Sat May 02 15:51:45 2009 -0400
+++ b/Frameworks/libpurple.framework/Versions/0.6.0/Headers/buddy.h	Sat May 02 16:16:26 2009 -0400
@@ -36,9 +36,6 @@
 #include "jabber.h"
 #include "caps.h"
 
-#define AVATARNAMESPACEDATA "http://www.xmpp.org/extensions/xep-0084.html#ns-data"
-#define AVATARNAMESPACEMETA "http://www.xmpp.org/extensions/xep-0084.html#ns-metadata"
-
 typedef struct _JabberBuddy {
 	GList *resources;
 	char *error_msg;
@@ -69,6 +66,7 @@
 	int priority;
 	JabberBuddyState state;
 	char *status;
+	time_t idle;
 	JabberCapabilities capabilities;
 	char *thread_id;
 	enum {
@@ -83,7 +81,10 @@
 	} client;
 	/* tz_off == PURPLE_NO_TZ_OFF when unset */
 	long tz_off;
-	JabberCapsClientInfo *caps;
+	struct {
+		JabberCapsClientInfo *info;
+		GList *exts;
+	} caps;
 	GList *commands;
 } JabberBuddyResource;
 
@@ -96,7 +97,6 @@
 		int priority, JabberBuddyState state, const char *status);
 void jabber_buddy_resource_free(JabberBuddyResource *jbr);
 void jabber_buddy_remove_resource(JabberBuddy *jb, const char *resource);
-const char *jabber_buddy_get_status_msg(JabberBuddy *jb);
 void jabber_buddy_get_info(PurpleConnection *gc, const char *who);
 
 GList *jabber_blist_node_menu(PurpleBlistNode *node);
@@ -104,7 +104,6 @@
 void jabber_set_info(PurpleConnection *gc, const char *info);
 void jabber_setup_set_info(PurplePluginAction *action);
 void jabber_set_buddy_icon(PurpleConnection *gc, PurpleStoredImage *img);
-void jabber_buddy_avatar_update_metadata(JabberStream *js, const char *from, xmlnode *items);
 
 const char *jabber_buddy_state_get_name(JabberBuddyState state);
 const char *jabber_buddy_state_get_status_id(JabberBuddyState state);
diff -r becca8ee45f7 -r 1346acdb9a2b Frameworks/libpurple.framework/Versions/0.6.0/Headers/caps.h
--- a/Frameworks/libpurple.framework/Versions/0.6.0/Headers/caps.h	Sat May 02 15:51:45 2009 -0400
+++ b/Frameworks/libpurple.framework/Versions/0.6.0/Headers/caps.h	Sat May 02 16:16:26 2009 -0400
@@ -26,24 +26,77 @@
 
 #include "jabber.h"
 
-/* Implementation of XEP-0115 */
+/* Implementation of XEP-0115 - Entity Capabilities */
 
-typedef struct _JabberCapsIdentity {
-	char *category;
-	char *type;
-	char *name;
-} JabberCapsIdentity;
+typedef struct _JabberCapsNodeExts JabberCapsNodeExts;
 
 struct _JabberCapsClientInfo {
-	GList *identities; /* JabberCapsIdentity */
+	GList *identities; /* JabberIdentity */
 	GList *features; /* char * */
+	GList *forms; /* xmlnode * */
+	JabberCapsNodeExts *exts;
 };
 
-typedef void (*jabber_caps_get_info_cb)(JabberCapsClientInfo *info, gpointer user_data);
+/*
+ * This stores a set of exts "known" for a specific node (which indicates
+ * a specific client -- for reference, Pidgin, Finch, Meebo, et al share one
+ * node.) In XEP-0115 v1.3, exts are used for features that may or may not be
+ * present at a given time (PEP things, buzz might be disabled, etc).
+ *
+ * This structure is shared among all JabberCapsClientInfo instances matching
+ * a specific node (if the capstable key->hash == NULL, which indicates that
+ * the ClientInfo is using v1.3 caps as opposed to v1.5 caps).
+ *
+ * It's only exposed so that jabber_resource_has_capability can use it.
+ * Everyone else, STAY AWAY!
+ */
+struct _JabberCapsNodeExts {
+	guint ref;
+	GHashTable *exts; /* char *ext_name -> GList *features */
+};
+
+typedef void (*jabber_caps_get_info_cb)(JabberCapsClientInfo *info, GList *exts, gpointer user_data);
 
 void jabber_caps_init(void);
+void jabber_caps_uninit(void);
 
-void jabber_caps_get_info(JabberStream *js, const char *who, const char *node, const char *ver, const char *ext, jabber_caps_get_info_cb cb, gpointer user_data);
-void jabber_caps_free_clientinfo(JabberCapsClientInfo *clientinfo);
+void jabber_caps_destroy_key(gpointer value);
+
+/**
+ * Main entity capabilites function to get the capabilities of a contact.
+ *
+ * The callback will be called synchronously if we already have the
+ * capabilities for the specified (node,ver,hash) (and, if exts are specified,
+ * if we know what each means)
+ */
+void jabber_caps_get_info(JabberStream *js, const char *who, const char *node,
+                          const char *ver, const char *hash,
+                          const char *ext, jabber_caps_get_info_cb cb,
+                          gpointer user_data);
+
+/**
+ *	Takes a JabberCapsClientInfo pointer and returns the caps hash according to
+ *	XEP-0115 Version 1.5.
+ *
+ *	@param info A JabberCapsClientInfo pointer.
+ *	@param hash Hash cipher to be used. Either sha-1 or md5.
+ *	@return		The base64 encoded SHA-1 hash; must be freed by caller
+ */
+gchar *jabber_caps_calculate_hash(JabberCapsClientInfo *info, const char *hash);
+
+/**
+ *  Calculate SHA1 hash for own featureset.
+ */
+void jabber_caps_calculate_own_hash(JabberStream *js);
+
+/** Get the current caps hash.
+ * 	@ret hash
+**/
+const gchar* jabber_caps_get_own_hash(JabberStream *js);
+
+/**
+ *  Broadcast a new calculated hash using a <presence> stanza.
+ */
+void jabber_caps_broadcast_change(void);
 
 #endif /* PURPLE_JABBER_CAPS_H_ */
diff -r becca8ee45f7 -r 1346acdb9a2b Frameworks/libpurple.framework/Versions/0.6.0/Headers/dnssrv.h
--- a/Frameworks/libpurple.framework/Versions/0.6.0/Headers/dnssrv.h	Sat May 02 15:51:45 2009 -0400
+++ b/Frameworks/libpurple.framework/Versions/0.6.0/Headers/dnssrv.h	Sat May 02 16:16:26 2009 -0400
@@ -28,8 +28,11 @@
 extern "C" {
 #endif
 
+typedef struct _PurpleSrvQueryData PurpleSrvQueryData;
 typedef struct _PurpleSrvResponse PurpleSrvResponse;
-typedef struct _PurpleSrvQueryData PurpleSrvQueryData;
+typedef struct _PurpleTxtResponse PurpleTxtResponse;
+
+#include <glib.h>
 
 struct _PurpleSrvResponse {
 	char hostname[256];
@@ -41,6 +44,14 @@
 typedef void (*PurpleSrvCallback)(PurpleSrvResponse *resp, int results, gpointer data);
 
 /**
+ * Callback that returns the data retrieved from a DNS TXT lookup.
+ *
+ * @param responses   A GSList of PurpleTxtResponse objects.
+ * @param data        The extra data passed to purple_txt_resolve.
+ */
+typedef void (*PurpleTxtCallback)(GSList *responses, gpointer data);
+
+/**
  * Queries an SRV record.
  *
  * @param protocol Name of the protocol (e.g. "sip")
@@ -58,6 +69,43 @@
  */
 void purple_srv_cancel(PurpleSrvQueryData *query_data);
 
+/**
+ * Queries an TXT record.
+ *
+ * @param owner Name of the protocol (e.g. "_xmppconnect")
+ * @param domain Domain name to query (e.g. "blubb.com")
+ * @param cb A callback which will be called with the results
+ * @param extradata Extra data to be passed to the callback
+ *
+ * @since 2.6.0
+ */
+PurpleSrvQueryData *purple_txt_resolve(const char *owner, const char *domain, PurpleTxtCallback cb, gpointer extradata);
+
+/**
+ * Cancel an TXT DNS query.
+ *
+ * @param query_data The request to cancel.
+ * @since 2.6.0
+ */
+void purple_txt_cancel(PurpleSrvQueryData *query_data);
+
+/**
+ * Get the value of the current TXT record.
+ *
+ * @param resp  The TXT response record
+ * @returns The value of the current TXT record.
+ * @since 2.6.0
+ */
+const gchar *purple_txt_response_get_content(PurpleTxtResponse *resp);
+
+/**
+ * Destroy a TXT DNS response object.
+ *
+ * @param response The PurpleTxtResponse to destroy.
+ * @since 2.6.0
+ */
+void purple_txt_response_destroy(PurpleTxtResponse *resp);
+
 #ifdef __cplusplus
 }
 #endif
diff -r becca8ee45f7 -r 1346acdb9a2b Frameworks/libpurple.framework/Versions/0.6.0/Headers/jabber.h
--- a/Frameworks/libpurple.framework/Versions/0.6.0/Headers/jabber.h	Sat May 02 15:51:45 2009 -0400
+++ b/Frameworks/libpurple.framework/Versions/0.6.0/Headers/jabber.h	Sat May 02 16:16:26 2009 -0400
@@ -64,12 +64,13 @@
 #include "jutil.h"
 #include "xmlnode.h"
 #include "buddy.h"
+#include "bosh.h"
 
 #ifdef HAVE_CYRUS_SASL
 #include <sasl/sasl.h>
 #endif
 
-#define CAPS0115_NODE "http://pidgin.im/caps"
+#define CAPS0115_NODE "http://pidgin.im/"
 
 /* Index into attention_types list */
 #define JABBER_BUZZ 0
@@ -158,6 +159,7 @@
 	GList *file_transfers;
 
 	time_t idle;
+	time_t old_idle;
 
 	JabberID *user;
 	PurpleConnection *gc;
@@ -165,6 +167,7 @@
 
 	gboolean registration;
 
+	char *initial_avatar_hash;
 	char *avatar_hash;
 	GSList *pending_avatar_requests;
 
@@ -210,6 +213,9 @@
 
 	gboolean vcard_fetched;
 
+	/* Entity Capabilities hash */
+	char *caps_hash;
+
 	/* does the local server support PEP? */
 	gboolean pep;
 
@@ -237,10 +243,15 @@
 
 	/* A purple timeout tag for the keepalive */
 	int keepalive_timeout;
-
+	
 	PurpleSrvResponse *srv_rec;
 	guint srv_rec_idx;
 	guint max_srv_rec_idx;
+
+	/* BOSH stuff */
+	gboolean use_bosh;
+	PurpleBOSHConnection *bosh;
+
 	/**
 	 * This linked list contains PurpleUtilFetchUrlData structs
 	 * for when we lookup buddy icons from a url
@@ -257,15 +268,22 @@
 	/* later add stuff to handle TURN relays... */
 };
 
-typedef gboolean (JabberFeatureEnabled)(JabberStream *js, const gchar *shortname, const gchar *namespace);
+typedef gboolean (JabberFeatureEnabled)(JabberStream *js, const gchar *namespace);
 
 typedef struct _JabberFeature
 {
-	gchar *shortname;
 	gchar *namespace;
 	JabberFeatureEnabled *is_enabled;
 } JabberFeature;
 
+typedef struct _JabberIdentity
+{
+	gchar *category;
+	gchar *type;
+	gchar *name;
+	gchar *lang;
+} JabberIdentity;
+
 typedef struct _JabberBytestreamsStreamhost {
 	char *jid;
 	char *host;
@@ -275,7 +293,9 @@
 
 /* what kind of additional features as returned from disco#info are supported? */
 extern GList *jabber_features;
+extern GList *jabber_identities;
 
+void jabber_stream_features_parse(JabberStream *js, xmlnode *packet);
 void jabber_process_packet(JabberStream *js, xmlnode **packet);
 void jabber_send(JabberStream *js, xmlnode *data);
 void jabber_send_raw(JabberStream *js, const char *data, int len);
@@ -297,8 +317,24 @@
  */
 char *jabber_parse_error(JabberStream *js, xmlnode *packet, PurpleConnectionError *reason);
 
-void jabber_add_feature(const gchar *shortname, const gchar *namespace, JabberFeatureEnabled cb); /* cb may be NULL */
-void jabber_remove_feature(const gchar *shortname);
+void jabber_add_feature(const gchar *namespace, JabberFeatureEnabled cb); /* cb may be NULL */
+void jabber_remove_feature(const gchar *namespace);
+
+/** Adds an identitiy to this jabber library instance. For list of valid values vistit the 
+ *	webiste of the XMPP Registrar ( http://www.xmpp.org/registrar/disco-categories.html#client ).
+ *  @param category the category of the identity.
+ *  @param type the type of the identity.
+ *  @param language the language localization of the name. Can be NULL.
+ *  @param name the name of the identity.
+ */
+void jabber_add_identity(const gchar *category, const gchar *type, const gchar *lang, const gchar *name);
+
+/**
+ * Returns true if this connection is over a secure (SSL) stream. Use this
+ * instead of checking js->gsc because BOSH stores its PurpleSslConnection
+ * members in its own data structure.
+ */
+gboolean jabber_stream_is_ssl(JabberStream *js);
 
 /** PRPL functions */
 const char *jabber_list_icon(PurpleAccount *a, PurpleBuddy *b);
@@ -323,10 +359,15 @@
 gboolean jabber_offline_message(const PurpleBuddy *buddy);
 int jabber_prpl_send_raw(PurpleConnection *gc, const char *buf, int len);
 GList *jabber_actions(PurplePlugin *plugin, gpointer context);
+
+gboolean jabber_audio_enabled(JabberStream *js, const char *unused);
 gboolean jabber_initiate_media(PurpleAccount *account, const char *who,
 		PurpleMediaSessionType type);
 PurpleMediaCaps jabber_get_media_caps(PurpleAccount *account, const char *who);
+
 void jabber_register_commands(void);
+
 void jabber_init_plugin(PurplePlugin *plugin);
+void jabber_uninit_plugin(void);
 
 #endif /* PURPLE_JABBER_H_ */
diff -r becca8ee45f7 -r 1346acdb9a2b Frameworks/libpurple.framework/Versions/0.6.0/Headers/media.h
--- a/Frameworks/libpurple.framework/Versions/0.6.0/Headers/media.h	Sat May 02 15:51:45 2009 -0400
+++ b/Frameworks/libpurple.framework/Versions/0.6.0/Headers/media.h	Sat May 02 16:16:26 2009 -0400
@@ -351,15 +351,15 @@
 void purple_media_codec_list_free(GList *codecs);
 
 /**
- * Gets a list of session names.
+ * Gets a list of session IDs.
  *
- * @param media The media session to retrieve session names from.
+ * @param media The media session from which to retrieve session IDs.
  *
- * @return GList of session names.
+ * @return GList of session IDs. The caller must free the list.
  *
  * @since 2.6.0
  */
-GList *purple_media_get_session_names(PurpleMedia *media);
+GList *purple_media_get_session_ids(PurpleMedia *media);
 
 /**
  * Gets the PurpleAccount this media session is on.
@@ -495,14 +495,14 @@
  *
  * @param media The media object to find the session in.
  * @param sess_id The session id of the session find the stream in.
- * @param name The name of the remote user to add the candidates for.
+ * @param participant The name of the remote user to add the candidates for.
  * @param remote_candidates The remote candidates to add.
  *
  * @since 2.6.0
  */
 void purple_media_add_remote_candidates(PurpleMedia *media,
 					const gchar *sess_id,
-					const gchar *name,
+					const gchar *participant,
 					GList *remote_candidates);
 
 /**
@@ -510,13 +510,13 @@
  *
  * @param media The media object to find the session in.
  * @param sess_id The session id of the session to find the stream in.
- * @param name The name of the remote user to get the candidates from.
+ * @param participant The name of the remote user to get the candidates from.
  *
  * @since 2.6.0
  */
 GList *purple_media_get_local_candidates(PurpleMedia *media,
 					 const gchar *sess_id,
-					 const gchar *name);
+					 const gchar *participant);
 
 #if 0
 /*
@@ -529,24 +529,26 @@
  *
  * @param media The media object to find the session in.
  * @param sess_id The session id of the session to find the stream in.
- * @param name The name of the remote user to get the active candidate from.
+ * @param participant The name of the remote user to get the active candidate
+ *                    from.
  *
  * @return The active candidates retrieved.
  */
 GList *purple_media_get_active_local_candidates(PurpleMedia *media,
-		const gchar *sess_id, const gchar *name);
+		const gchar *sess_id, const gchar *participant);
 
 /**
  * Gets the active remote candidates for the stream.
  *
  * @param media The media object to find the session in.
  * @param sess_id The session id of the session to find the stream in.
- * @param name The name of the remote user to get the remote candidate from.
+ * @param participant The name of the remote user to get the remote candidate
+ *                    from.
  *
  * @return The remote candidates retrieved.
  */
 GList *purple_media_get_active_remote_candidates(PurpleMedia *media,
-		const gchar *sess_id, const gchar *name);
+		const gchar *sess_id, const gchar *participant);
 #endif
 
 /**
@@ -554,14 +556,14 @@
  *
  * @param media The media object to find the session in.
  * @param sess_id The session id of the session find the stream in.
- * @param name The name of the remote user to get the candidates from.
+ * @param participant The name of the remote user to set the candidates from.
  *
  * @return @c TRUE The codecs were set successfully, or @c FALSE otherwise.
  *
  * @since 2.6.0
  */
 gboolean purple_media_set_remote_codecs(PurpleMedia *media, const gchar *sess_id,
-					const gchar *name, GList *codecs);
+					const gchar *participant, GList *codecs);
 
 /**
  * Returns whether or not the candidates for set of streams are prepared
diff -r becca8ee45f7 -r 1346acdb9a2b Frameworks/libpurple.framework/Versions/0.6.0/Headers/mediamanager.h
--- a/Frameworks/libpurple.framework/Versions/0.6.0/Headers/mediamanager.h	Sat May 02 15:51:45 2009 -0400
+++ b/Frameworks/libpurple.framework/Versions/0.6.0/Headers/mediamanager.h	Sat May 02 16:16:26 2009 -0400
@@ -52,7 +52,7 @@
 #endif
 
 /**************************************************************************/
-/** @cname Media Manager API                                              */
+/** @name Media Manager API                                              */
 /**************************************************************************/
 /*@{*/
 
diff -r becca8ee45f7 -r 1346acdb9a2b Frameworks/libpurple.framework/Versions/0.6.0/Headers/presence.h
--- a/Frameworks/libpurple.framework/Versions/0.6.0/Headers/presence.h	Sat May 02 15:51:45 2009 -0400
+++ b/Frameworks/libpurple.framework/Versions/0.6.0/Headers/presence.h	Sat May 02 16:16:26 2009 -0400
@@ -26,7 +26,17 @@
 #include "jabber.h"
 #include "xmlnode.h"
 
-void jabber_presence_send(PurpleAccount *account, PurpleStatus *status);
+void jabber_set_status(PurpleAccount *account, PurpleStatus *status);
+
+/**
+ *	Send a full presence stanza.
+ *
+ *	@param js       A JabberStream object.
+ *	@param force    Force sending the presence stanza, irrespective of whether
+ *	                the contents seem to have changed.
+ */
+void jabber_presence_send(JabberStream *js, gboolean force);
+
 xmlnode *jabber_presence_create(JabberBuddyState state, const char *msg, int priority); /* DEPRECATED */
 xmlnode *jabber_presence_create_js(JabberStream *js, JabberBuddyState state, const char *msg, int priority);
 void jabber_presence_parse(JabberStream *js, xmlnode *packet);
diff -r becca8ee45f7 -r 1346acdb9a2b Frameworks/libpurple.framework/Versions/0.6.0/Headers/prpl.h
--- a/Frameworks/libpurple.framework/Versions/0.6.0/Headers/prpl.h	Sat May 02 15:51:45 2009 -0400
+++ b/Frameworks/libpurple.framework/Versions/0.6.0/Headers/prpl.h	Sat May 02 16:16:26 2009 -0400
@@ -661,6 +661,20 @@
 								  const char *status_id, ...) G_GNUC_NULL_TERMINATED;
 
 /**
+ * Notifies Purple that our account's actions have changed. This is only
+ * called after the initial connection. Emits the account-actions-changed
+ * signal.
+ *
+ * This is meant to be called from protocol plugins.
+ *
+ * @param account   The account.
+ *
+ * @see account-actions-changed
+ * @since 2.6.0
+ */
+void purple_prpl_got_account_actions(PurpleAccount *account);
+
+/**
  * Notifies Purple that a buddy's idle state and time have changed.
  *
  * This is meant to be called from protocol plugins.
diff -r becca8ee45f7 -r 1346acdb9a2b Frameworks/libpurple.framework/Versions/0.6.0/Headers/smiley.h
--- a/Frameworks/libpurple.framework/Versions/0.6.0/Headers/smiley.h	Sat May 02 15:51:45 2009 -0400
+++ b/Frameworks/libpurple.framework/Versions/0.6.0/Headers/smiley.h	Sat May 02 16:16:26 2009 -0400
@@ -61,44 +61,41 @@
 /*@{*/
 
 /**
- * GObject foo.
+ * GObject-fu.
  * @internal.
  */
 GType purple_smiley_get_type(void);
 
 /**
- * Creates a new custom smiley structure and populates it.
+ * Creates a new custom smiley from a PurpleStoredImage.
  *
- * If a custom smiley with the informed shortcut already exist, it
+ * If a custom smiley with the given shortcut already exists, it
  * will be automaticaly returned.
  *
  * @param img         The image associated with the smiley.
- * @param shortcut    The custom smiley associated shortcut.
+ * @param shortcut    The associated shortcut (e.g. "(homer)").
  *
- * @return The custom smiley structure filled up.
+ * @return The custom smiley.
  */
 PurpleSmiley *
 purple_smiley_new(PurpleStoredImage *img, const char *shortcut);
 
 /**
- * Creates a new custom smiley structure and populates it.
+ * Creates a new custom smiley, reading the image data from a file.
  *
- * The data is retrieved from an already existent file.
- *
- * If a custom smiley with the informed shortcut already exist, it
+ * If a custom smiley with the given shortcut already exists, it
  * will be automaticaly returned.
  *
- * @param shortcut           The custom smiley associated shortcut.
- * @param filepath           The image file to be imported to a
- *                           new custom smiley.
+ * @param shortcut           The associated shortcut (e.g. "(homer)").
+ * @param filepath           The image file.
  *
- * @return The custom smiley structure filled up.
+ * @return The custom smiley.
  */
 PurpleSmiley *
 purple_smiley_new_from_file(const char *shortcut, const char *filepath);
 
 /**
- * Destroy the custom smiley and release the associated resources.
+ * Destroys the custom smiley and release the associated resources.
  *
  * @param smiley    The custom smiley.
  */
@@ -109,32 +106,28 @@
  * Changes the custom smiley's shortcut.
  *
  * @param smiley    The custom smiley.
- * @param shortcut  The custom smiley associated shortcut.
+ * @param shortcut  The new shortcut. A custom smiley with this shortcut
+ *                  cannot already be in use.
  *
- * @return TRUE whether the shortcut is not associated with another
- *         custom smiley and the parameters are valid. FALSE otherwise.
+ * @return TRUE if the shortcut was changed. FALSE otherwise.
  */
 gboolean
 purple_smiley_set_shortcut(PurpleSmiley *smiley, const char *shortcut);
 
 /**
- * Changes the custom smiley's data.
- *
- * When the filename controling is made outside this API, the param
- * #keepfilename must be TRUE.
- * Otherwise, the file and filename will be regenerated, and the
- * old one will be removed.
+ * Changes the custom smiley's image data.
  *
  * @param smiley             The custom smiley.
- * @param smiley_data        The custom smiley data.
- * @param smiley_data_len    The custom smiley data length.
+ * @param smiley_data        The custom smiley data, which the smiley code
+ *                           takes ownership of and will free.
+ * @param smiley_data_len    The length of the data in @a smiley_data.
  */
 void
 purple_smiley_set_data(PurpleSmiley *smiley, guchar *smiley_data,
                                            size_t smiley_data_len);
 
 /**
- * Returns the custom smiley's associated shortcut.
+ * Returns the custom smiley's associated shortcut (e.g. "(homer)").
  *
  * @param smiley   The custom smiley.
  *
@@ -155,11 +148,11 @@
  * Returns the PurpleStoredImage with the reference counter incremented.
  *
  * The returned PurpleStoredImage reference counter must be decremented
- * after use.
+ * when the caller is done using it.
  *
  * @param smiley   The custom smiley.
  *
- * @return A PurpleStoredImage reference.
+ * @return A PurpleStoredImage.
  */
 PurpleStoredImage *purple_smiley_get_stored_image(const PurpleSmiley *smiley);
 
@@ -167,7 +160,7 @@
  * Returns the custom smiley's data.
  *
  * @param smiley  The custom smiley.
- * @param len     If not @c NULL, the length of the icon data returned
+ * @param len     If not @c NULL, the length of the image data returned
  *                will be set in the location pointed to by this.
  *
  * @return A pointer to the custom smiley data.
@@ -194,6 +187,8 @@
  * directly.  If you find yourself wanting to use this function, think
  * very long and hard about it, and then don't.
  *
+ * Think some more.
+ *
  * @param smiley  The custom smiley.
  *
  * @return A full path to the file, or @c NULL under various conditions.
@@ -210,7 +205,8 @@
 /*@{*/
 
 /**
- * Returns a list of all custom smileys. The caller should free the list.
+ * Returns a list of all custom smileys. The caller is responsible for freeing
+ * the list.
  *
  * @return A list of all custom smileys.
  */
@@ -218,23 +214,21 @@
 purple_smileys_get_all(void);
 
 /**
- * Returns the custom smiley given it's shortcut.
+ * Returns a custom smiley given its shortcut.
  *
  * @param shortcut The custom smiley's shortcut.
  *
- * @return The custom smiley (with a reference for the caller) if found,
- *         or @c NULL if not found.
+ * @return The custom smiley if found, or @c NULL if not found.
  */
 PurpleSmiley *
 purple_smileys_find_by_shortcut(const char *shortcut);
 
 /**
- * Returns the custom smiley given it's checksum.
+ * Returns a custom smiley given its checksum.
  *
  * @param checksum The custom smiley's checksum.
  *
- * @return The custom smiley (with a reference for the caller) if found,
- *         or @c NULL if not found.
+ * @return The custom smiley if found, or @c NULL if not found.
  */
 PurpleSmiley *
 purple_smileys_find_by_checksum(const char *checksum);
@@ -242,10 +236,9 @@
 /**
  * Returns the directory used to store custom smiley cached files.
  *
- * The default directory is PURPLEDIR/smileys, unless otherwise specified
- * by purple_buddy_icons_set_cache_dir().
+ * The default directory is PURPLEDIR/custom_smiley.
  *
- * @return The directory to store custom smyles cached files to.
+ * @return The directory in which to store custom smileys cached files.
  */
 const char *purple_smileys_get_storing_dir(void);
 
diff -r becca8ee45f7 -r 1346acdb9a2b Frameworks/libpurple.framework/Versions/0.6.0/Headers/sound-theme.h
--- a/Frameworks/libpurple.framework/Versions/0.6.0/Headers/sound-theme.h	Sat May 02 15:51:45 2009 -0400
+++ b/Frameworks/libpurple.framework/Versions/0.6.0/Headers/sound-theme.h	Sat May 02 16:16:26 2009 -0400
@@ -73,6 +73,7 @@
 /**
  * Returns a copy of the filename for the sound event.
  *
+ * @param theme The theme.
  * @param event The purple sound event to look up.
  *
  * @returns The filename of the sound event.
@@ -83,6 +84,7 @@
 /**
  * Returns a copy of the directory and filename for the sound event
  *
+ * @param theme The theme.
  * @param event The purple sound event to look up
  *
  * @returns The directory + '/' + filename of the sound event.  This is
@@ -94,8 +96,9 @@
 /**
  * Sets the filename for a given sound event
  *
- * @param event		the purple sound event to look up
- * @param filename		the name of the file to be used for the event
+ * @param theme    The theme.
+ * @param event    the purple sound event to look up
+ * @param filename the name of the file to be used for the event
  */
 void purple_sound_theme_set_file(PurpleSoundTheme *theme,
 		const gchar *event,
diff -r becca8ee45f7 -r 1346acdb9a2b Frameworks/libpurple.framework/Versions/0.6.0/Headers/theme-loader.h
--- a/Frameworks/libpurple.framework/Versions/0.6.0/Headers/theme-loader.h	Sat May 02 15:51:45 2009 -0400
+++ b/Frameworks/libpurple.framework/Versions/0.6.0/Headers/theme-loader.h	Sat May 02 16:16:26 2009 -0400
@@ -82,7 +82,8 @@
 /**
  * Creates a new PurpleTheme
  *
- * @param dir The directory containing the theme
+ * @param loader The theme loader
+ * @param dir    The directory containing the theme
  *
  * @returns A PurpleTheme containing the information from the directory
  */
diff -r becca8ee45f7 -r 1346acdb9a2b Frameworks/libpurple.framework/Versions/0.6.0/Headers/theme-manager.h
--- a/Frameworks/libpurple.framework/Versions/0.6.0/Headers/theme-manager.h	Sat May 02 15:51:45 2009 -0400
+++ b/Frameworks/libpurple.framework/Versions/0.6.0/Headers/theme-manager.h	Sat May 02 16:16:26 2009 -0400
@@ -1,5 +1,5 @@
 /**
- * @file thememanager.h  Theme Manager API
+ * @file theme-manager.h  Theme Manager API
  */
 
 /*
diff -r becca8ee45f7 -r 1346acdb9a2b Frameworks/libpurple.framework/Versions/0.6.0/Headers/xmlnode.h
--- a/Frameworks/libpurple.framework/Versions/0.6.0/Headers/xmlnode.h	Sat May 02 15:51:45 2009 -0400
+++ b/Frameworks/libpurple.framework/Versions/0.6.0/Headers/xmlnode.h	Sat May 02 16:16:26 2009 -0400
@@ -335,11 +335,14 @@
  * root node of an XML document will parse the entire document
  * into a tree of nodes, and return the xmlnode of the root.
  *
- * @param str  The string of xml.
- * @param description  The description of the file being parsed
- * @process  The utility that is calling xmlnode_from_file
+ * @param dir  The directory where the file is located
+ * @param filename  The filename
+ * @param description  A description of the file being parsed. Displayed to
+ * 			the user if the file cannot be read.
+ * @param process  The subsystem that is calling xmlnode_from_file. Used as
+ * 			the category for debugging.
  *
- * @return The new node.
+ * @return The new node or NULL if an error occurred.
  *
  * @since 2.6.0
  */
diff -r becca8ee45f7 -r 1346acdb9a2b Frameworks/libpurple.framework/Versions/0.6.0/libpurple
Binary file Frameworks/libpurple.framework/Versions/0.6.0/libpurple has changed
diff -r becca8ee45f7 -r 1346acdb9a2b Plugins/Purple Service/AMPurpleJabberAdHocServer.m
--- a/Plugins/Purple Service/AMPurpleJabberAdHocServer.m	Sat May 02 15:51:45 2009 -0400
+++ b/Plugins/Purple Service/AMPurpleJabberAdHocServer.m	Sat May 02 16:16:26 2009 -0400
@@ -66,7 +66,7 @@
 }
 
 + (void)initialize {
-	jabber_add_feature("adiumcmd", "http://jabber.org/protocol/commands", NULL);
+	jabber_add_feature("http://jabber.org/protocol/commands", NULL);
 }
 
 - (id)initWithAccount:(ESPurpleJabberAccount*)_account {
diff -r becca8ee45f7 -r 1346acdb9a2b Plugins/Purple Service/ESPurpleJabberAccount.m
--- a/Plugins/Purple Service/ESPurpleJabberAccount.m	Sat May 02 15:51:45 2009 -0400
+++ b/Plugins/Purple Service/ESPurpleJabberAccount.m	Sat May 02 16:16:26 2009 -0400
@@ -476,34 +476,6 @@
 }
 
 #pragma mark Status Messages
-- (NSAttributedString *)statusMessageForPurpleBuddy:(PurpleBuddy *)b
-{
-	NSAttributedString  *statusMessage = nil;
-
-	if (purple_account_is_connected(account)) {		
-		char	*normalized = g_strdup(purple_normalize(purple_buddy_get_account(b), purple_buddy_get_name(b)));
-		JabberBuddy	*jb;
-		




More information about the commits mailing list