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,6 +78,7 @@ 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.
if self.server_resource:
self.server_resource = Template(self.server_resource).safe_substitute({ self.server_resource = Template(self.server_resource).safe_substitute({
'hostname': socket.gethostname() 'hostname': socket.gethostname()
}) })