adium-1.4 3199:ca74edd1489e: libpurple 2.7.5 (im.pidgin.adium.1-...

commits at adium.im commits at adium.im
Mon Nov 1 04:01:18 UTC 2010


details:	http://hg.adium.im/adium-1.4/rev/ca74edd1489e
revision:	3199:ca74edd1489e
author:		Evan Schoenberg
date:		Sun Oct 31 22:58:59 2010 -0500

libpurple 2.7.5 (im.pidgin.adium.1-4 @ f8ec537d9500e49f390edd63f33de0d22a2c7e56)

diffs (truncated from 3628 to 1000 lines):

diff -r 5f9d8e5e4a26 -r ca74edd1489e Frameworks/libpurple.framework/Versions/0/Headers/account.h
--- a/Frameworks/libpurple.framework/Versions/0/Headers/account.h	Sun Oct 31 12:15:58 2010 -0500
+++ b/Frameworks/libpurple.framework/Versions/0/Headers/account.h	Sun Oct 31 22:58:59 2010 -0500
@@ -39,6 +39,10 @@
 typedef void (*PurpleAccountRequestAuthorizationCb)(void *);
 typedef void (*PurpleAccountRegistrationCb)(PurpleAccount *account, gboolean succeeded, void *user_data);
 typedef void (*PurpleAccountUnregistrationCb)(PurpleAccount *account, gboolean succeeded, void *user_data);
+typedef void (*PurpleSetPublicAliasSuccessCallback)(PurpleAccount *account, const char *new_alias);
+typedef void (*PurpleSetPublicAliasFailureCallback)(PurpleAccount *account, const char *error);
+typedef void (*PurpleGetPublicAliasSuccessCallback)(PurpleAccount *account, const char *alias);
+typedef void (*PurpleGetPublicAliasFailureCallback)(PurpleAccount *account, const char *error);
 
 #include "connection.h"
 #include "log.h"
@@ -414,6 +418,16 @@
 void purple_account_set_proxy_info(PurpleAccount *account, PurpleProxyInfo *info);
 
 /**
+ * Sets the account's privacy type.
+ *
+ * @param account      The account.
+ * @param privacy_type The privacy type.
+ *
+ * @since 2.7.0
+ */
+void purple_account_set_privacy_type(PurpleAccount *account, PurplePrivacyType privacy_type);
+
+/**
  * Sets the account's status types.
  *
  * @param account      The account.
@@ -452,6 +466,42 @@
 	const char *status_id, gboolean active, GList *attrs);
 
 /**
+ * Set a server-side (public) alias for this account.  The account
+ * must already be connected.
+ *
+ * Currently, the public alias is not stored locally, although this
+ * may change in a later version.
+ *
+ * @param account    The account
+ * @param alias      The new public alias for this account or NULL
+ *                   to unset the alias/nickname (or return it to
+ *                   a protocol-specific "default", like the username)
+ * @param success_cb A callback which will be called if the alias
+ *                   is successfully set on the server (or NULL).
+ * @param failure_cb A callback which will be called if the alias
+ *                   is not successfully set on the server (or NULL).
+ *
+ * @since 2.7.0
+ */
+void purple_account_set_public_alias(PurpleAccount *account,
+	const char *alias, PurpleSetPublicAliasSuccessCallback success_cb,
+	PurpleSetPublicAliasFailureCallback failure_cb);
+
+/**
+ * Fetch the server-side (public) alias for this account.  The account
+ * must already be connected.
+ *
+ * @param account    The account
+ * @param success_cb A callback which will be called with the alias
+ * @param failure_cb A callback which will be called if the prpl is
+ *                   unable to retrieve the server-side alias.
+ * @since 2.7.0
+ */
+void purple_account_get_public_alias(PurpleAccount *account,
+	PurpleGetPublicAliasSuccessCallback success_cb,
+	PurpleGetPublicAliasFailureCallback failure_cb);
+
+/**
  * Clears all protocol-specific settings on an account.
  *
  * @param account The account.
@@ -630,6 +680,20 @@
 PurpleConnection *purple_account_get_connection(const PurpleAccount *account);
 
 /**
+ * Returns a name for this account appropriate for display to the user. In
+ * order of preference: the account's alias; the contact or buddy alias (if
+ * the account exists on its own buddy list); the connection's display name;
+ * the account's username.
+ *
+ * @param account The account.
+ *
+ * @return The name to display.
+ *
+ * @since 2.7.0
+ */
+const gchar *purple_account_get_name_for_display(const PurpleAccount *account);
+
+/**
  * Returns whether or not this account should save its password.
  *
  * @param account The account.
@@ -669,6 +733,17 @@
 PurpleProxyInfo *purple_account_get_proxy_info(const PurpleAccount *account);
 
 /**
+ * Returns the account's privacy type.
+ *
+ * @param account   The account.
+ *
+ * @return The privacy type.
+ *
+ * @since 2.7.0
+ */
+PurplePrivacyType purple_account_get_privacy_type(const PurpleAccount *account);
+
+/**
  * Returns the active status for this account.  This looks through
  * the PurplePresence associated with this account and returns the
  * PurpleStatus that has its active flag set to "TRUE."  There can be
diff -r 5f9d8e5e4a26 -r ca74edd1489e Frameworks/libpurple.framework/Versions/0/Headers/auth.h
--- a/Frameworks/libpurple.framework/Versions/0/Headers/auth.h	Sun Oct 31 12:15:58 2010 -0500
+++ b/Frameworks/libpurple.framework/Versions/0/Headers/auth.h	Sun Oct 31 22:58:59 2010 -0500
@@ -45,7 +45,6 @@
 	void (*dispose)(JabberStream *js);
 };
 
-gboolean jabber_process_starttls(JabberStream *js, xmlnode *packet);
 void jabber_auth_start(JabberStream *js, xmlnode *packet);
 void jabber_auth_start_old(JabberStream *js);
 void jabber_auth_handle_challenge(JabberStream *js, xmlnode *packet);
diff -r 5f9d8e5e4a26 -r ca74edd1489e Frameworks/libpurple.framework/Versions/0/Headers/blist.h
--- a/Frameworks/libpurple.framework/Versions/0/Headers/blist.h	Sun Oct 31 12:15:58 2010 -0500
+++ b/Frameworks/libpurple.framework/Versions/0/Headers/blist.h	Sun Oct 31 22:58:59 2010 -0500
@@ -108,6 +108,7 @@
 
 #include "account.h"
 #include "buddyicon.h"
+#include "media.h"
 #include "status.h"
 
 /**************************************************************************/
@@ -143,6 +144,7 @@
 	PurpleBuddyIcon *icon;                    /**< The buddy icon. */
 	PurpleAccount *account;					/**< the account this buddy belongs to */
 	PurplePresence *presence;
+	PurpleMediaCaps media_caps;		/**< The media capabilities of the buddy. */
 };
 
 /**
@@ -657,6 +659,24 @@
 PurplePresence *purple_buddy_get_presence(const PurpleBuddy *buddy);
 
 /**
+ * Gets the media caps from a buddy.
+ *
+ * @param buddy The buddy.
+ * @return      The media caps.
+ *
+ * @since 2.7.0
+ */
+PurpleMediaCaps purple_buddy_get_media_caps(const PurpleBuddy *buddy);
+
+/**
+ * Sets the media caps for a buddy.
+ *
+ * @param buddy      The PurpleBuddy.
+ * @param media_caps The PurpleMediaCaps.
+ */
+void purple_buddy_set_media_caps(PurpleBuddy *buddy, PurpleMediaCaps media_caps);
+
+/**
  * Adds a new buddy to the buddy list.
  *
  * The buddy will be inserted right after node or prepended to the
@@ -715,6 +735,16 @@
 void purple_contact_destroy(PurpleContact *contact);
 
 /**
+ * Gets the PurpleGroup from a PurpleContact
+ *
+ * @param contact  The contact
+ * @return         The group
+ *
+ * @since 2.7.0
+ */
+PurpleGroup *purple_contact_get_group(const PurpleContact *contact);
+
+/**
  * Adds a new contact to the buddy list.
  *
  * The new contact will be inserted after insert or prepended to the list if
diff -r 5f9d8e5e4a26 -r ca74edd1489e Frameworks/libpurple.framework/Versions/0/Headers/bosh.h
--- a/Frameworks/libpurple.framework/Versions/0/Headers/bosh.h	Sun Oct 31 12:15:58 2010 -0500
+++ b/Frameworks/libpurple.framework/Versions/0/Headers/bosh.h	Sun Oct 31 22:58:59 2010 -0500
@@ -35,6 +35,7 @@
 void jabber_bosh_connection_destroy(PurpleBOSHConnection *conn);
 
 gboolean jabber_bosh_connection_is_ssl(PurpleBOSHConnection *conn);
+void jabber_bosh_connection_send_keepalive(PurpleBOSHConnection *conn);
 
 void jabber_bosh_connection_connect(PurpleBOSHConnection *conn);
 void jabber_bosh_connection_close(PurpleBOSHConnection *conn);
diff -r 5f9d8e5e4a26 -r ca74edd1489e Frameworks/libpurple.framework/Versions/0/Headers/buddy.h
--- a/Frameworks/libpurple.framework/Versions/0/Headers/buddy.h	Sun Oct 31 12:15:58 2010 -0500
+++ b/Frameworks/libpurple.framework/Versions/0/Headers/buddy.h	Sun Oct 31 22:58:59 2010 -0500
@@ -24,23 +24,20 @@
 #ifndef PURPLE_JABBER_BUDDY_H_
 #define PURPLE_JABBER_BUDDY_H_
 
-typedef enum {
-	JABBER_BUDDY_STATE_UNKNOWN = -2,
-	JABBER_BUDDY_STATE_ERROR = -1,
-	JABBER_BUDDY_STATE_UNAVAILABLE = 0,
-	JABBER_BUDDY_STATE_ONLINE,
-	JABBER_BUDDY_STATE_CHAT,
-	JABBER_BUDDY_STATE_AWAY,
-	JABBER_BUDDY_STATE_XA,
-	JABBER_BUDDY_STATE_DND
-} JabberBuddyState;
-
 typedef struct _JabberBuddy JabberBuddy;
 
 #include "jabber.h"
 #include "caps.h"
+#include "jutil.h"
 
 struct _JabberBuddy {
+	/**
+	 * A sorted list of resources in priority descending order.
+	 * This means that the first resource in the list is the
+	 * "most available" (see resource_compare_cb in buddy.c for
+	 * details).  Don't play with this yourself, let
+	 * jabber_buddy_track_resource and jabber_buddy_remove_resource do it.
+	 */
 	GList *resources;
 	char *error_msg;
 	enum {
@@ -100,7 +97,6 @@
 		const char *resource);
 JabberBuddyResource *jabber_buddy_track_resource(JabberBuddy *jb, const char *resource,
 		int priority, JabberBuddyState state, const char *status);
