pidgin: f9ed9968: Add a new proxy type of "Tor". This is r...

datallah at pidgin.im datallah at pidgin.im
Tue Apr 19 01:12:14 EDT 2011


----------------------------------------------------------------------
Revision: f9ed9968030c167eb2a7d562c69b04efbe00ca5d
Parent:   6106a0d6c961b176044f0fc7e8e1c8f93476c4d3
Author:   datallah at pidgin.im
Date:     04/19/11 00:41:59
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/f9ed9968030c167eb2a7d562c69b04efbe00ca5d

Changelog: 

Add a new proxy type of "Tor". This is really just a SOCKS5 proxy, but can be
used to restrict functionality (e.g. DNS lookups) for privacy reasons.

Refs #11110

Changes against parent 6106a0d6c961b176044f0fc7e8e1c8f93476c4d3

  patched  libpurple/account.c
  patched  libpurple/proxy.c
  patched  libpurple/proxy.h
  patched  pidgin/gtkaccount.c
  patched  pidgin/gtkprefs.c

-------------- next part --------------
============================================================
--- libpurple/proxy.c	1197144134979db3dab0964a4cff13f144650141
+++ libpurple/proxy.c	cd7f69a4fa40b265b853aeb94236d26868994e4d
@@ -2137,6 +2137,7 @@ static void try_connect(PurpleProxyConne
 			break;
 
 		case PURPLE_PROXY_SOCKS5:
+		case PURPLE_PROXY_TOR:
 			proxy_connect_socks5(connect_data, addr, addrlen);
 			break;
 
@@ -2299,6 +2300,7 @@ purple_proxy_connect(void *handle, Purpl
 		case PURPLE_PROXY_HTTP:
 		case PURPLE_PROXY_SOCKS4:
 		case PURPLE_PROXY_SOCKS5:
+		case PURPLE_PROXY_TOR:
 		case PURPLE_PROXY_USE_ENVVAR:
 			connecthost = purple_proxy_info_get_host(connect_data->gpi);
 			connectport = purple_proxy_info_get_port(connect_data->gpi);
@@ -2365,6 +2367,7 @@ purple_proxy_connect_udp(void *handle, P
 		case PURPLE_PROXY_HTTP:
 		case PURPLE_PROXY_SOCKS4:
 		case PURPLE_PROXY_SOCKS5:
+		case PURPLE_PROXY_TOR:
 		case PURPLE_PROXY_USE_ENVVAR:
 			purple_debug_info("proxy", "Ignoring Proxy type (%d) for UDP.\n",
 			                  purple_proxy_info_get_type(connect_data->gpi));
@@ -2470,6 +2473,8 @@ proxy_pref_cb(const char *name, PurplePr
 			proxytype = PURPLE_PROXY_SOCKS4;
 		else if (purple_strequal(type, "socks5"))
 			proxytype = PURPLE_PROXY_SOCKS5;
+		else if (purple_strequal(type, "tor"))
+			proxytype = PURPLE_PROXY_TOR;
 		else if (purple_strequal(type, "envvar"))
 			proxytype = PURPLE_PROXY_USE_ENVVAR;
 		else
============================================================
--- libpurple/proxy.h	a82a819d623ff893bd273b9d6a717c948fc0e896
+++ libpurple/proxy.h	4a8c88eb338d336a593479cd387bbfb93f862b86
@@ -39,7 +39,8 @@ typedef enum
 	PURPLE_PROXY_HTTP,             /**< HTTP proxy.                       */
 	PURPLE_PROXY_SOCKS4,           /**< SOCKS 4 proxy.                    */
 	PURPLE_PROXY_SOCKS5,           /**< SOCKS 5 proxy.                    */
-	PURPLE_PROXY_USE_ENVVAR        /**< Use environmental settings.       */
+	PURPLE_PROXY_USE_ENVVAR,       /**< Use environmental settings.       */
+	PURPLE_PROXY_TOR               /**< Use a Tor proxy (SOCKS 5 really)  */
 
 } PurpleProxyType;
 
============================================================
--- pidgin/gtkprefs.c	0c5c84d96b4716aeb51f83beabbf3cca2baeba48
+++ pidgin/gtkprefs.c	336216e3be94522ef88dece834f067410c057497
@@ -2041,9 +2041,10 @@ proxy_page(void)
 		pidgin_prefs_dropdown(prefs_proxy_frame, _("Proxy t_ype:"), PURPLE_PREF_STRING,
 					"/purple/proxy/type",
 					_("No proxy"), "none",
-					"SOCKS 4", "socks4",
-					"SOCKS 5", "socks5",
-					"HTTP", "http",
+					_("SOCKS 4"), "socks4",
+					_("SOCKS 5"), "socks5",
+					_("Tor/Privacy (SOCKS5)"), "tor",
+					_("HTTP"), "http",
 					_("Use Environmental Settings"), "envvar",
 					NULL);
 		gtk_box_pack_start(GTK_BOX(prefs_proxy_frame), prefs_proxy_subframe, 0, 0, 0);
============================================================
--- libpurple/account.c	444095e1f94ee7b6669e00a53beefdc7daf2eb16
+++ libpurple/account.c	225d714d249dc7765a130fc18164aafc44788870
@@ -294,6 +294,7 @@ proxy_settings_to_xmlnode(PurpleProxyInf
 			 proxy_type == PURPLE_PROXY_HTTP       ? "http"   :
 			 proxy_type == PURPLE_PROXY_SOCKS4     ? "socks4" :
 			 proxy_type == PURPLE_PROXY_SOCKS5     ? "socks5" :
+			 proxy_type == PURPLE_PROXY_TOR        ? "tor" :
 			 proxy_type == PURPLE_PROXY_USE_ENVVAR ? "envvar" : "unknown"), -1);
 
 	if ((value = purple_proxy_info_get_host(proxy_info)) != NULL)
@@ -746,6 +747,8 @@ parse_proxy_info(xmlnode *node, PurpleAc
 			purple_proxy_info_set_type(proxy_info, PURPLE_PROXY_SOCKS4);
 		else if (purple_strequal(data, "socks5"))
 			purple_proxy_info_set_type(proxy_info, PURPLE_PROXY_SOCKS5);
+		else if (purple_strequal(data, "tor"))
+			purple_proxy_info_set_type(proxy_info, PURPLE_PROXY_TOR);
 		else if (purple_strequal(data, "envvar"))
 			purple_proxy_info_set_type(proxy_info, PURPLE_PROXY_USE_ENVVAR);
 		else
============================================================
--- pidgin/gtkaccount.c	20f43b6c2ebe78b0d0847448fc4d8c7271377b03
+++ pidgin/gtkaccount.c	a0e5c12d7c4b1416065714892b868cafd7e4bc7d
@@ -1021,6 +1021,12 @@ make_proxy_dropdown(void)
 
 	gtk_list_store_append(model, &iter);
 	gtk_list_store_set(model, &iter,
+			0, _("Tor/Privacy (SOCKS5)"),
+			1, PURPLE_PROXY_TOR,
+			-1);
+
+	gtk_list_store_append(model, &iter);
+	gtk_list_store_set(model, &iter,
 			0, _("Use Environmental Settings"),
 			1, PURPLE_PROXY_USE_ENVVAR,
 			-1);
@@ -2254,7 +2260,7 @@ create_accounts_list(AccountsWindow *dia
 					 G_CALLBACK(account_treeview_double_click_cb), dialog);
 
 	gtk_notebook_append_page(GTK_NOTEBOOK(accounts_window->notebook),
-		pidgin_make_scrollable(treeview, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC, GTK_SHADOW_NONE, -1, -1), 
+		pidgin_make_scrollable(treeview, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC, GTK_SHADOW_NONE, -1, -1),
 		NULL);
 
 	add_columns(treeview, dialog);


More information about the Commits mailing list