Skip to content
Snippets Groups Projects
Commit b28b3d4e authored by Yann Leboulanger's avatar Yann Leboulanger
Browse files

add a Tor proxy in default configuration when Gajim starts. Fixes #7026

parent 55d48e0d
No related branches found
No related tags found
No related merge requests found
...@@ -519,6 +519,10 @@ class Config: ...@@ -519,6 +519,10 @@ class Config:
} }
proxies_default = {
_('Tor'): ['socks5', 'localhost', 9050],
}
def foreach(self, cb, data = None): def foreach(self, cb, data = None):
for opt in self.__options: for opt in self.__options:
cb(data, opt, None, self.__options[opt]) cb(data, opt, None, self.__options[opt])
......
...@@ -2651,6 +2651,18 @@ class Interface: ...@@ -2651,6 +2651,18 @@ class Interface:
for o in d: for o in d:
gajim.config.set_per('themes', theme_name, o, gajim.config.set_per('themes', theme_name, o,
theme[d.index(o)]) theme[d.index(o)])
# Add Tor proxy if there is not in the config
if len(gajim.config.get_per('proxies')) == 0:
default = gajim.config.proxies_default
for proxy in default:
gajim.config.add_per('proxies', proxy)
gajim.config.set_per('proxies', proxy, 'type',
default[proxy][0])
gajim.config.set_per('proxies', proxy, 'host',
default[proxy][1])
gajim.config.set_per('proxies', proxy, 'port',
default[proxy][2])
gajim.idlequeue = idlequeue.get_idlequeue() gajim.idlequeue = idlequeue.get_idlequeue()
# resolve and keep current record of resolved hosts # resolve and keep current record of resolved hosts
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment