soc.2010.detachablepurple: f0188d5d: Added some checks to avoid running usele...

gillux at soc.pidgin.im gillux at soc.pidgin.im
Thu Aug 5 00:04:08 EDT 2010


----------------------------------------------------------------------
Revision: f0188d5d00f9b9c0966b0bc39b6e8eeed3a6162e
Parent:   b940d485f0443cb8551e535476805acc622b70f7
Author:   gillux at soc.pidgin.im
Date:     08/04/10 23:57:02
Branch:   im.pidgin.soc.2010.detachablepurple
URL: http://d.pidgin.im/viewmtn/revision/info/f0188d5d00f9b9c0966b0bc39b6e8eeed3a6162e

Changelog: 

Added some checks to avoid running useless code in remote mode.

Changes against parent b940d485f0443cb8551e535476805acc622b70f7

  patched  libpurple/account.c
  patched  libpurple/connection.c

-------------- next part --------------
============================================================
--- libpurple/account.c	fae566dd29fff5173f3d31b178c4609797b95e01
+++ libpurple/account.c	942ba7c43bdf89f59b7fe6ba8a6e2da2c1c8da54
@@ -1550,6 +1550,11 @@ purple_account_set_enabled(PurpleAccount
 		return;
 #endif
 
+	/* Don't tell the daemon to (dis)connect if we are in remote mode,
+	 * it already did. */
+	if (purple_core_is_remote_mode())
+		return;
+
 	if (value && purple_presence_is_online(priv->presence))
 		purple_account_connect(account);
 	else if (!value && !purple_account_is_disconnected(account))
============================================================
--- libpurple/connection.c	d64954a3519d0a7ddfd93c05dbc6a97737a0109d
+++ libpurple/connection.c	dce434b27fa0933ca26d4a603565f5c21ffa5db5
@@ -232,6 +232,10 @@ _purple_connection_new(PurpleAccount *ac
 
 	priv->password = g_strdup(password);
 
+	/* In mirror mode we don't want to sign on. */
+	if (purple_core_is_mirror_mode())
+		return;
+
 	g_signal_emit(G_OBJECT(gc), signals[SIG_SIGNING_ON], 0);
 
 	if (regist)


More information about the Commits mailing list