changeset 6110:d1d8e70cf33d

[gaim-migrate @ 6572] Now when the password field is blank and gaim prompts you for the pass, the gc is now destroyed at that time and then recreated later. This feels more correct to me, I dunno. This means that you can have multiple "enter your password" dialog windows for the same account, though. I don't think this is too big of a deal, so I figured it would be ok. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 13 Jul 2003 18:43:30 +0000
parents 0922bb7a7bbc
children 77dcc775f97b
files src/account.c src/connection.c src/gtkrequest.c
diffstat 3 files changed, 5 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/account.c	Sun Jul 13 18:33:25 2003 +0000
+++ b/src/account.c	Sun Jul 13 18:43:30 2003 +0000
@@ -175,7 +175,6 @@
 	GaimConnection *gc;
 
 	g_return_val_if_fail(account != NULL, NULL);
-	g_return_val_if_fail(!gaim_account_is_connected(account), NULL);
 
 	if (gaim_account_get_connection(account) != NULL)
 		return NULL;
--- a/src/connection.c	Sun Jul 13 18:33:25 2003 +0000
+++ b/src/connection.c	Sun Jul 13 18:43:30 2003 +0000
@@ -85,18 +85,11 @@
 	g_free(gc);
 }
 
-static void request_pass_ok_cb(GaimConnection *gc, const char *entry)
+static void request_pass_ok_cb(GaimAccount *account, const char *entry)
 {
-	GaimAccount *account = gaim_connection_get_account(gc);
-
 	gaim_account_set_password(account, (*entry != '\0') ? entry : NULL);
 
-	gaim_connection_connect(gc);
-}
-
-static void request_pass_cancel_cb(GaimConnection *gc, const char *entry)
-{
-	gaim_connection_destroy(gc);
+	gaim_account_connect(account);
 }
 
 
@@ -130,7 +123,8 @@
 		gaim_request_input(gc, NULL, _("Please enter your password"), NULL, 
 						   NULL, FALSE, TRUE,
 						   _("OK"), G_CALLBACK(request_pass_ok_cb),
-						   _("Cancel"), G_CALLBACK(request_pass_cancel_cb), gc);
+						   _("Cancel"), NULL, account);
+		gaim_connection_destroy(gc);
 
 		return;
 	}
--- a/src/gtkrequest.c	Sun Jul 13 18:33:25 2003 +0000
+++ b/src/gtkrequest.c	Sun Jul 13 18:43:30 2003 +0000
@@ -79,7 +79,7 @@
 
 	if (id < data->cb_count && data->cbs[id] != NULL)
 		((GaimRequestInputCb)data->cbs[id])(data->user_data, value);
-	else
+	else if (data->cbs[1] != NULL)
 		((GaimRequestInputCb)data->cbs[1])(data->user_data, value);
 
 	gaim_request_close(GAIM_REQUEST_INPUT, data);