changeset 6231:1fc158d6ebdb

[gaim-migrate @ 6724] New accounts added using the login window are now correctly saved. You can now use gaim -l to sign on accounts on prpls with no passwords or with optional passwords. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sat, 19 Jul 2003 18:15:06 +0000
parents 0fef71e24ad5
children 48022cc36114
files src/connection.c src/main.c
diffstat 2 files changed, 16 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/src/connection.c	Sat Jul 19 14:59:43 2003 +0000
+++ b/src/connection.c	Sat Jul 19 18:15:06 2003 +0000
@@ -127,17 +127,20 @@
 		return;
 
 	if (!(prpl_info->options & OPT_PROTO_NO_PASSWORD) &&
-		!(prpl_info->options & OPT_PROTO_PASSWORD_OPTIONAL) &&
-		gaim_account_get_password(account) == NULL) {
-
+			!(prpl_info->options & OPT_PROTO_PASSWORD_OPTIONAL) &&
+			gaim_account_get_password(account) == NULL) {
 		gchar *primary;
+		gchar *escaped;
+		const gchar *username = gaim_account_get_username(account);
+
 		gaim_debug(GAIM_DEBUG_INFO, "connection", "Requesting password\n");
-		primary = g_strdup_printf(_("Enter password for %s"),
-								 gaim_account_get_username(account));
+		escaped = g_markup_escape_text(username, strlen(username));
+		primary = g_strdup_printf(_("Enter password for %s"), escaped);
 		gaim_request_input(gc, NULL, primary, NULL, NULL, FALSE, TRUE,
 						   _("OK"), G_CALLBACK(request_pass_ok_cb),
 						   _("Cancel"), NULL, account);
 		g_free(primary);
+		g_free(escaped);
 		gaim_connection_destroy(gc);
 
 		return;
--- a/src/main.c	Sat Jul 19 14:59:43 2003 +0000
+++ b/src/main.c	Sat Jul 19 18:15:06 2003 +0000
@@ -153,8 +153,8 @@
 	account = gaim_accounts_find(username, -1);
 	if (!account) {
 		account = gaim_account_new(username, "prpl-oscar");
-
 		gaim_account_set_remember_password(account, TRUE);
+		gaim_accounts_add(account);
 	}
 
 	gaim_account_set_password(account, (*password != '\0') ? password : NULL);
@@ -180,20 +180,15 @@
 		for (n = names; *n != NULL; n++) {
 			account = gaim_accounts_find(*n, -1);
 			if (account) {	/* found a user */
-				if (gaim_account_get_remember_password(account)) {
-					retval = 0;
-					gaim_account_connect(account);
-				}
+				retval = 0;
+				gaim_account_connect(account);
 			}
 		}
 		g_strfreev(names);
 	} else {		/* no name given, use default */
 		account = (GaimAccount *)gaim_accounts_get_all()->data;
-
-		if (gaim_account_get_remember_password(account)) {
-			retval = 0;
-			gaim_account_connect(account);
-		}
+		retval = 0;
+		gaim_account_connect(account);
 	}
 
 	return retval;
@@ -457,8 +452,10 @@
 
 	account = gaim_accounts_find(name, -1);
 
-	if (account == NULL)   /* new user */
+	if (account == NULL) { /* new user */
 		account = gaim_account_new(name, "prpl-oscar");
+		gaim_accounts_add(account);
+	}
 
 	/* Place it as the first user. */
 	gaim_accounts_reorder(account, 0);