diff --git a/src/common/config.py b/src/common/config.py index 6c53383f6..8aaf2b4c3 100644 --- a/src/common/config.py +++ b/src/common/config.py @@ -108,6 +108,8 @@ class Config: 'use_proxy': [ opt_bool, False ], 'proxyhost': [ opt_str, '' ], 'proxyport': [ opt_int, 3128 ], + 'proxyuser': [ opt_str, '' ], + 'proxypass': [ opt_str, '' ], 'keyid': [ opt_str, '' ], 'keyname': [ opt_str, '' ], 'usetls': [ opt_bool, True ], diff --git a/src/common/connection.py b/src/common/connection.py index fd1a7e0c6..d8f9fdcf5 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -512,10 +512,14 @@ class Connection: return self.connection self.connected = 1 if gajim.config.get_per('accounts', self.name, 'use_proxy'): - proxy = {'host': gajim.config.get_per('accounts', self.name, \ + proxy = {'host': gajim.config.get_per('accounts', self.name, 'proxyhost')} - proxy['port'] = gajim.config.get_per('accounts', self.name, \ + proxy['port'] = gajim.config.get_per('accounts', self.name, 'proxyport') + proxy['user'] = gajim.config.get_per('accounts', self.name, + 'proxyuser') + proxy['password'] = gajim.config.get_per('accounts', self.name, + 'proxypass') else: proxy = None if gajim.config.get('verbose'): @@ -764,7 +768,8 @@ class Connection: if self.connection: return if config['use_proxy']: - proxy = {'host': config['proxyhost'], 'port': config['proxyport']} + proxy = {'host': config['proxyhost'], 'port': config['proxyport'], + 'user': config['proxyuser'], 'password': config['proxypass']} else: proxy = None c = common.xmpp.Client(server = config['hostname'], debug = []) diff --git a/src/config.py b/src/config.py index ef0ac1c6d..b3e9e76eb 100644 --- a/src/config.py +++ b/src/config.py @@ -979,8 +979,18 @@ class Account_modification_window: 'proxyhost')) entry = self.xml.get_widget('proxyport_entry') entry.set_sensitive(use_proxy) - entry.set_text(str(gajim.config.get_per('accounts', - self.account, 'proxyport'))) + entry.set_text(gajim.config.get_per('accounts', self.account, + 'proxyport')) + + entry = self.xml.get_widget('proxyuser_entry') + entry.set_sensitive(use_proxy) + entry.set_text(gajim.config.get_per('accounts', self.account, + 'proxyuser')) + + entry = self.xml.get_widget('proxypass_entry') + entry.set_sensitive(use_proxy) + entry.set_text(gajim.config.get_per('accounts', self.account, + 'proxypass'))) usetls = gajim.config.get_per('accounts', self.account, 'usetls') self.xml.get_widget('use_tls_checkbutton').set_active(usetls) @@ -1051,6 +1061,8 @@ class Account_modification_window: get_active() config['proxyhost'] = self.xml.get_widget('proxyhost_entry').get_text() config['proxyport'] = self.xml.get_widget('proxyport_entry').get_text() + config['proxyuser'] = self.xml.get_widget('proxyuser_entry').get_text() + config['proxypass'] = self.xml.get_widget('proxypass_entry').get_text() if config['use_proxy']: if config['proxyport'] != '': try: