changeset 11559:5909ea4e7746

[gaim-migrate @ 13823] When a login error (wants_to_die) occurs, informs the user with gaim_notify_error and disables the account. This way, it won't try reconnecting over and over again with the wrong password while the user doesn't know what's happening. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Tue, 20 Sep 2005 23:28:23 +0000
parents 19941a47405c
children c3bbfca00e85
files src/gtkconn.c
diffstat 1 files changed, 27 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkconn.c	Tue Sep 20 22:08:40 2005 +0000
+++ b/src/gtkconn.c	Tue Sep 20 23:28:23 2005 +0000
@@ -167,11 +167,33 @@
 
 		if (!listAccount)
 			accountReconnecting = g_slist_prepend(accountReconnecting, account);
-	} else if (info != NULL) {
-		g_hash_table_remove(hash, account);
-
-		if (listAccount)
-			accountReconnecting = g_slist_delete_link(accountReconnecting, listAccount);
+	} else {
+	  char *p, *s, *n=NULL ;
+	  if (info != NULL) 	    
+	    g_hash_table_remove(hash, account);
+	    
+	  if (listAccount)
+	      accountReconnecting = g_slist_delete_link(accountReconnecting, listAccount);
+	  
+	  if (gaim_account_get_alias(account)) {
+	    n = g_strdup_printf("%s (%s) (%s)",
+				  gaim_account_get_username(account),
+				  gaim_account_get_alias(account),
+				  gaim_account_get_protocol_name(account));
+	    } else {
+	      n = g_strdup_printf("%s (%s)",
+				  gaim_account_get_username(account),
+				  gaim_account_get_protocol_name(account));
+	    }
+	    
+	    p = g_strdup_printf(_("%s could not connect"), n);
+	    s = g_strdup_printf(_("%s was unable to connect do to an error. %s The account has been disabled. "
+				  "Correct the error and reenable to account to connect."), n, text);
+	    gaim_notify_error(NULL, NULL, p, s);
+	    g_free(p);
+	    g_free(s);
+	    g_free(n);
+	    gaim_account_set_enabled(account, GAIM_GTK_UI, FALSE);
 	}
 }