im.pidgin.cpw.resiak.disconnectreason: 5e1647d093114a58682f9cc786a2d8b78cd04999

resiak at soc.pidgin.im resiak at soc.pidgin.im
Sun Oct 28 12:56:08 EDT 2007


-----------------------------------------------------------------
Revision: 5e1647d093114a58682f9cc786a2d8b78cd04999
Ancestor: 629b51aa395bedfed85aeed90d12ff466580fe12
Author: resiak at soc.pidgin.im
Date: 2007-10-28T16:32:37
Branch: im.pidgin.cpw.resiak.disconnectreason

Modified files:
        doc/account-signals.dox libpurple/account.c
        libpurple/account.h libpurple/connection.h pidgin/gtkblist.c

ChangeLog: 

PurpleConnectionErrorPair is a better name for struct { PurpleConnectionError;
const char *desc } than PurpleAccountCurrentError.

-------------- next part --------------
============================================================
--- doc/account-signals.dox	c09ab1804ee6a0d402581edb7014de22c841126f
+++ doc/account-signals.dox	14bc9be04766dccd72005d08466bdd417fa7f63e
@@ -144,7 +144,7 @@ void (*account_authorization_granted)(Pu
 
  @signaldef account-error-changed
   @signalproto
-void (*account_error_changed)(PurpleAccount *account, const PurpleAccountCurrentError *old_error, const PurpleAccountCurrentError *current_error);
+void (*account_error_changed)(PurpleAccount *account, const PurpleConnectionErrorPair *old_error, const PurpleConnectionErrorPair *current_error);
   @endsignalproto
   @signaldesc
    Emitted when @a account's error changes.
============================================================
--- libpurple/account.c	1a1e9e55d46ed6cdee20cc82669030caa4fde2a8
+++ libpurple/account.c	e02175554aaf9674cc6e78d74442a75e6e576bb4
@@ -43,7 +43,7 @@ typedef struct
 
 typedef struct
 {
-	PurpleAccountCurrentError *current_error;
+	PurpleConnectionErrorPair *current_error;
 } PurpleAccountPrivate;
 
 #define PURPLE_ACCOUNT_GET_PRIVATE(account) \
@@ -2236,7 +2236,7 @@ clear_current_error(PurpleAccount *accou
 clear_current_error(PurpleAccount *account)
 {
 	PurpleAccountPrivate *priv = PURPLE_ACCOUNT_GET_PRIVATE(account);
-	PurpleAccountCurrentError *old;
+	PurpleConnectionErrorPair *old;
 
 	if (priv->current_error)
 	{
@@ -2266,10 +2266,10 @@ connection_error_cb(PurpleConnection *gc
 {
 	PurpleAccount *account = purple_connection_get_account(gc);
 	PurpleAccountPrivate *priv = PURPLE_ACCOUNT_GET_PRIVATE(account);
-	PurpleAccountCurrentError *old = priv->current_error;
+	PurpleConnectionErrorPair *old = priv->current_error;
 
-	priv->current_error = g_new0(PurpleAccountCurrentError, 1);
-	priv->current_error->reason = err;
+	priv->current_error = g_new0(PurpleConnectionErrorPair, 1);
+	priv->current_error->type = err;
 	priv->current_error->description = desc;
 
 	purple_signal_emit(purple_accounts_get_handle(),
@@ -2278,7 +2278,7 @@ connection_error_cb(PurpleConnection *gc
 	g_free(old);
 }
 
-const PurpleAccountCurrentError *
+const PurpleConnectionErrorPair *
 purple_account_get_current_error(PurpleAccount *account)
 {
 	PurpleAccountPrivate *priv = PURPLE_ACCOUNT_GET_PRIVATE(account);
============================================================
--- libpurple/account.h	da0e3b8520363230289ba5ec6798b79f8027d83f
+++ libpurple/account.h	7b2a6cbcbd5a24bd4bb0b62bf5998874f635cf7e
@@ -144,15 +144,6 @@ struct _PurpleAccount
 	gpointer priv;              /**< Pointer to opaque private data. */
 };
 
-/** The error most recently encountered on an account. */
-typedef struct
-{
-	/** The type of error. */
-	PurpleConnectionError reason;
-	/** A localised, human-readable description of the error. */
-	const char *description;
-} PurpleAccountCurrentError;
-
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -912,7 +903,7 @@ gboolean purple_account_supports_offline
  * @constreturn   The type of error and a human-readable description of the
  *                current error, or @c NULL if there is no current error.
  */
-const PurpleAccountCurrentError *purple_account_get_current_error(PurpleAccount *account);
+const PurpleConnectionErrorPair *purple_account_get_current_error(PurpleAccount *account);
 
 /*@}*/
 
============================================================
--- libpurple/connection.h	27bbc13726b16f3da7b582e5df5f5b27529d2703
+++ libpurple/connection.h	a95c2e5f3a09f24583c4a1ce61f1fe7064ff59e8
@@ -126,6 +126,15 @@ typedef enum
 	PURPLE_CONNECTION_ERROR_OTHER_ERROR = 15
 } PurpleConnectionError;
 
+/** Holds the type of an error along with its description. */
+typedef struct
+{
+	/** The type of error. */
+	PurpleConnectionError type;
+	/** A localised, human-readable description of the error. */
+	const char *description;
+} PurpleConnectionErrorPair;
+
 #include <time.h>
 
 #include "account.h"
============================================================
--- pidgin/gtkblist.c	6991cc675e5f4c20222b188161142c1271f0cde8
+++ pidgin/gtkblist.c	519ceab505a37fa92886b0742de134c00952e7a4
@@ -4395,8 +4395,8 @@ update_account_error_state(PurpleAccount
 
 static void
 update_account_error_state(PurpleAccount *account,
-                           PurpleAccountCurrentError *old,
-                           PurpleAccountCurrentError *new,
+                           PurpleConnectionErrorPair *old,
+                           PurpleConnectionErrorPair *new,
                            PidginBuddyList *gtkblist)
 {
 	if (new)


More information about the Commits mailing list