-void jabber_buddy_resource_free(JabberBuddyResource *jbr);
 void jabber_buddy_remove_resource(JabberBuddy *jb, const char *resource);
 void jabber_buddy_get_info(PurpleConnection *gc, const char *who);
 
@@ -110,12 +106,6 @@
 void jabber_setup_set_info(PurplePluginAction *action);
 void jabber_set_buddy_icon(PurpleConnection *gc, PurpleStoredImage *img);
 
-const char *jabber_buddy_state_get_name(JabberBuddyState state);
-const char *jabber_buddy_state_get_status_id(JabberBuddyState state);
-const char *jabber_buddy_state_get_show(JabberBuddyState state);
-JabberBuddyState jabber_buddy_status_id_get_state(const char *id);
-JabberBuddyState jabber_buddy_show_get_state(const char *id);
-
 void jabber_user_search(JabberStream *js, const char *directory);
 void jabber_user_search_begin(PurplePluginAction *);
 
diff -r 5f9d8e5e4a26 -r ca74edd1489e Frameworks/libpurple.framework/Versions/0/Headers/caps.h
--- a/Frameworks/libpurple.framework/Versions/0/Headers/caps.h	Sun Oct 31 12:15:58 2010 -0500
+++ b/Frameworks/libpurple.framework/Versions/0/Headers/caps.h	Sun Oct 31 22:58:59 2010 -0500
@@ -115,4 +115,15 @@
  */
 void jabber_caps_broadcast_change(void);
 
