use templte on resource only if a resource is set. fix a TB

This commit is contained in:
Yann Leboulanger 2007-03-28 19:59:51 +00:00
parent c9f9c12c2c
commit 6ffe910185
1 changed files with 4 additions and 3 deletions

View File

@ -78,9 +78,10 @@ class Connection(ConnectionHandlers):
self.password = passwords.get_password(name) self.password = passwords.get_password(name)
self.server_resource = gajim.config.get_per('accounts', name, 'resource') self.server_resource = gajim.config.get_per('accounts', name, 'resource')
# All valid resource substitution strings should be added to this hash. # All valid resource substitution strings should be added to this hash.
self.server_resource = Template(self.server_resource).safe_substitute({ if self.server_resource:
'hostname': socket.gethostname() self.server_resource = Template(self.server_resource).safe_substitute({
}) 'hostname': socket.gethostname()
})
if gajim.config.get_per('accounts', self.name, 'keep_alives_enabled'): if gajim.config.get_per('accounts', self.name, 'keep_alives_enabled'):
self.keepalives = gajim.config.get_per('accounts', self.name,'keep_alive_every_foo_secs') self.keepalives = gajim.config.get_per('accounts', self.name,'keep_alive_every_foo_secs')
else: else: