changeset 20039:1846fd2da2b4

Fix proxy settings to be loaded correctly when libpurple is initialized. This was broken because it relied on the prefs being loaded after proxy initialization so that the pref callbacks would be triggered and I changed the prefs loading to happen right at the beginning to fix other issues. Fixes #3092.
author Daniel Atallah <daniel.atallah@gmail.com>
date Fri, 14 Sep 2007 17:55:05 +0000
parents 1691f4c9b6a8
children b34d0ba5e225
files libpurple/proxy.c pidgin/gtkprefs.c
diffstat 2 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/proxy.c	Fri Sep 14 15:39:51 2007 +0000
+++ b/libpurple/proxy.c	Fri Sep 14 17:55:05 2007 +0000
@@ -400,7 +400,7 @@
  	 */
 	if (!PURPLE_PROXY_CONNECT_DATA_IS_VALID(connect_data))
 		return;
-	
+
 	purple_debug_info("proxy", "Connected to %s:%d.\n",
 					connect_data->host, connect_data->port);
 
@@ -1992,6 +1992,13 @@
 		proxy_pref_cb, NULL);
 	purple_prefs_connect_callback(handle, "/purple/proxy/password",
 		proxy_pref_cb, NULL);
+
+	/* Load the initial proxy settings */
+	proxy_pref_cb("/purple/proxy/type", PURPLE_PREF_STRING, purple_prefs_get_string("/purple/proxy/type"), NULL);
+	proxy_pref_cb("/purple/proxy/host", PURPLE_PREF_STRING, purple_prefs_get_string("/purple/proxy/host"), NULL);
+	proxy_pref_cb("/purple/proxy/port", PURPLE_PREF_STRING, GINT_TO_POINTER(purple_prefs_get_int("/purple/proxy/port")), NULL);
+	proxy_pref_cb("/purple/proxy/username", PURPLE_PREF_STRING, purple_prefs_get_string("/purple/proxy/username"), NULL);
+	proxy_pref_cb("/purple/proxy/password", PURPLE_PREF_STRING, purple_prefs_get_string("/purple/proxy/password"), NULL);
 }
 
 void
--- a/pidgin/gtkprefs.c	Fri Sep 14 15:39:51 2007 +0000
+++ b/pidgin/gtkprefs.c	Fri Sep 14 17:55:05 2007 +0000
@@ -1093,7 +1093,7 @@
 	const char *proxy = value;
 
 	if (strcmp(proxy, "none") && strcmp(proxy, "envvar"))
-	        gtk_widget_show_all(frame);
+		gtk_widget_show_all(frame);
 	else
 		gtk_widget_hide(frame);
 }