cpw.gillux.detachablepurple: b558e372: In remote mode, avoid autoconnecting the...

gillux at soc.pidgin.im gillux at soc.pidgin.im
Sun May 15 14:06:44 EDT 2011


----------------------------------------------------------------------
Revision: b558e372319c3389461082f11b4fe54a03becb04
Parent:   8fb7b5f804437dc8ad2369d49def3dd14466248b
Author:   gillux at soc.pidgin.im
Date:     05/14/11 23:00:47
Branch:   im.pidgin.cpw.gillux.detachablepurple
URL: http://d.pidgin.im/viewmtn/revision/info/b558e372319c3389461082f11b4fe54a03becb04

Changelog: 

In remote mode, avoid autoconnecting the enabled accounts on startup.

Changes against parent 8fb7b5f804437dc8ad2369d49def3dd14466248b

  patched  libpurple/account.c
  patched  libpurple/accountlist.c

-------------- next part --------------
============================================================
--- libpurple/account.c	c3f61d574a63c10b1f865047615730a140453b3a
+++ libpurple/account.c	0d0f3e17b21df17e3ef6f74d21b35ec266844789
@@ -2945,6 +2945,10 @@ purple_accounts_restore_current_statuses
 		return;
 	}
 
+	/* In remote mode, the daemon already restored the statuses. */
+	if (purple_core_is_remote_mode())
+		return;
+
 	for (l = purple_accounts_all(); l != NULL; l = l->next)
 	{
 		account = (PurpleAccount *)l->data;
============================================================
--- libpurple/accountlist.c	01a949586c337fa205b85a5cb92e6c22a00c7775
+++ libpurple/accountlist.c	d7fbafa6c426a19b38c70138c2bf668ff64b3464
@@ -692,13 +692,15 @@ purple_accounts_activate(void)
 
 	/* Make the enabled accounts to connect, as if we ran
 	 * purple_account_set_enabled(). */
-	while (accounts != NULL) {
-		PurpleAccount *account = accounts->data;
+	if (!purple_core_is_remote_mode()) { /* Except in remote mode. */
+		while (accounts != NULL) {
+			PurpleAccount *account = accounts->data;
 
-		if (purple_account_get_enabled(account))
-			account_enabled_cb(account);
+			if (purple_account_get_enabled(account))
+				account_enabled_cb(account);
 
-		accounts = accounts->next;
+			accounts = accounts->next;
+		}
 	}
 }
 


More information about the Commits mailing list