+/**
+ * Parse the <query/> element from an IQ stanza into a JabberCapsClientInfo
+ * struct.
+ *
+ * Exposed for tests
+ *
+ * @param query The 'query' element from an IQ reply stanza.
+ * @returns A JabberCapsClientInfo struct, or NULL on error
+ */
+JabberCapsClientInfo *jabber_caps_parse_client_info(xmlnode *query);
+
 #endif /* PURPLE_JABBER_CAPS_H_ */
diff -r 5f9d8e5e4a26 -r ca74edd1489e Frameworks/libpurple.framework/Versions/0/Headers/certificate.h
--- a/Frameworks/libpurple.framework/Versions/0/Headers/certificate.h	Sun Oct 31 12:15:58 2010 -0500
+++ b/Frameworks/libpurple.framework/Versions/0/Headers/certificate.h	Sun Oct 31 22:58:59 2010 -0500
@@ -250,10 +250,17 @@
 	/** Retrieve the certificate activation/expiration times */
 	gboolean (* get_times)(PurpleCertificate *crt, time_t *activation, time_t *expiration);
 
+	/** Imports certificates from a file
+	 *
+	 *  @param filename   File to import the certificates from
+	 *  @return           GSList of pointers to the newly allocated Certificate structs
+	 *                    or NULL on failure.
+	 */
+	GSList * (* import_certificates)(const gchar * filename);
+
 	void (*_purple_reserved1)(void);
 	void (*_purple_reserved2)(void);
 	void (*_purple_reserved3)(void);
-	void (*_purple_reserved4)(void);
 };
 
 /** A set of operations used to provide logic for verifying a Certificate's
@@ -492,6 +499,16 @@
 purple_certificate_import(PurpleCertificateScheme *scheme, const gchar *filename);
 
 /**
+ * Imports a list of PurpleCertificates from a file
+ *
+ * @param scheme      Scheme to import under
+ * @param filename    File path to import from
+ * @return Pointer to a GSList of new PurpleCertificates, or NULL on failure
+ */
+GSList *
+purple_certificates_import(PurpleCertificateScheme *scheme, const gchar *filename);
+
+/**
  * Exports a PurpleCertificate to a file
  *
  * @param filename    File to export the certificate to
diff -r 5f9d8e5e4a26 -r ca74edd1489e Frameworks/libpurple.framework/Versions/0/Headers/connection.h
--- a/Frameworks/libpurple.framework/Versions/0/Headers/connection.h	Sun Oct 31 12:15:58 2010 -0500
+++ b/Frameworks/libpurple.framework/Versions/0/Headers/connection.h	Sun Oct 31 22:58:59 2010 -0500
@@ -44,8 +44,9 @@
 	PURPLE_CONNECTION_NO_FONTSIZE = 0x0020, /**< Connection does not send/receive font sizes */
 	PURPLE_CONNECTION_NO_URLDESC = 0x0040,  /**< Connection does not support descriptions with links */
 	PURPLE_CONNECTION_NO_IMAGES = 0x0080,  /**< Connection does not support sending of images */
-	PURPLE_CONNECTION_ALLOW_CUSTOM_SMILEY = 0x0100 /**< Connection supports sending and receiving custom smileys */
-
+	PURPLE_CONNECTION_ALLOW_CUSTOM_SMILEY = 0x0100, /**< Connection supports sending and receiving custom smileys */
+	PURPLE_CONNECTION_SUPPORT_MOODS = 0x0200, /**< Connection supports setting moods */
+	PURPLE_CONNECTION_SUPPORT_MOOD_MESSAGES = 0x0400 /**< Connection supports setting a message on moods */
 } PurpleConnectionFlags;
 
 typedef enum
diff -r 5f9d8e5e4a26 -r ca74edd1489e Frameworks/libpurple.framework/Versions/0/Headers/conversation.h
--- a/Frameworks/libpurple.framework/Versions/0/Headers/conversation.h	Sun Oct 31 12:15:58 2010 -0500
+++ b/Frameworks/libpurple.framework/Versions/0/Headers/conversation.h	Sun Oct 31 22:58:59 2010 -0500
@@ -650,7 +650,6 @@
 		const char *message, PurpleMessageFlags flags,
 		time_t mtime);
 
-
 /**
 	Set the features as supported for the given conversation.
 	@param conv      The conversation
diff -r 5f9d8e5e4a26 -r ca74edd1489e Frameworks/libpurple.framework/Versions/0/Headers/debug.h
--- a/Frameworks/libpurple.framework/Versions/0/Headers/debug.h	Sun Oct 31 12:15:58 2010 -0500
+++ b/Frameworks/libpurple.framework/Versions/0/Headers/debug.h	Sun Oct 31 22:58:59 2010 -0500
@@ -176,20 +176,24 @@
 gboolean purple_debug_is_verbose(void);
 
 /**
- * Enable or disable verbose debugging.  This ordinarily should only be called
+ * Enable or disable unsafe debugging.  This ordinarily should only be called
  * by #purple_debug_init, but there are cases where this can be useful for
  * plugins.
  *
- * @param unsafe  TRUE to enable verbose debugging or FALSE to disable it.
+ * @param unsafe TRUE to enable debug logging of messages that could
+ *        potentially contain passwords and other sensitive information.
+ *        FALSE to disable it.
  *
  * @since 2.6.0
  */
 void purple_debug_set_unsafe(gboolean unsafe);
 
 /**
- * Check if unsafe debugging is enabled.
+ * Check if unsafe debugging is enabled.  Defaults to FALSE.
  *
- * @return TRUE if verbose debugging is enabled, FALSE if it is not.
+ * @return TRUE if the debug logging of all messages is enabled, FALSE
+ *         if messages that could potentially contain passwords and other
+ *         sensitive information are not logged.
  *
  * @since 2.6.0
  */
diff -r 5f9d8e5e4a26 -r ca74edd1489e Frameworks/libpurple.framework/Versions/0/Headers/directconn.h
--- a/Frameworks/libpurple.framework/Versions/0/Headers/directconn.h	Sun Oct 31 12:15:58 2010 -0500
+++ b/Frameworks/libpurple.framework/Versions/0/Headers/directconn.h	Sun Oct 31 22:58:59 2010 -0500
@@ -26,36 +26,174 @@
 
 typedef struct _MsnDirectConn MsnDirectConn;
 
+#include "network.h"
+#include "proxy.h"
+#include "circbuffer.h"
+
 #include "msg.h"
 #include "slp.h"
 #include "slplink.h"
+#include "slpmsg.h"
+
+typedef enum
+{
+	DC_STATE_CLOSED,            /*< No socket opened yet */
+	DC_STATE_FOO,               /*< Waiting for FOO message */
+	DC_STATE_HANDSHAKE,         /*< Waiting for handshake message */
+	DC_STATE_HANDSHAKE_REPLY,   /*< Waiting for handshake reply message */
+	DC_STATE_ESTABLISHED        /*< Handshake complete */
+} MsnDirectConnState;
+
+typedef enum
+{
+	DC_PROCESS_OK = 0,
+	DC_PROCESS_ERROR,
+	DC_PROCESS_FALLBACK,
+	DC_PROCESS_CLOSE
+
+} MsnDirectConnProcessResult;
+
+typedef enum
+{
+	DC_NONCE_UNKNOWN,	/**< Invalid scheme */
+	DC_NONCE_PLAIN,     /**< No hashing */
+	DC_NONCE_SHA1       /**< First 16 bytes of SHA1 of nonce */
+
+} MsnDirectConnNonceType;
+
+typedef struct _MsnDirectConnPacket MsnDirectConnPacket;
+
+struct _MsnDirectConnPacket {
+	guint32     length;
+	guchar      *data;
+
+	void        (*sent_cb)(struct _MsnDirectConnPacket*);
+	MsnMessage  *msg;
+};
 
 struct _MsnDirectConn
 {
-	MsnSlpLink *slplink;
-	MsnSlpCall *initial_call;
+	MsnDirectConnState  state;      /**< Direct connection status */
+	MsnSlpLink          *slplink;   /**< The slplink using this direct connection */
+	MsnSlpCall          *slpcall;   /**< The slpcall which initiated the direct connection */
+	char                *msg_body;  /**< The body of message sent by send_connection_info_msg_cb */
+	MsnSlpMessage       *prev_ack;  /**< The saved SLP ACK message */
 
-	PurpleProxyConnectData *connect_data;
+	MsnDirectConnNonceType nonce_type;         /**< The type of nonce hashing */
+	guchar                 nonce[16];          /**< The nonce used for handshake */
+	gchar                  nonce_hash[37];     /**< The hash of nonce */
+	gchar                  remote_nonce[37];   /**< The remote side's nonce */
 
-	gboolean acked;
+	PurpleNetworkListenData *listen_data;           /**< The pending socket creation request */
+	PurpleProxyConnectData  *connect_data;          /**< The pending connection attempt */
+	int                     listenfd;               /**< The socket we're listening for incoming connections */
+	guint                   listenfd_handle;        /**< The timeout handle for incoming connection */
+	guint                   connect_timeout_handle; /**< The timeout handle for outgoing connection */
 
-	char *nonce;
+	int     fd;             /**< The direct connection socket */
+	guint   recv_handle;    /**< The incoming data callback handle */
+	guint   send_handle;    /**< The outgoing data callback handle */
 
-	int fd;
+	gchar   *in_buffer; /**< The receive buffer */
+	int     in_size;    /**< The receive buffer size */
+	int     in_pos;     /**< The first free position in receive buffer */
+	GQueue  *out_queue; /**< The outgoing packet queue */
+	int     msg_pos;    /**< The position of next byte to be sent in the actual packet */
 
-	int port;
-	int inpa;
+	MsnSlpHeader    header; /**< SLP header for parsing / serializing */
 
-	int c;
+	/** The callback used for sending information to the peer about the opened socket */
+	void (*send_connection_info_msg_cb)(MsnDirectConn *);
+
+	gchar   *ext_ip;    /**< Our external IP address */
+	int     ext_port;   /**< Our external port */
+
+	guint       timeout_handle;
+	gboolean    progress;
+
+	/*int   num_calls;*/  /**< The number of slpcalls using this direct connection */
 };
 
