Commit 4d599687 authored by Philipp Hörist's avatar Philipp Hörist

Interface: Set resource on account creation

Otherwise the resource is changed on first connect which can trigger
the relogin check in the Accounts Dialog
parent fdd15e44
......@@ -1567,11 +1567,9 @@ def get_resource(account):
if not resource:
return None
rand = ''.join(random.choice(
string.ascii_uppercase + string.digits) for _ in range(8))
resource = Template(resource).safe_substitute(
{'hostname': socket.gethostname(),
'rand': rand})
'rand': get_random_string()})
app.config.set_per('accounts', account, 'resource', resource)
return resource
......
......@@ -1666,6 +1666,7 @@ class Interface:
config = {}
config['active'] = False
config['name'] = username
config['resource'] = 'gajim.%s' % helpers.get_random_string(8)
config['account_label'] = '%s@%s' % (username, domain)
config['hostname'] = domain
config['savepass'] = True
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment