soc.2008.masterpassword: 07e9ea60: Replace one hack with another. Maybe we ...

qulogic at pidgin.im qulogic at pidgin.im
Mon Nov 7 02:36:53 EST 2011


----------------------------------------------------------------------
Revision: 07e9ea60e4b9124098c82185ef98aafddd92756a
Parent:   292c593609737996edee90d66f21f0c6b1746388
Author:   qulogic at pidgin.im
Date:     11/06/11 01:15:18
Branch:   im.pidgin.soc.2008.masterpassword
URL: http://d.pidgin.im/viewmtn/revision/info/07e9ea60e4b9124098c82185ef98aafddd92756a

Changelog: 

Replace one hack with another. Maybe we want to think about something
more concrete for scheduling an account save, or maybe just refactor
some other stuff, but for now this hack doesn't make a GLib assert.

Changes against parent 292c593609737996edee90d66f21f0c6b1746388

  patched  libpurple/account.c
  patched  libpurple/keyring.c

-------------- next part --------------
============================================================
--- libpurple/account.c	a0981e2377f56fbd3fd254c8d6c9834f7842df0f
+++ libpurple/account.c	d74585bace6f695abde4620852e5dbbfdc097c5f
@@ -42,7 +42,6 @@
 #include "util.h"
 #include "xmlnode.h"
 
-
 /* TODO: Should use PurpleValue instead of this?  What about "ui"? */
 typedef struct
 {
@@ -1742,17 +1741,12 @@ purple_account_set_password(PurpleAccoun
                             PurpleKeyringSaveCallback cb,
                             gpointer data)
 {
-	/**
-	 * This is so we can force an account sync by calling
-	 * it with account == NULL.
-	 */
-	schedule_accounts_save();
-
 	g_return_if_fail(account != NULL);
 
 	g_free(account->password);
+	account->password = g_strdup(password);
 
-	account->password = g_strdup(password);
+	schedule_accounts_save();
 
 	if (purple_account_get_remember_password(account) == FALSE) {
 
============================================================
--- libpurple/keyring.c	1e0f4600c5d9988fc2aa964f7673913e62339de5
+++ libpurple/keyring.c	c5d739fa3676c4fbdc84b6706ebc60d095a447bf
@@ -437,16 +437,16 @@ purple_keyring_set_inuse_check_error_cb(
 	}
 
 	/**
-	 * This is kind of hackish. It will schedule an account save,
-	 * and then return because account == NULL.
+	 * This is kind of hackish. It will schedule an account save.
+	 *
 	 * Another way to do this would be to expose the
 	 * schedule_accounts_save() function, but other such functions
 	 * are not exposed. So these was done for consistency.
 	 */
-	purple_account_set_password(NULL, NULL, NULL, NULL);
+	purple_account_set_remember_password(account,
+		purple_account_get_remember_password(account));
 }
 
-
 static void
 purple_keyring_set_inuse_got_pw_cb(PurpleAccount *account,
                                    const gchar *password,


More information about the Commits mailing list