-MsnDirectConn *msn_directconn_new(MsnSlpLink *slplink);
-gboolean msn_directconn_connect(MsnDirectConn *directconn,
-								const char *host, int port);
-void msn_directconn_listen(MsnDirectConn *directconn);
-void msn_directconn_send_msg(MsnDirectConn *directconn, MsnMessage *msg);
-void msn_directconn_parse_nonce(MsnDirectConn *directconn, const char *nonce);
-void msn_directconn_destroy(MsnDirectConn *directconn);
-void msn_directconn_send_handshake(MsnDirectConn *directconn);
+/* Outgoing attempt */
+#define DC_OUTGOING_TIMEOUT (5)
+/* Time for internal + external connection attempts */
+#define DC_INCOMING_TIMEOUT (DC_OUTGOING_TIMEOUT * 3)
+/* Timeout for lack of activity */
+#define DC_TIMEOUT          (60)
+
+/*
+ * Queues an MSN message to be sent via direct connection.
+ */
+void
+msn_dc_enqueue_msg(MsnDirectConn *dc, MsnMessage *msg);
+
+/*
+ * Creates, initializes, and returns a new MsnDirectConn structure.
+ */
+MsnDirectConn *
+msn_dc_new(MsnSlpCall *slpcall);
+
+/*
+ * Destroys an MsnDirectConn structure. Frees every buffer allocated earlier
+ * restores saved callbacks, etc.
+ */
+void
+msn_dc_destroy(MsnDirectConn *dc);
+
+/*
+ * Fallback to switchboard connection. Used when neither side is able to
+ * create a listening socket.
+ */
+void
+msn_dc_fallback_to_sb(MsnDirectConn *dc);
+
+/*
+ * Increases the slpcall counter in DC. The direct connection remains open
+ * until all slpcalls using it are destroyed.
+ */
+void
+msn_dc_ref(MsnDirectConn *dc);
+
+/*
+ * Decrease the slpcall counter in DC. The direct connection remains open
+ * until all slpcalls using it are destroyed.
+ */
+void
+msn_dc_unref(MsnDirectConn *dc);
+
+/*
+ * Sends a direct connect INVITE message on the associated slplink
+ * with the corresponding connection type and information.
+ */
+void
+msn_dc_send_invite(MsnDirectConn *dc);
+
+/*
+ * Sends a direct connect OK message as a response to an INVITE received earliaer
+ * on the corresponding slplink.
+ */
+void
+msn_dc_send_ok(MsnDirectConn *dc);
+
+/*
+ * This callback will be called when we're successfully connected to
+ * the remote host.
+ */
+void
+msn_dc_connected_to_peer_cb(gpointer data, gint fd, const gchar *error_msg);
+
+/*
+ * This callback will be called when we're unable to connect to
+ * the remote host in DC_CONNECT_TIMEOUT seconds.
+ */
+gboolean
+msn_dc_outgoing_connection_timeout_cb(gpointer data);
+
+/*
+ * This callback will be called when the listening socket is successfully
+ * created and its parameters (IP/port) are available.
+ */
+void
+msn_dc_listen_socket_created_cb(int listenfd, gpointer data);
 
 #endif /* MSN_DIRECTCONN_H */
diff -r 5f9d8e5e4a26 -r ca74edd1489e Frameworks/libpurple.framework/Versions/0/Headers/ft.h
--- a/Frameworks/libpurple.framework/Versions/0/Headers/ft.h	Sun Oct 31 12:15:58 2010 -0500
+++ b/Frameworks/libpurple.framework/Versions/0/Headers/ft.h	Sun Oct 31 22:58:59 2010 -0500
@@ -58,8 +58,8 @@
 	PURPLE_XFER_STATUS_ACCEPTED,      /**< Receive accepted, but destination file not selected yet */
 	PURPLE_XFER_STATUS_STARTED,       /**< purple_xfer_start has been called. */
 	PURPLE_XFER_STATUS_DONE,          /**< The xfer completed successfully. */
-	PURPLE_XFER_STATUS_CANCEL_LOCAL,  /**< The xfer was canceled by us. */
-	PURPLE_XFER_STATUS_CANCEL_REMOTE  /**< The xfer was canceled by the other end, or we couldn't connect. */
+	PURPLE_XFER_STATUS_CANCEL_LOCAL,  /**< The xfer was cancelled by us. */
+	PURPLE_XFER_STATUS_CANCEL_REMOTE  /**< The xfer was cancelled by the other end, or we couldn't connect. */
 } PurpleXferStatusType;
 
 /**
@@ -120,7 +120,12 @@
 	 */
 	void (*data_not_sent)(PurpleXfer *xfer, const guchar *buffer, gsize size);
 
