From da5a8aa8d392da4ca2c94e13508ad577fdeed5d7 Mon Sep 17 00:00:00 2001 From: "louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13" Date: Tue, 16 Feb 2010 13:37:08 +0000 Subject: fixed #1151 --- data/default_config.cfg | 9 +++++++++ src/connection.py | 10 +++++++++- src/gui.py | 5 ++--- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/data/default_config.cfg b/data/default_config.cfg index d4fe45a0..acb2c8b0 100644 --- a/data/default_config.cfg +++ b/data/default_config.cfg @@ -14,6 +14,15 @@ default_nick = poezio # the rooms you will join automatically on startup, with associated nickname or not rooms = poezio@conference.codingteam.net:discussion@kikoo.louiz.org +# PROXY +# set to true if you want to use an http proxy server +# if false, no proxy will be used and the proxy_* settings have no effect +use_proxy = true +proxy_server = +proxy_port = +proxy_user = +proxy_password = + # the completion type you will use to complete nicknames # if "normal", complete the entire name to the first available completion # and then cycle through the possible completion with the next TABs diff --git a/src/connection.py b/src/connection.py index 0e26f008..1876cdb6 100644 --- a/src/connection.py +++ b/src/connection.py @@ -60,7 +60,15 @@ class Connection(threading.Thread): def connect_to_server(self, server, port): # TODO proxy stuff - return self.client.connect((server, port)) + if config.get('use_proxy','false') == 'true': + return self.client.connect((server, port), + {'host': config.get("proxy_server", ""), + 'port': config.get("proxy_port", 1080), + 'user': config.get("proxy_user", ""), + 'password': config.get("proxy_password", "") + }) + else: + return self.client.connect((server, port)) def authenticate(self, anon=True): if anon: diff --git a/src/gui.py b/src/gui.py index ff146c9c..1ef00785 100644 --- a/src/gui.py +++ b/src/gui.py @@ -203,11 +203,10 @@ class Gui(object): 'away': (self.command_away, _('Usage: /away [message]\nAway: Sets your availability to away and (optional) sets your status message. This is equivalent to "/show away [message]"')), 'busy': (self.command_busy, _('Usage: /busy [message]\nBusy: Sets your availability to busy and (optional) sets your status message. This is equivalent to "/show busy [message]"')), 'avail': (self.command_avail, _('Usage: /avail [message]\nAvail: Sets your availability to available and (optional) sets your status message. This is equivalent to "/show available [message]"')), - 'available': (self.command_avail, _('Usage: /available [message]\nAvailable: Sets your availability to available and (optional) sets your status message. This is equivalent to "/show available [message]"')), - 'bookmark': (self.command_bookmark, _('Usage: /bookmark [roomname][/nick]\nBookmark: Bookmark the specified room (you will then auto-join it on each poezio start). This commands uses the same syntaxe as /join. Type /help join for syntaxe examples. Note that when typing "/bookmark" on its own, the room will be bookmarked with the nickname you\'re currently using in this room (instead of default_nick)')), + 'available': (self.command_avail, _('Usage: /available [message]\nAvailable: Sets your availability to available and (optional) sets your status message. This is equivalent to "/show available [message]"')), + 'bookmark': (self.command_bookmark, _('Usage: /bookmark [roomname][/nick]\nBookmark: Bookmark the specified room (you will then auto-join it on each poezio start). This commands uses the same syntaxe as /join. Type /help join for syntaxe examples. Note that when typing "/bookmark" on its own, the room will be bookmarked with the nickname you\'re currently using in this room (instead of default_nick)')), 'set': (self.command_set, _('Usage: /set