get_hostname_from_account(account_name) saves the day [yet another helper to make our lifes better :)]
This commit is contained in:
parent
3428a8655e
commit
5321cbc636
2 changed files with 10 additions and 4 deletions
|
@ -189,3 +189,11 @@ def get_jid_from_account(account_name):
|
||||||
hostname = config.get_per('accounts', account_name, 'hostname')
|
hostname = config.get_per('accounts', account_name, 'hostname')
|
||||||
jid = name + '@' + hostname
|
jid = name + '@' + hostname
|
||||||
return jid
|
return jid
|
||||||
|
|
||||||
|
def get_hostname_from_account(account_name):
|
||||||
|
'''returns hostname (if custom hostname is used, that is returned)'''
|
||||||
|
hostname = config.get_per('accounts', account_name, 'custom_host')
|
||||||
|
if hostname == '':
|
||||||
|
hostname = config.get_per('accounts', account_name, 'hostname')
|
||||||
|
return hostname
|
||||||
|
|
||||||
|
|
|
@ -1694,8 +1694,7 @@ class AccountsWindow:
|
||||||
model.clear()
|
model.clear()
|
||||||
for account in gajim.connections:
|
for account in gajim.connections:
|
||||||
iter = model.append()
|
iter = model.append()
|
||||||
model.set(iter, 0, account, 1, gajim.config.get_per('accounts',
|
model.set(iter, 0, account, 1, gajim.get_hostname_from_account(account))
|
||||||
account, 'hostname'))
|
|
||||||
|
|
||||||
def on_accounts_treeview_cursor_changed(self, widget):
|
def on_accounts_treeview_cursor_changed(self, widget):
|
||||||
'''Activate delete and modify buttons when a row is selected'''
|
'''Activate delete and modify buttons when a row is selected'''
|
||||||
|
@ -2076,8 +2075,7 @@ _('Without a connection, you can not browse available services')).get_response()
|
||||||
self.address_comboboxentry.set_model(liststore)
|
self.address_comboboxentry.set_model(liststore)
|
||||||
self.address_comboboxentry.set_text_column(0)
|
self.address_comboboxentry.set_text_column(0)
|
||||||
self.latest_addresses = gajim.config.get('latest_disco_addresses').split()
|
self.latest_addresses = gajim.config.get('latest_disco_addresses').split()
|
||||||
server_address = gajim.config.get_per('accounts', self.account,
|
server_address = gajim.get_hostname_from_account(self.account)
|
||||||
'hostname')
|
|
||||||
if server_address in self.latest_addresses:
|
if server_address in self.latest_addresses:
|
||||||
self.latest_addresses.remove(server_address)
|
self.latest_addresses.remove(server_address)
|
||||||
self.latest_addresses.insert(0, server_address)
|
self.latest_addresses.insert(0, server_address)
|
||||||
|
|
Loading…
Add table
Reference in a new issue