-	void (*_purple_reserved1)(void);
+	/**
+	 * Op to create a thumbnail image for a file transfer
+	 *
+	 * @param xfer   The file transfer structure
+	 */
+	void (*add_thumbnail)(PurpleXfer *xfer, const gchar *formats);
 } PurpleXferUiOps;
 
 /**
@@ -299,11 +304,12 @@
 PurpleXferStatusType purple_xfer_get_status(const PurpleXfer *xfer);
 
 /**
- * Returns true if the file transfer was canceled.
+ * Returns true if the file transfer was cancelled.
  *
  * @param xfer The file transfer.
  *
- * @return Whether or not the transfer was canceled.
+ * @return Whether or not the transfer was cancelled.
+ * FIXME: This should be renamed using cancelled for 3.0.0.
  */
 gboolean purple_xfer_is_canceled(const PurpleXfer *xfer);
 
@@ -687,6 +693,51 @@
  */
 void purple_xfer_prpl_ready(PurpleXfer *xfer);
 
+/**
+ * Gets the thumbnail data for a transfer
+ *
+ * @param xfer The file transfer to get the thumbnail for
+ * @param len  If not @c NULL, the length of the thumbnail data returned
+ *             will be set in the location pointed to by this.
+ * @return The thumbnail data, or NULL if there is no thumbnail
+ * @since 2.7.0
+ */
+gconstpointer purple_xfer_get_thumbnail(const PurpleXfer *xfer, gsize *len);
+
+/**
+ * Gets the mimetype of the thumbnail preview for a transfer
+ *
+ * @param xfer The file transfer to get the mimetype for
+ * @return The mimetype of the thumbnail, or @c NULL if not thumbnail is set
+ * @since 2.7.0
+ */
+const gchar *purple_xfer_get_thumbnail_mimetype(const PurpleXfer *xfer);
+	
+	
+/**
+ * Sets the thumbnail data for a transfer
+ *
+ * @param xfer The file transfer to set the data for
+ * @param thumbnail A pointer to the thumbnail data, this will be copied
+ * @param size The size in bytes of the passed in thumbnail data
+ * @param mimetype The mimetype of the generated thumbnail
+ * @since 2.7.0
+ */
+void purple_xfer_set_thumbnail(PurpleXfer *xfer, gconstpointer thumbnail,
+	gsize size, const gchar *mimetype);
+
+/**
+ * Prepare a thumbnail for a transfer (if the UI supports it)
+ * will be no-op in case the UI doesn't implement thumbnail creation
+ *
+ * @param xfer The file transfer to create a thumbnail for
+ * @param formats A comma-separated list of mimetypes for image formats
+ *	 	  the protocols can use for thumbnails.
+ * @since 2.7.0
+ */
+void purple_xfer_prepare_thumbnail(PurpleXfer *xfer, const gchar *formats);
+
+
 /*@}*/
 
 /**************************************************************************/
diff -r 5f9d8e5e4a26 -r ca74edd1489e Frameworks/libpurple.framework/Versions/0/Headers/internal.h
--- a/Frameworks/libpurple.framework/Versions/0/Headers/internal.h	Sun Oct 31 12:15:58 2010 -0500
+++ b/Frameworks/libpurple.framework/Versions/0/Headers/internal.h	Sun Oct 31 22:58:59 2010 -0500
@@ -118,36 +118,13 @@
 # include <unistd.h>
 #endif
 
-/* MAXPATHLEN should only be used with readlink() on glib < 2.4.0.  For
- * anything else, use g_file_read_link() or other dynamic functions.  This is
- * important because Hurd has no hard limits on path length. */
-#if !GLIB_CHECK_VERSION(2,4,0)
-# ifndef MAXPATHLEN
-#  ifdef PATH_MAX
-#   define MAXPATHLEN PATH_MAX
-#  else
-#   define MAXPATHLEN 1024
-#  endif
-# endif
-#endif
-
 #ifndef HOST_NAME_MAX
 # define HOST_NAME_MAX 255
 #endif
 
 #include <glib.h>
-#if !GLIB_CHECK_VERSION(2,4,0)
-#	define G_MAXUINT32 ((guint32) 0xffffffff)
-#endif
 
-#ifndef G_MAXSIZE
-#	if GLIB_SIZEOF_LONG == 8
-#		define G_MAXSIZE ((gsize) 0xffffffffffffffff)
-#	else
-#		define G_MAXSIZE ((gsize) 0xffffffff)
-#	endif
-#endif
-
+/* This wasn't introduced until Glib 2.14 :( */
 #ifndef G_MAXSSIZE
 #	if GLIB_SIZEOF_LONG == 8
 #		define G_MAXSSIZE ((gssize) 0x7fffffffffffffff)
@@ -156,80 +133,12 @@
 #	endif
 #endif
 
