Don't migrate the old autoaccept pref if the new one already exists.

Mon, 27 Feb 2012 23:07:49 +0000

author
Elliott Sales de Andrade <qulogic@pidgin.im>
date
Mon, 27 Feb 2012 23:07:49 +0000
changeset 32953
1edfa83f6ff8
parent 32952
94436ffcd42c
child 32954
9f8f08dd5b53
child 33132
24afd2b22579
child 34101
9c3c6a138135

Don't migrate the old autoaccept pref if the new one already exists.
Otherwise, we would clobber the existing pref if it doesn't match
the old pref.

Fixes #14964.

ChangeLog file | annotate | diff | comparison | revisions
libpurple/plugins/autoaccept.c file | annotate | diff | comparison | revisions
--- a/ChangeLog	Mon Feb 27 22:45:47 2012 +0000
+++ b/ChangeLog	Mon Feb 27 23:07:49 2012 +0000
@@ -74,6 +74,10 @@
 	Windows-Specific Changes:
 	* Fix compilation of the Bonjour protocol plugin. (#14802)
 
+	Plugins:
+	* The autoaccept plugin will no longer reset the preference for unknown
+	  buddies to "Auto Reject" in certain cases. (#14964)
+
 version 2.10.1 (12/06/2011):
 	Finch:
 	* Fix compilation on OpenBSD.
--- a/libpurple/plugins/autoaccept.c	Mon Feb 27 22:45:47 2012 +0000
+++ b/libpurple/plugins/autoaccept.c	Mon Feb 27 23:07:49 2012 +0000
@@ -238,8 +238,12 @@
 	 *       between old libpurple clients and new libpurple clients.
 	 *                                             --Mark Doliner, 2011-01-03
 	 */
-	if(purple_prefs_get_bool(PREF_STRANGER_OLD))
-		purple_prefs_set_int(PREF_STRANGER, FT_REJECT);
+	if (!purple_prefs_exists(PREF_STRANGER)) {
+		if (purple_prefs_get_bool(PREF_STRANGER_OLD))
+			purple_prefs_add_int(PREF_STRANGER, FT_REJECT);
+		else
+			purple_prefs_set_int(PREF_STRANGER, FT_ASK);
+	}
 
 	purple_signal_connect(purple_xfers_get_handle(), "file-recv-request", plugin,
 						PURPLE_CALLBACK(file_recv_request_cb), plugin);
@@ -345,7 +349,6 @@
 	dirname = g_build_filename(purple_user_dir(), "autoaccept", NULL);
 	purple_prefs_add_none(PREF_PREFIX);
 	purple_prefs_add_string(PREF_PATH, dirname);
-	purple_prefs_add_int(PREF_STRANGER, FT_ASK);
 	purple_prefs_add_bool(PREF_NOTIFY, TRUE);
 	purple_prefs_add_bool(PREF_NEWDIR, TRUE);
 	purple_prefs_add_bool(PREF_ESCAPE, TRUE);

mercurial