substitute $hostname in resource by hostname of the machine. fixes #3060
This commit is contained in:
parent
090218e780
commit
113586a0db
1 changed files with 6 additions and 1 deletions
|
@ -17,9 +17,9 @@
|
||||||
## GNU General Public License for more details.
|
## GNU General Public License for more details.
|
||||||
##
|
##
|
||||||
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import random
|
import random
|
||||||
|
import socket
|
||||||
|
|
||||||
try:
|
try:
|
||||||
randomsource = random.SystemRandom()
|
randomsource = random.SystemRandom()
|
||||||
|
@ -42,6 +42,7 @@ USE_GPG = GnuPG.USE_GPG
|
||||||
|
|
||||||
from common.rst_xhtml_generator import create_xhtml
|
from common.rst_xhtml_generator import create_xhtml
|
||||||
|
|
||||||
|
from string import Template
|
||||||
import logging
|
import logging
|
||||||
log = logging.getLogger('gajim.c.connection')
|
log = logging.getLogger('gajim.c.connection')
|
||||||
|
|
||||||
|
@ -76,6 +77,10 @@ class Connection(ConnectionHandlers):
|
||||||
self.last_history_line = {}
|
self.last_history_line = {}
|
||||||
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.
|
||||||
|
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:
|
||||||
|
|
Loading…
Add table
Reference in a new issue