-#if GLIB_CHECK_VERSION(2,6,0)
-#	include <glib/gstdio.h>
-#endif
-
-#if !GLIB_CHECK_VERSION(2,6,0)
-#	define g_freopen freopen
-#	define g_fopen fopen
-#	define g_rmdir rmdir
-#	define g_remove remove
-#	define g_unlink unlink
-#	define g_lstat lstat
-#	define g_stat stat
-#	define g_mkdir mkdir
-#	define g_rename rename
-#	define g_open open
-#endif
-
-#if !GLIB_CHECK_VERSION(2,8,0) && !defined _WIN32
-#	define g_access access
-#endif
-
-#if !GLIB_CHECK_VERSION(2,10,0)
-#	define g_slice_new(type) g_new(type, 1)
-#	define g_slice_new0(type) g_new0(type, 1)
-#	define g_slice_free(type, mem) g_free(mem)
-#endif
+#include <glib/gstdio.h>
 
 #ifdef _WIN32
 #include "win32dep.h"
 #endif
 
-/* ugly ugly ugly */
-/* This is a workaround for the fact that G_GINT64_MODIFIER and G_GSIZE_FORMAT
- * are only defined in Glib >= 2.4 */
-#ifndef G_GINT64_MODIFIER
-#	if GLIB_SIZEOF_LONG == 8
-#		define G_GINT64_MODIFIER "l"
-#	else
-#		define G_GINT64_MODIFIER "ll"
-#	endif
-#endif
-
-#ifndef G_GSIZE_MODIFIER
-#	if GLIB_SIZEOF_LONG == 8
-#		define G_GSIZE_MODIFIER "l"
-#	else
-#		define G_GSIZE_MODIFIER ""
-#	endif
-#endif
-
-#ifndef G_GSIZE_FORMAT
-#	if GLIB_SIZEOF_LONG == 8
-#		define G_GSIZE_FORMAT "lu"
-#	else
-#		define G_GSIZE_FORMAT "u"
-#	endif
-#endif
-
-#ifndef G_GSSIZE_FORMAT
-#	if GLIB_SIZEOF_LONG == 8
-#		define G_GSSIZE_FORMAT "li"
-#	else
-#		define G_GSSIZE_FORMAT "i"
-#	endif
-#endif
-
-#ifndef G_GNUC_NULL_TERMINATED
-#	if     __GNUC__ >= 4
-#		define G_GNUC_NULL_TERMINATED __attribute__((__sentinel__))
-#	else
-#		define G_GNUC_NULL_TERMINATED
-#	endif
-#endif
-
 #ifdef HAVE_CONFIG_H
 #if SIZEOF_TIME_T == 4
 #	define PURPLE_TIME_T_MODIFIER "lu"
@@ -242,38 +151,6 @@
 
 #include <glib-object.h>
 
