changeset 26667:a3595b330671

Don't debug print that we are connecting an account until we are reasonably sure we can actually do that. Also debug print when someone attempts to connect a disabled account.
author Etan Reisner <pidgin@unreliablesource.net>
date Fri, 08 May 2009 00:42:23 +0000
parents e7f300fde262
children b98d066df628
files libpurple/account.c
diffstat 1 files changed, 12 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/account.c	Sat Mar 28 02:26:21 2009 +0000
+++ b/libpurple/account.c	Fri May 08 00:42:23 2009 +0000
@@ -1129,29 +1129,32 @@
 purple_account_connect(PurpleAccount *account)
 {
 	PurplePlugin *prpl;
+	const char *password, *username;
 	PurplePluginProtocolInfo *prpl_info;
-	const char *password;
 
 	g_return_if_fail(account != NULL);
 
-	purple_debug_info("account", "Connecting to account %s\n",
-					purple_account_get_username(account));
-
-	if (!purple_account_get_enabled(account, purple_core_get_ui()))
+	username = purple_account_get_username(account);
+
+	if (!purple_account_get_enabled(account, purple_core_get_ui())) {
+		purple_debug_info("account",
+				  "Account %s not enabled, not connecting.\n",
+				  username);
 		return;
+	}
 
 	prpl = purple_find_prpl(purple_account_get_protocol_id(account));
-	if (prpl == NULL)
-	{
+	if (prpl == NULL) {
 		gchar *message;
 
-		message = g_strdup_printf(_("Missing protocol plugin for %s"),
-			purple_account_get_username(account));
+		message = g_strdup_printf(_("Missing protocol plugin for %s"), username);
 		purple_notify_error(account, _("Connection Error"), message, NULL);
 		g_free(message);
 		return;
 	}
 
+	purple_debug_info("account", "Connecting to account %s.\n", username);
+
 	prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
 	password = purple_account_get_password(account);
 	if ((password == NULL) &&