pidgin: 071d7e80: Add purple_account_is_disconnecting() ac...

andrew.victor at mxit.com andrew.victor at mxit.com
Sun Nov 6 15:35:42 EST 2011


----------------------------------------------------------------------
Revision: 071d7e809e0a4532e6dc367a6f05ea43e1ab0de0
Parent:   d914357c1482880fed2c89e136d5957688ff4732
Author:   andrew.victor at mxit.com
Date:     11/06/11 15:31:14
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/071d7e809e0a4532e6dc367a6f05ea43e1ab0de0

Changelog: 

Add purple_account_is_disconnecting() accessor function.
 

Changes against parent d914357c1482880fed2c89e136d5957688ff4732

  patched  ChangeLog.API
  patched  libpurple/account.c
  patched  libpurple/account.h
  patched  libpurple/protocols/irc/cmds.c
  patched  libpurple/protocols/jabber/jabber.c
  patched  libpurple/protocols/oscar/flap_connection.c

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jabber.c	58ff61f585f0961486f3691a85446cc2a1df632e
+++ libpurple/protocols/jabber/jabber.c	6af9f2854e3229d956ff808b18167eb71dfd48fc
@@ -440,7 +440,7 @@ static gboolean do_jabber_send_raw(Jabbe
 		 * we're disconnecting, don't generate (possibly another) error that
 		 * (for some UIs) would mask the first.
 		 */
-		if (!account->disconnecting) {
+		if (!purple_account_is_disconnecting(account)) {
 			gchar *tmp = g_strdup_printf(_("Lost connection with server: %s"),
 					g_strerror(errno));
 			purple_connection_error(js->gc,
============================================================
--- libpurple/account.c	55f3c965cc45250d55fc6a71496a45d0044482d1
+++ libpurple/account.c	ef149c07d62b280188639727a5b3afce307be4bb
@@ -1274,6 +1274,14 @@ purple_account_disconnect(PurpleAccount 
 	account->disconnecting = FALSE;
 }
 
+gboolean
+purple_account_is_disconnecting(const PurpleAccount *account)
+{
+	g_return_val_if_fail(account != NULL, TRUE);
+	
+	return account->disconnecting;
+}
+
 void
 purple_account_notify_added(PurpleAccount *account, const char *remote_user,
                           const char *id, const char *alias,
============================================================
--- libpurple/account.h	f60c9eeda1b127560d597bd2530cf2f8412b99c1
+++ libpurple/account.h	1b1cfdea540c3749c52bb6252274779b78350cb6
@@ -246,6 +246,15 @@ void purple_account_disconnect(PurpleAcc
 void purple_account_disconnect(PurpleAccount *account);
 
 /**
+ * Indicates if the account is currently being disconnected.
+ *
+ * @param account The account
+ *
+ * @return TRUE if the account is being disconnected.
+ */
+gboolean purple_account_is_disconnecting(const PurpleAccount *account);
+
+/**
  * Notifies the user that the account was added to a remote user's
  * buddy list.
  *
============================================================
--- libpurple/protocols/irc/cmds.c	6e9293a2315f5361d9534e0ce9aa833ecf3a32af
+++ libpurple/protocols/irc/cmds.c	dff36f8bfb80beb85ddc1471fc672a39044f6e91
@@ -423,7 +423,7 @@ int irc_cmd_quit(struct irc_conn *irc, c
 
 		irc->quitting = TRUE;
 
-		if (!irc->account->disconnecting)
+		if (!purple_account_is_disconnecting(irc->account))
 			purple_account_set_status(irc->account, "offline", TRUE, NULL);
 	}
 
============================================================
--- ChangeLog.API	6198226490213770e70a2b80f1bb8a7c4e235383
+++ ChangeLog.API	a2851ed352463cceec0ac0b9591d42f1a21df0cc
@@ -4,6 +4,7 @@ version 3.0.0 (??/??/????):
 	libpurple:
 		Added:
 		* pidgin_create_webview
+		* purple_account_is_disconnecting
 		* purple_account_get_ui_data
 		* purple_account_set_ui_data
 		* purple_account_register_completed
============================================================
--- libpurple/protocols/oscar/flap_connection.c	c972147709ca16ba1b2dee28519c369b62f1a751
+++ libpurple/protocols/oscar/flap_connection.c	883bd98c7822462152b9037e567d06f3c8147019
@@ -456,7 +456,7 @@ flap_connection_destroy_cb(gpointer data
 	 * TODO: If we don't have a SNAC_FAMILY_LOCATE connection then
 	 * we should try to request one instead of disconnecting.
 	 */
-	if (!account->disconnecting && ((od->oscar_connections == NULL)
+	if (!purple_account_is_disconnecting(account) && ((od->oscar_connections == NULL)
 			|| (!flap_connection_getbytype(od, SNAC_FAMILY_LOCATE))))
 	{
 		/* No more FLAP connections!  Sign off this PurpleConnection! */


More information about the Commits mailing list