changeset 11985:41d84ac57cb6

[gaim-migrate @ 14278] Getting some stuff out of my tree committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sat, 05 Nov 2005 21:49:44 +0000
parents 59494e5f7fdf
children bfbb1798535e
files src/account.c src/gtkaccount.c src/gtkprefs.c src/protocols/yahoo/yahoo.c
diffstat 4 files changed, 21 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/src/account.c	Sat Nov 05 20:45:35 2005 +0000
+++ b/src/account.c	Sat Nov 05 21:49:44 2005 +0000
@@ -878,11 +878,11 @@
 			gaim_conversation_set_account(conv, NULL);
 	}
 
-	if (account->username    != NULL) g_free(account->username);
-	if (account->alias       != NULL) g_free(account->alias);
-	if (account->password    != NULL) g_free(account->password);
-	if (account->user_info   != NULL) g_free(account->user_info);
-	if (account->protocol_id != NULL) g_free(account->protocol_id);
+	g_free(account->username);
+	g_free(account->alias);
+	g_free(account->password);
+	g_free(account->user_info);
+	g_free(account->protocol_id);
 
 	g_hash_table_destroy(account->settings);
 	g_hash_table_destroy(account->ui_settings);
@@ -914,10 +914,10 @@
 {
 	const char *entry;
 	gboolean remember;
-	
+
 	entry = gaim_request_fields_get_string(fields, "password");
 	remember = gaim_request_fields_get_bool(fields, "remember");
-	
+
 	if (!entry || !*entry)
 	{
 		gaim_notify_error(account, NULL, _("Password is required to sign on."), NULL);
@@ -1071,7 +1071,6 @@
 	}
 
 	gaim_account_change_password(account, orig_pass, new_pass_1);
-	gaim_account_set_password(account, new_pass_1);
 }
 
 void
@@ -2033,12 +2032,14 @@
 	GaimPluginProtocolInfo *prpl_info = NULL;
 	GaimConnection *gc = gaim_account_get_connection(account);
 
+	gaim_account_set_password(account, new_pw);
+
 	if (gc != NULL && gc->prpl != NULL)
 		prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl);
 
 	if (prpl_info && g_list_find(gaim_connections_get_all(), gc) && prpl_info->change_passwd)
 		prpl_info->change_passwd(gc, orig_pw, new_pw);
-}	
+}
 
 void
 gaim_accounts_add(GaimAccount *account)
--- a/src/gtkaccount.c	Sat Nov 05 20:45:35 2005 +0000
+++ b/src/gtkaccount.c	Sat Nov 05 21:49:44 2005 +0000
@@ -1468,7 +1468,13 @@
 	/* Password */
 	value = gtk_entry_get_text(GTK_ENTRY(dialog->password_entry));
 
-	if (gaim_account_get_remember_password(account) && *value != '\0')
+	/*
+	 * We set the password if this is a new account because new accounts
+	 * will be set to online, and if the user has entered a password into
+	 * the account editor (but has not checked the 'save' box), then we
+	 * don't want to prompt them.
+	 */
+	if ((gaim_account_get_remember_password(account) || new) && (*value != '\0'))
 		gaim_account_set_password(account, value);
 	else
 		gaim_account_set_password(account, NULL);
@@ -1604,7 +1610,6 @@
 	else
 		gaim_signal_emit(gaim_gtk_account_get_handle(), "account-modified", account);
 
-	/* TODO: This doesn't work quite right yet. */
 	if (new) {
 		const char *current_savedstatus_name;
 		const GaimSavedStatus *saved_status;
@@ -1612,20 +1617,6 @@
 		current_savedstatus_name = gaim_prefs_get_string("/core/status/current");
 		saved_status = gaim_savedstatus_find(current_savedstatus_name);
 		gaim_savedstatus_activate_for_account(saved_status, account);
-
-/*
-		This is the old way.  The new way is an improvement.
-		GaimGtkBuddyList *gtkblist;
-		GtkGaimStatusBox *status_box;
-		char *status_type_id;
-
-		gtkblist = GAIM_GTK_BLIST(gaim_get_blist());
-		status_box = GTK_GAIM_STATUS_BOX(gtkblist->statusbox);
-
-		status_type_id = gtk_gaim_status_box_get_active_type(status_box);
-		gaim_presence_set_status_active(account->presence, status_type_id, TRUE);
-		g_free(status_type_id);
-*/
 	}
 
 	return account;
--- a/src/gtkprefs.c	Sat Nov 05 20:45:35 2005 +0000
+++ b/src/gtkprefs.c	Sat Nov 05 21:49:44 2005 +0000
@@ -1695,7 +1695,10 @@
 	/*
 	 * TODO: Need to allow users to choose a GaimSavedStatus
 	 *       to use when going idle-away.  Or figure out a
-	 *       better UI for this.
+	 *       better UI for this.  Set the preference
+	 *       "/core/status/idleaway" to the name of the
+	 *       GaimSavedStatus to use.
+	 *
 	 */
 
 	if (!gaim_prefs_get_bool("/core/away/away_when_idle")) {
--- a/src/protocols/yahoo/yahoo.c	Sat Nov 05 20:45:35 2005 +0000
+++ b/src/protocols/yahoo/yahoo.c	Sat Nov 05 21:49:44 2005 +0000
@@ -3087,9 +3087,6 @@
 	if (!gaim_status_is_active(status))
 		return;
 
-	if (!gaim_account_is_connected(account))
-		return;
-
 	gc = gaim_account_get_connection(account);
 	presence = gaim_status_get_presence(status);
 	yd = (struct yahoo_data *)gc->proto_data;