-#ifndef G_DEFINE_TYPE
-#define G_DEFINE_TYPE(TypeName, type_name, TYPE_PARENT) \
-\
-static void     type_name##_init              (TypeName        *self); \
-static void     type_name##_class_init        (TypeName##Class *klass); \
-static gpointer type_name##_parent_class = NULL; \
-static void     type_name##_class_intern_init (gpointer klass) \
-{ \
-  type_name##_parent_class = g_type_class_peek_parent (klass); \
-  type_name##_class_init ((TypeName##Class*) klass); \
-} \
-\
-GType \
-type_name##_get_type (void) \
-{ \
-  static GType g_define_type_id = 0; \
-  if (G_UNLIKELY (g_define_type_id == 0)) \
-    { \
-      g_define_type_id = \
-        g_type_register_static_simple (TYPE_PARENT, \
-                                       g_intern_static_string (#TypeName), \
-                                       sizeof (TypeName##Class), \
-                                       (GClassInitFunc)type_name##_class_intern_init, \
-                                       sizeof (TypeName), \
-                                       (GInstanceInitFunc)type_name##_init, \
-                                       (GTypeFlags) 0); \
-    }					\
-  return g_define_type_id;		\
-} /* closes type_name##_get_type() */
-
-#endif
-
 /* Safer ways to work with static buffers. When using non-static
  * buffers, either use g_strdup_* functions (preferred) or use
  * g_strlcpy/g_strlcpy directly. */
diff -r 5f9d8e5e4a26 -r ca74edd1489e Frameworks/libpurple.framework/Versions/0/Headers/jabber.h
--- a/Frameworks/libpurple.framework/Versions/0/Headers/jabber.h	Sun Oct 31 12:15:58 2010 -0500
+++ b/Frameworks/libpurple.framework/Versions/0/Headers/jabber.h	Sun Oct 31 22:58:59 2010 -0500
@@ -80,7 +80,7 @@
 
 #define CAPS0115_NODE "http://pidgin.im/"
 
-#define JABBER_DEFAULT_REQUIRE_TLS    TRUE
+#define JABBER_DEFAULT_REQUIRE_TLS    "require_starttls"
 #define JABBER_DEFAULT_FT_PROXIES     "proxy.eu.jabber.org"
 
 /* Index into attention_types list */
@@ -105,19 +105,23 @@
 	xmlParserCtxt *context;
 	xmlnode *current;
 
-	enum {
-		JABBER_PROTO_0_9,
-		JABBER_PROTO_1_0
+	struct {
+		guint8 major;
+		guint8 minor;
 	} protocol_version;
 
 	JabberSaslMech *auth_mech;
 	gpointer auth_mech_data;
+
+	/**
+	 * The header from the opening <stream/> tag.  This being NULL is treated
+	 * as a special condition in the parsing code (signifying the next
+	 * stanza started is an opening stream tag), and its being missing on
+	 * the stream header is treated as a fatal error.
+	 */
 	char *stream_id;
 	JabberStreamState state;
 
-	/* SASL authentication */
-	char *expected_rspauth;
-
 	GHashTable *buddies;
 
 	/*
@@ -166,6 +170,11 @@
 	time_t idle;
 	time_t old_idle;
 
+	/** When we last pinged the server, so we don't ping more
+	 *  often than once every minute.
+	 */
+	time_t last_ping;
+
 	JabberID *user;
 	JabberBuddy *user_jb;
 
@@ -197,6 +206,7 @@
 #ifdef HAVE_CYRUS_SASL
 	sasl_conn_t *sasl;
 	sasl_callback_t *sasl_cb;
+	sasl_secret_t *sasl_secret;
 	const char *current_mech;
 	int auth_fail_count;
 
@@ -243,6 +253,8 @@
 
 	/* A purple timeout tag for the keepalive */
 	guint keepalive_timeout;
+	guint max_inactivity;
+	guint inactivity_timer;
 
 	PurpleSrvResponse *srv_rec;
 	guint srv_rec_idx;
@@ -264,7 +276,12 @@
 	gchar *stun_ip;
 	int stun_port;
 	PurpleDnsQueryData *stun_query;
-	/* later add stuff to handle TURN relays... */
+
+	/* stuff for Google's relay handling */
+	gchar *google_relay_token;
+	gchar *google_relay_host;
+	GList *google_relay_requests; /* the HTTP requests to get */
+												/* relay info */
 };
 
 typedef gboolean (JabberFeatureEnabled)(JabberStream *js, const gchar *namespace);
@@ -292,6 +309,9 @@
 
 /* what kind of additional features as returned from disco#info are supported? */
 extern GList *jabber_features;
+/* A sorted list of identities advertised.  Use jabber_add_identity to add
+ * so it remains sorted.
+ */
 extern GList *jabber_identities;
 
 void jabber_stream_features_parse(JabberStream *js, xmlnode *packet);
@@ -318,11 +338,25 @@
  */
 char *jabber_parse_error(JabberStream *js, xmlnode *packet, PurpleConnectionError *reason);
 
-void jabber_add_feature(const gchar *namespace, JabberFeatureEnabled cb); /* cb may be NULL */
+/**
+ * Add a feature to the list of features advertised via disco#info.  If you
+ * call this while accounts are connected, Bad Things(TM) will happen because
+ * the Entity Caps hash will be out-of-date (which should be fixed :/)
+ *
+ * @param namespace The namespace of the feature
+ * @param cb        A callback determining whether or not this feature
+ *                  will advertised; may be NULL.
+ */
+void jabber_add_feature(const gchar *namespace, JabberFeatureEnabled cb);
 void jabber_remove_feature(const gchar *namespace);
 
-/** Adds an identity to this jabber library instance. For list of valid values visit the
- *	website of the XMPP Registrar ( http://www.xmpp.org/registrar/disco-categories.html#client ).
+/** Adds an identity to this jabber library instance. For list of valid values
+ * visit the website of the XMPP Registrar
+ * (http://www.xmpp.org/registrar/disco-categories.html#client).
+ *
+ * Like with jabber_add_feature, if you call this while accounts are connected,
+ * Bad Things will happen.
+ *
  *  @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.
@@ -331,12 +365,24 @@
 void jabber_add_identity(const gchar *category, const gchar *type, const gchar *lang, const gchar *name);
 
 /**
+ * GCompareFunc for JabberIdentity structs.
+ */
+gint jabber_identity_compare(gconstpointer a, gconstpointer b);
+
+/**
  * 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);
 
+/**
+ * Restart the "we haven't sent anything in a while and should send
+ * something or the server will kick us off" timer (obviously
+ * called when sending something.  It's exposed for BOSH.)
+ */
+void jabber_stream_restart_inactivity_timer(JabberStream *js);
+
 /** PRPL functions */
 const char *jabber_list_icon(PurpleAccount *a, PurpleBuddy *b);
 const char* jabber_list_emblem(PurpleBuddy *b);
@@ -371,10 +417,7 @@
 PurpleMediaCaps jabber_get_media_caps(PurpleAccount *account, const char *who);
 gboolean jabber_can_receive_file(PurpleConnection *gc, const gchar *who);
 
-void jabber_register_commands(void);
-void jabber_unregister_commands(void);
-
-void jabber_init_plugin(PurplePlugin *plugin);
-void jabber_uninit_plugin(PurplePlugin *plugin);
+void jabber_plugin_init(PurplePlugin *plugin);
+void jabber_plugin_uninit(PurplePlugin *plugin);
 
 #endif /* PURPLE_JABBER_H_ */
diff -r 5f9d8e5e4a26 -r ca74edd1489e Frameworks/libpurple.framework/Versions/0/Headers/jutil.h
--- a/Frameworks/libpurple.framework/Versions/0/Headers/jutil.h	Sun Oct 31 12:15:58 2010 -0500
+++ b/Frameworks/libpurple.framework/Versions/0/Headers/jutil.h	Sun Oct 31 22:58:59 2010 -0500
@@ -30,6 +30,17 @@
 	char *resource;
 } JabberID;
 
+typedef enum {
+	JABBER_BUDDY_STATE_UNKNOWN = -2,
+	JABBER_BUDDY_STATE_ERROR = -1,
+	JABBER_BUDDY_STATE_UNAVAILABLE = 0,
+	JABBER_BUDDY_STATE_ONLINE,
+	JABBER_BUDDY_STATE_CHAT,
+	JABBER_BUDDY_STATE_AWAY,
+	JABBER_BUDDY_STATE_XA,
+	JABBER_BUDDY_STATE_DND
+} JabberBuddyState;
+




More information about the commits mailing list