im.pidgin.cpw.resiak.disconnectreason: 8e0477db533961b6d2ede63c5b8ac618ec428dd0

resiak at soc.pidgin.im resiak at soc.pidgin.im
Sat Nov 3 07:12:57 EDT 2007


-----------------------------------------------------------------
Revision: 8e0477db533961b6d2ede63c5b8ac618ec428dd0
Ancestor: 4cb0fc8473bb2c11787948e18b243fe7378ad2a0
Author: resiak at soc.pidgin.im
Date: 2007-11-02T15:00:24
Branch: im.pidgin.cpw.resiak.disconnectreason

Modified files:
        ChangeLog.API libpurple/account.c libpurple/account.h

ChangeLog: 

Add purple_account_clear_current_error(), which does what it says on the tin.

-------------- next part --------------
============================================================
--- ChangeLog.API	0fc9eb7a38e77923cbe4448646bc407de373cf7e
+++ ChangeLog.API	71ea6c93d0a9a759cf95a7925c594218db922859
@@ -39,6 +39,8 @@ version 2.3.0 (??/??/????):
 		  account is happy with life), to allow bits of the UI to know
 		  the last error without caching it themselves (as
 		  PidginBuddyList does).
+		* purple_account_clear_current_error() to reset an account's
+		  error state to NULL.
 		* An account-error-changed signal, firing when
 		  purple_account_get_current_error()'s return value changes.
 
============================================================
--- libpurple/account.c	cd5e5c72660963eaf621541104117b12d64fe75d
+++ libpurple/account.c	4b2ebcdbf96ff2e6b5ff1e7cb45720c47f135a6b
@@ -85,8 +85,6 @@ static GList *handles = NULL;
 
 static GList *handles = NULL;
 
-static void clear_current_error(PurpleAccount *account);
-
 /*********************************************************************
  * Writing to disk                                                   *
  *********************************************************************/
@@ -2233,29 +2231,11 @@ static void
 }
 
 static void
-clear_current_error(PurpleAccount *account)
-{
-	PurpleAccountPrivate *priv = PURPLE_ACCOUNT_GET_PRIVATE(account);
-	PurpleConnectionErrorInfo *old;
-
-	if (priv->current_error)
-	{
-		old = priv->current_error;
-		priv->current_error = NULL;
-		purple_signal_emit(purple_accounts_get_handle(),
-		                   "account-error-changed",
-		                   account, old, priv->current_error);
-		g_free (old);
-	}
-
-}
-
-static void
 signed_on_cb(PurpleConnection *gc,
              gpointer unused)
 {
 	PurpleAccount *account = purple_connection_get_account(gc);
-	clear_current_error(account);
+	purple_account_clear_current_error(account);
 }
 
 static void
@@ -2285,6 +2265,24 @@ purple_account_get_current_error(PurpleA
 	return priv->current_error;
 }
 
+static void
+purple_account_clear_current_error(PurpleAccount *account)
+{
+	PurpleAccountPrivate *priv = PURPLE_ACCOUNT_GET_PRIVATE(account);
+	PurpleConnectionErrorInfo *old;
+
+	if (priv->current_error)
+	{
+		old = priv->current_error;
+		priv->current_error = NULL;
+		purple_signal_emit(purple_accounts_get_handle(),
+		                   "account-error-changed",
+		                   account, old, priv->current_error);
+		g_free (old);
+	}
+}
+
+
 void
 purple_accounts_add(PurpleAccount *account)
 {
@@ -2313,7 +2311,7 @@ purple_accounts_remove(PurpleAccount *ac
 	 * which is the end of the guarantee that the the error's pointer is
 	 * valid.
 	 */
-	clear_current_error(account);
+	purple_account_clear_current_error(account);
 	purple_signal_emit(purple_accounts_get_handle(), "account-removed", account);
 }
 
============================================================
--- libpurple/account.h	796cbc3bd9ee667f7530e6ec38c102c5dc43a9f9
+++ libpurple/account.h	f937474c102904c42decb1b34f6b1993bc56d0ae
@@ -907,6 +907,13 @@ const PurpleConnectionErrorInfo *purple_
  */
 const PurpleConnectionErrorInfo *purple_account_get_current_error(PurpleAccount *account);
 
+/**
+ * Clear an account's current error state, resetting it to @c NULL.
+ *
+ * @param account The account whose error state should be cleared.
+ */
+static void purple_account_clear_current_error(PurpleAccount *account);
+
 /*@}*/
 
 /**************************************************************************/


More information about the Commits mailing list