Ejemplo n.º 1
0
def get_hostname_from_account(account_name, use_srv=False):
    """returns hostname (if custom hostname is used, that is returned)"""
    if use_srv and connections[account_name].connected_hostname:
        return connections[account_name].connected_hostname
    if config.get_per("accounts", account_name, "use_custom_host"):
        return config.get_per("accounts", account_name, "custom_host")
    return config.get_per("accounts", account_name, "hostname")
Ejemplo n.º 2
0
def get_hostname_from_account(account_name, use_srv=False):
    '''returns hostname (if custom hostname is used, that is returned)'''
    if use_srv and connections[account_name].connected_hostname:
        return connections[account_name].connected_hostname
    if config.get_per('accounts', account_name, 'use_custom_host'):
        return config.get_per('accounts', account_name, 'custom_host')
    return config.get_per('accounts', account_name, 'hostname')
Ejemplo n.º 3
0
def get_hostname_from_account(account_name, use_srv = False):
	'''returns hostname (if custom hostname is used, that is returned)'''
	if use_srv and connections[account_name].connected_hostname:
		return connections[account_name].connected_hostname
	if config.get_per('accounts', account_name, 'use_custom_host'):
		return config.get_per('accounts', account_name, 'custom_host')
	return config.get_per('accounts', account_name, 'hostname')
Ejemplo n.º 4
0
def get_jid_from_account(account_name):
    """
    Return the jid we use in the given account
    """
    name = config.get_per('accounts', account_name, 'name')
    hostname = config.get_per('accounts', account_name, 'hostname')
    jid = name + '@' + hostname
    return jid
Ejemplo n.º 5
0
def get_priority(account, show):
    '''return the priority an account must have'''
    if not show:
        show = 'online'

    if show in ('online', 'chat', 'away', 'xa', 'dnd', 'invisible') and \
    config.get_per('accounts', account, 'adjust_priority_with_status'):
        return config.get_per('accounts', account, 'autopriority_' + show)
    return config.get_per('accounts', account, 'priority')
Ejemplo n.º 6
0
def get_priority(account, show):
    """return the priority an account must have"""
    if not show:
        show = "online"

    if show in ("online", "chat", "away", "xa", "dnd", "invisible") and config.get_per(
        "accounts", account, "adjust_priority_with_status"
    ):
        return config.get_per("accounts", account, "autopriority_" + show)
    return config.get_per("accounts", account, "priority")
Ejemplo n.º 7
0
def get_priority(account, show):
    """
    Return the priority an account must have
    """
    if not show:
        show = 'online'

    if show in ('online', 'chat', 'away', 'xa', 'dnd', 'invisible') and \
    config.get_per('accounts', account, 'adjust_priority_with_status'):
        return config.get_per('accounts', account, 'autopriority_' + show)
    return config.get_per('accounts', account, 'priority')
Ejemplo n.º 8
0
def zeroconf_is_connected():
    return account_is_connected(ZEROCONF_ACC_NAME) and \
            config.get_per('accounts', ZEROCONF_ACC_NAME, 'is_zeroconf')
Ejemplo n.º 9
0
def get_jid_from_account(account_name):
    '''return the jid we use in the given account'''
    name = config.get_per('accounts', account_name, 'name')
    hostname = config.get_per('accounts', account_name, 'hostname')
    jid = name + '@' + hostname
    return jid
Ejemplo n.º 10
0
def zeroconf_is_connected():
    return account_is_connected(ZEROCONF_ACC_NAME) and \
     config.get_per('accounts', ZEROCONF_ACC_NAME, 'is_zeroconf')
Ejemplo n.º 11
0
def get_jid_from_account(account_name):
    """return the jid we use in the given account"""
    name = config.get_per("accounts", account_name, "name")
    hostname = config.get_per("accounts", account_name, "hostname")
    jid = name + "@" + hostname
    return jid
Ejemplo n.º 12
0
def zeroconf_is_connected():
    return account_is_connected(ZEROCONF_ACC_NAME) and config.get_per("accounts", ZEROCONF_ACC_NAME, "is_zeroconf")
Ejemplo n.º 13
0
def get_jid_from_account(account_name):
	name = config.get_per('accounts', account_name, 'name')
	hostname = config.get_per('accounts', account_name, 'hostname')
	jid = name + '@' + hostname
	return jid