Verified Commit f9734cde authored by mathieui's avatar mathieui

Remove the (sometimes wrong) default values in the config.get() calls

parent 7b01c62e
......@@ -23,7 +23,7 @@ def xml_iter(xml, tag=''):
else:
return xml.getiterator(tag)
preferred = config.get('use_bookmarks_method', 'pep').lower()
preferred = config.get('use_bookmarks_method').lower()
if preferred not in ('pep', 'privatexml'):
preferred = 'privatexml'
not_preferred = 'privatexml' if preferred == 'pep' else 'privatexml'
......@@ -155,8 +155,8 @@ def save_local():
def save(xmpp, core=None):
"""Save all the bookmarks."""
save_local()
if config.get('use_remote_bookmarks', True):
preferred = config.get('use_bookmarks_method', 'privatexml')
if config.get('use_remote_bookmarks'):
preferred = config.get('use_bookmarks_method')
if not save_remote(xmpp, method=preferred) and core:
core.information('Could not save bookmarks.', 'Error')
return False
......@@ -192,7 +192,7 @@ def get_remote(xmpp):
"""Add the remotely stored bookmarks to the list."""
if xmpp.anon:
return
method = config.get('use_bookmarks_method', '')
method = config.get('use_bookmarks_method')
if not method:
pep, privatexml = True, True
for method in methods[1:]:
......@@ -214,7 +214,7 @@ def get_remote(xmpp):
def get_local():
"""Add the locally stored bookmarks to the list."""
rooms = config.get('rooms', '')
rooms = config.get('rooms')
if not rooms:
return
rooms = rooms.split(':')
......
......@@ -133,7 +133,6 @@ DEFAULT_CONFIG = {
}
}
class Config(RawConfigParser):
"""
load/save the config to a file
......@@ -539,7 +538,7 @@ def create_global_config():
def check_create_log_dir():
"Create the poezio logging directory if it doesn’t exist"
global LOG_DIR
LOG_DIR = config.get('log_dir', '')
LOG_DIR = config.get('log_dir')
if not LOG_DIR:
......@@ -559,7 +558,7 @@ def check_create_log_dir():
def setup_logging():
"Change the logging config according to the cmdline options and config"
if config.get('log_errors', True):
if config.get('log_errors'):
LOGGING_CONFIG['root']['handlers'].append('error')
LOGGING_CONFIG['handlers']['error'] = {
'level': 'ERROR',
......
......@@ -29,28 +29,28 @@ class Connection(sleekxmpp.ClientXMPP):
"""
__init = False
def __init__(self):
resource = config.get('resource', '')
if config.get('jid', ''):
resource = config.get('resource')
if config.get('jid'):
# Field used to know if we are anonymous or not.
# many features will be handled differently
# depending on this setting
self.anon = False
jid = '%s' % config.get('jid', '')
jid = '%s' % config.get('jid')
if resource:
jid = '%s/%s'% (jid, resource)
password = config.get('password', '') or getpass.getpass()
password = config.get('password') or getpass.getpass()
else: # anonymous auth
self.anon = True
jid = config.get('server', 'anon.jeproteste.info')
jid = config.get('server')
if resource:
jid = '%s/%s' % (jid, resource)
password = None
jid = safeJID(jid)
# TODO: use the system language
sleekxmpp.ClientXMPP.__init__(self, jid, password,
lang=config.get('lang', 'en'))
lang=config.get('lang'))
force_encryption = config.get('force_encryption', True)
force_encryption = config.get('force_encryption')
if force_encryption:
self['feature_mechanisms'].unencrypted_plain = False
self['feature_mechanisms'].unencrypted_digest = False
......@@ -58,7 +58,7 @@ class Connection(sleekxmpp.ClientXMPP):
self['feature_mechanisms'].unencrypted_scram = False
self.core = None
self.auto_reconnect = config.get('auto_reconnect', False)
self.auto_reconnect = config.get('auto_reconnect')
self.reconnect_max_attempts = 0
self.auto_authorize = None
# prosody defaults, lowest is AES128-SHA, it should be a minimum
......@@ -66,9 +66,9 @@ class Connection(sleekxmpp.ClientXMPP):
self.ciphers = config.get('ciphers',
'HIGH+kEDH:HIGH+kEECDH:HIGH:!PSK'
':!SRP:!3DES:!aNULL')
self.ca_certs = config.get('ca_cert_path', '') or None
interval = config.get('whitespace_interval', '300')
if interval.isdecimal() and int(interval) > 0:
self.ca_certs = config.get('ca_cert_path') or None
interval = config.get('whitespace_interval')
if int(interval) > 0:
self.whitespace_keepalive_interval = int(interval)
else:
self.whitespace_keepalive_interval = 300
......@@ -90,34 +90,32 @@ class Connection(sleekxmpp.ClientXMPP):
# without a body
XEP_0184._filter_add_receipt_request = fixes._filter_add_receipt_request
self.register_plugin('xep_0184')
self.plugin['xep_0184'].auto_ack = config.get('ack_message_receipts',
True)
self.plugin['xep_0184'].auto_request = config.get(
'request_message_receipts', True)
self.plugin['xep_0184'].auto_ack = config.get('ack_message_receipts')
self.plugin['xep_0184'].auto_request = config.get('request_message_receipts')
self.register_plugin('xep_0191')
self.register_plugin('xep_0199')
self.set_keepalive_values()
if config.get('enable_user_tune', True):
if config.get('enable_user_tune'):
self.register_plugin('xep_0118')
if config.get('enable_user_nick', True):
if config.get('enable_user_nick'):
self.register_plugin('xep_0172')
if config.get('enable_user_mood', True):
if config.get('enable_user_mood'):
self.register_plugin('xep_0107')
if config.get('enable_user_activity', True):
if config.get('enable_user_activity'):
self.register_plugin('xep_0108')
if config.get('enable_user_gaming', True):
if config.get('enable_user_gaming'):
self.register_plugin('xep_0196')
if config.get('send_poezio_info', True):
if config.get('send_poezio_info'):
info = {'name':'poezio',
'version': options.version}
if config.get('send_os_info', True):
if config.get('send_os_info'):
info['os'] = common.get_os_info()
self.plugin['xep_0030'].set_identities(
identities=set([('client', 'pc', None, 'Poezio')]))
......@@ -126,7 +124,7 @@ class Connection(sleekxmpp.ClientXMPP):
self.plugin['xep_0030'].set_identities(
identities=set([('client', 'pc', None, '')]))
self.register_plugin('xep_0092', pconfig=info)
if config.get('send_time', True):
if config.get('send_time'):
self.register_plugin('xep_0202')
self.register_plugin('xep_0224')
self.register_plugin('xep_0249')
......@@ -141,8 +139,8 @@ class Connection(sleekxmpp.ClientXMPP):
is changed.
Unload and reload the ping plugin, with the new values.
"""
ping_interval = config.get('connection_check_interval', 60)
timeout_delay = config.get('connection_timeout_delay', 10)
ping_interval = config.get('connection_check_interval')
timeout_delay = config.get('connection_timeout_delay')
if timeout_delay <= 0:
# We help the stupid user (with a delay of 0, poezio will try to
# reconnect immediately because the timeout is immediately
......@@ -161,7 +159,7 @@ class Connection(sleekxmpp.ClientXMPP):
TODO: try multiple servers with anon auth.
"""
custom_host = config.get('custom_host', '')
custom_host = config.get('custom_host')
custom_port = config.get('custom_port', 5222)
if custom_port == -1:
custom_port = 5222
......
......@@ -369,7 +369,7 @@ def command_join(self, arg, histo_length=None):
room = room[1:]
current_status = self.get_status()
if not histo_length:
histo_length = config.get('muc_history_length', 20)
histo_length = config.get('muc_history_length')
if histo_length == -1:
histo_length = None
if histo_length is not None:
......@@ -473,7 +473,7 @@ def command_bookmark(self, arg=''):
/bookmark [room][/nick] [autojoin] [password]
"""
if not config.get('use_remote_bookmarks', True):
if not config.get('use_remote_bookmarks'):
self.command_bookmark_local(arg)
return
args = common.shell_split(arg)
......@@ -533,7 +533,7 @@ def command_bookmark(self, arg=''):
if not bm:
bm = bookmark.Bookmark(roomname)
bookmark.bookmarks.append(bm)
bm.method = config.get('use_bookmarks_method', 'pep')
bm.method = config.get('use_bookmarks_method')
if nick:
bm.nick = nick
if password:
......@@ -808,11 +808,11 @@ def command_quit(self, arg=''):
msg = arg
else:
msg = None
if config.get('enable_user_mood', True):
if config.get('enable_user_mood'):
self.xmpp.plugin['xep_0107'].stop(block=False)
if config.get('enable_user_activity', True):
if config.get('enable_user_activity'):
self.xmpp.plugin['xep_0108'].stop(block=False)
if config.get('enable_user_gaming', True):
if config.get('enable_user_gaming'):
self.xmpp.plugin['xep_0196'].stop(block=False)
self.save_config()
self.plugin_manager.disable_plugins()
......
......@@ -46,7 +46,7 @@ def completion_presence(self, the_input):
def completion_theme(self, the_input):
""" Completion for /theme"""
themes_dir = config.get('themes_dir', '')
themes_dir = config.get('themes_dir')
themes_dir = themes_dir or\
os.path.join(os.environ.get('XDG_DATA_HOME') or\
os.path.join(os.environ.get('HOME'), '.local', 'share'),
......@@ -190,7 +190,7 @@ def completion_bookmark(self, the_input):
tab = self.get_tab_by_name(jid.bare, tabs.MucTab)
nicks = [tab.own_nick] if tab else []
default = os.environ.get('USER') if os.environ.get('USER') else 'poezio'
nick = config.get('default_nick', '')
nick = config.get('default_nick')
if not nick:
if not default in nicks:
nicks.append(default)
......@@ -371,7 +371,7 @@ def completion_bookmark_local(self, the_input):
tab = self.get_tab_by_name(jid.bare, tabs.MucTab)
nicks = [tab.own_nick] if tab else []
default = os.environ.get('USER') if os.environ.get('USER') else 'poezio'
nick = config.get('default_nick', '')
nick = config.get('default_nick')
if not nick:
if not default in nicks:
nicks.append(default)
......
......@@ -64,10 +64,10 @@ class Core(object):
sys.excepthook = self.on_exception
self.connection_time = time.time()
self.stdscr = None
status = config.get('status', None)
status = config.get('status')
status = possible_show.get(status, None)
self.status = Status(show=status,
message=config.get('status_message', ''))
message=config.get('status_message'))
self.running = True
self.xmpp = singleton.Singleton(connection.Connection)
self.xmpp.core = self
......@@ -82,7 +82,7 @@ class Core(object):
# that are displayed in almost all tabs, in an
# information window.
self.information_buffer = TextBuffer()
self.information_win_size = config.get('info_win_height', 2, 'var')
self.information_win_size = config.get('info_win_height', section='var')
self.information_win = windows.TextWin(300)
self.information_buffer.add_window(self.information_win)
self.left_tab_win = None
......@@ -96,7 +96,7 @@ class Core(object):
self._current_tab_nb = 0
self.previous_tab_nb = 0
own_nick = config.get('default_nick', '')
own_nick = config.get('default_nick')
own_nick = own_nick or self.xmpp.boundjid.user
own_nick = own_nick or os.environ.get('USER')
own_nick = own_nick or 'poezio'
......@@ -119,7 +119,7 @@ class Core(object):
self.register_initial_commands()
# We are invisible
if not config.get('send_initial_presence', True):
if not config.get('send_initial_presence'):
del self.commands['status']
del self.commands['show']
......@@ -241,19 +241,19 @@ class Core(object):
connection.MatchAll(None),
self.incoming_stanza)
self.xmpp.register_handler(self.all_stanzas)
if config.get('enable_user_tune', True):
if config.get('enable_user_tune'):
self.xmpp.add_event_handler("user_tune_publish",
self.on_tune_event)
if config.get('enable_user_nick', True):
if config.get('enable_user_nick'):
self.xmpp.add_event_handler("user_nick_publish",
self.on_nick_received)
if config.get('enable_user_mood', True):
if config.get('enable_user_mood'):
self.xmpp.add_event_handler("user_mood_publish",
self.on_mood_event)
if config.get('enable_user_activity', True):
if config.get('enable_user_activity'):
self.xmpp.add_event_handler("user_activity_publish",
self.on_activity_event)
if config.get('enable_user_gaming', True):
if config.get('enable_user_gaming'):
self.xmpp.add_event_handler("user_gaming_publish",
self.on_gaming_event)
......@@ -342,13 +342,14 @@ class Core(object):
"""
Called when the request_message_receipts option changes
"""
self.xmpp.plugin['xep_0184'].auto_request = config.get(option, True)
self.xmpp.plugin['xep_0184'].auto_request = config.get(option,
default=True)
def on_ack_receipts_config_change(self, option, value):
"""
Called when the ack_message_receipts option changes
"""
self.xmpp.plugin['xep_0184'].auto_ack = config.get(option, True)
self.xmpp.plugin['xep_0184'].auto_ack = config.get(option, default=True)
def on_plugins_dir_config_change(self, option, value):
"""
......@@ -398,7 +399,7 @@ class Core(object):
old_section = old_config.get(section, {})
for option in config.options(section):
old_value = old_section.get(option)
new_value = config.get(option, "", section)
new_value = config.get(option, default="", section=section)
if new_value != old_value:
self.trigger_configuration_change(option, new_value)
log.debug("Config reloaded.")
......@@ -420,11 +421,11 @@ class Core(object):
}
log.error("%s received. Exiting…", signals[sig])
if config.get('enable_user_mood', True):
if config.get('enable_user_mood'):
self.xmpp.plugin['xep_0107'].stop(block=False)
if config.get('enable_user_activity', True):
if config.get('enable_user_activity'):
self.xmpp.plugin['xep_0108'].stop(block=False)
if config.get('enable_user_gaming', True):
if config.get('enable_user_gaming'):
self.xmpp.plugin['xep_0196'].stop(block=False)
self.plugin_manager.disable_plugins()
self.disconnect('')
......@@ -439,7 +440,7 @@ class Core(object):
"""
Load the plugins on startup.
"""
plugins = config.get('plugins_autoload', '')
plugins = config.get('plugins_autoload')
if ':' in plugins:
for plugin in plugins.split(':'):
self.plugin_manager.load(plugin)
......@@ -659,9 +660,9 @@ class Core(object):
work. If you try to do anything else, your |, [, <<, etc will be
interpreted as normal command arguments, not shell special tokens.
"""
if config.get('exec_remote', False):
if config.get('exec_remote'):
# We just write the command in the fifo
fifo_path = config.get('remote_fifo_path', './')
fifo_path = config.get('remote_fifo_path')
if not self.remote_fifo:
try:
self.remote_fifo = Fifo(os.path.join(fifo_path,
......@@ -755,7 +756,7 @@ class Core(object):
or to use it when joining a new muc)
"""
self.status = Status(show=pres, message=msg)
if config.get('save_status', True):
if config.get('save_status'):
ok = config.silent_set('status', pres if pres else '')
msg = msg.replace('\n', '|') if msg else ''
ok = ok and config.silent_set('status_message', msg)
......@@ -993,7 +994,7 @@ class Core(object):
return False
elif not self.tabs[old_pos]:
return False
if config.get('create_gaps', False):
if config.get('create_gaps'):
return self.insert_tab_gaps(old_pos, new_pos)
return self.insert_tab_nogaps(old_pos, new_pos)
......@@ -1237,7 +1238,7 @@ class Core(object):
if self.previous_tab_nb != nb:
self.current_tab_nb = self.previous_tab_nb
self.previous_tab_nb = 0
if config.get('create_gaps', False):
if config.get('create_gaps'):
if nb >= len(self.tabs) - 1:
self.tabs.remove(tab)
nb -= 1
......@@ -1288,7 +1289,7 @@ class Core(object):
"""
Displays an informational message in the "Info" buffer
"""
filter_messages = config.get('filter_info_messages', '').split(':')
filter_messages = config.get('filter_info_messages').split(':')
for words in filter_messages:
if words and words in msg:
log.debug('Did not show the message:\n\t%s> %s', typ, msg)
......@@ -1298,12 +1299,11 @@ class Core(object):
nb_lines = self.information_buffer.add_message(msg,
nickname=typ,
nick_color=color)
popup_on = config.get('information_buffer_popup_on',
'error roster warning help info').split()
popup_on = config.get('information_buffer_popup_on').split()
if isinstance(self.current_tab(), tabs.RosterInfoTab):
self.refresh_window()
elif typ != '' and typ.lower() in popup_on:
popup_time = config.get('popup_time', 4) + (nb_lines - 1) * 2
popup_time = config.get('popup_time') + (nb_lines - 1) * 2
self.pop_information_win_up(nb_lines, popup_time)
else:
if self.information_win_size != 0:
......@@ -1496,7 +1496,7 @@ class Core(object):
"""
Enable/disable the left panel.
"""
enabled = config.get('enable_vertical_tab_list', False)
enabled = config.get('enable_vertical_tab_list')
if not config.silent_set('enable_vertical_tab_list', str(not enabled)):
self.information(_('Unable to write in the config file'), 'Error')
self.call_for_resize()
......@@ -1523,14 +1523,14 @@ class Core(object):
"""
with g_lock:
height, width = self.stdscr.getmaxyx()
if config.get('enable_vertical_tab_list', False):
if config.get('enable_vertical_tab_list'):
if self.size.core_degrade_x:
return
try:
height, _ = self.stdscr.getmaxyx()
truncated_win = self.stdscr.subwin(height,
config.get('vertical_tab_list_size', 20),
config.get('vertical_tab_list_size'),
0, 0)
except:
log.error('Curses error on infobar resize', exc_info=True)
......@@ -1569,12 +1569,12 @@ class Core(object):
# on the left remaining space
with g_lock:
height, width = self.stdscr.getmaxyx()
if (config.get('enable_vertical_tab_list', False) and
if (config.get('enable_vertical_tab_list') and
not self.size.core_degrade_x):
with g_lock:
try:
scr = self.stdscr.subwin(0,
config.get('vertical_tab_list_size', 20))
config.get('vertical_tab_list_size'))
except:
log.error('Curses error on resize', exc_info=True)
return
......@@ -1585,7 +1585,7 @@ class Core(object):
self.resize_global_information_win()
with g_lock:
for tab in self.tabs:
if config.get('lazy_resize', True):
if config.get('lazy_resize'):
tab.need_resize = True
else:
tab.resize()
......@@ -1818,7 +1818,7 @@ class Core(object):
usage='<jid>',
shortdesc=_('List available ad-hoc commands on the given jid'))
if config.get('enable_user_activity', True):
if config.get('enable_user_activity'):
self.register_command('activity', self.command_activity,
usage='[<general> [specific] [text]]',
desc=_('Send your current activity to your contacts '
......@@ -1826,7 +1826,7 @@ class Core(object):
'"stop broadcasting an activity".'),
shortdesc=_('Send your activity.'),
completion=self.completion_activity)
if config.get('enable_user_mood', True):
if config.get('enable_user_mood'):
self.register_command('mood', self.command_mood,
usage='[<mood> [text]]',
desc=_('Send your current mood to your contacts '
......@@ -1834,7 +1834,7 @@ class Core(object):
'"stop broadcasting a mood".'),
shortdesc=_('Send your mood.'),
completion=self.completion_mood)
if config.get('enable_user_gaming', True):
if config.get('enable_user_gaming'):
self.register_command('gaming', self.command_gaming,
usage='[<game name> [server address]]',
desc=_('Send your current gaming activity to '
......@@ -1977,7 +1977,7 @@ def replace_key_with_bound(key):
Replace an inputted key with the one defined as its replacement
in the config
"""
bind = config.get(key, key, 'bindings')
bind = config.get(key, default=key, section='bindings')
if not bind:
bind = key
return bind
......
......@@ -44,7 +44,7 @@ def on_session_start_features(self, _):
features = iq['disco_info']['features']
rostertab = self.get_tab_by_name('Roster', tabs.RosterInfoTab)
rostertab.check_blocking(features)
if (config.get('enable_carbons', True) and
if (config.get('enable_carbons') and
'urn:xmpp:carbons:2' in features):
self.xmpp.plugin['xep_0280'].enable()
self.xmpp.add_event_handler('carbon_received', self.on_carbon_received)
......@@ -111,7 +111,7 @@ def on_groupchat_invitation(self, message):
if password:
msg += ". The password is \"%s\"." % password
self.information(msg, 'Info')
if 'invite' in config.get('beep_on', 'invite').split():
if 'invite' in config.get('beep_on').split():
curses.beep()
logger.log_roster_change(inviter.full, 'invited you to %s' % jid.full)
self.pending_invites[jid.bare] = inviter.full
......@@ -142,7 +142,7 @@ def on_groupchat_direct_invitation(self, message):
msg += "\nreason: %s" % reason
self.information(msg, 'Info')
if 'invite' in config.get('beep_on', 'invite').split():
if 'invite' in config.get('beep_on').split():
curses.beep()
self.pending_invites[room.bare] = inviter.full
......@@ -178,9 +178,9 @@ def on_normal_message(self, message):
elif message['type'] == 'headline' and message['body']:
return self.information('%s says: %s' % (message['from'], message['body']), 'Headline')
use_xhtml = config.get('enable_xhtml_im', True)
tmp_dir = config.get('tmp_image_dir', '') or path.join(CACHE_DIR, 'images')
extract_images = config.get('extract_inline_images', True)
use_xhtml = config.get('enable_xhtml_im')
tmp_dir = config.get('tmp_image_dir') or path.join(CACHE_DIR, 'images')
extract_images = config.get('extract_inline_images')
body = xhtml.get_body_from_message_stanza(message, use_xhtml=use_xhtml,
tmp_dir=tmp_dir,
extract_images=extract_images)
......@@ -197,7 +197,7 @@ def on_normal_message(self, message):
if conv_jid.bare in roster:
remote_nick = roster[conv_jid.bare].name
# check for a received nick
if not remote_nick and config.get('enable_user_nick', True):
if not remote_nick and config.get('enable_user_nick'):
if message.xml.find('{http://jabber.org/protocol/nick}nick') is not None:
remote_nick = message['nick']['nick']
if not remote_nick:
......@@ -259,7 +259,7 @@ def on_normal_message(self, message):
conversation.remote_wants_chatstates = True
else:
conversation.remote_wants_chatstates = False
if 'private' in config.get('beep_on', 'highlight private').split():
if 'private' in config.get('beep_on').split():
if not config.get_by_tabname('disable_beep', conv_jid.bare):
curses.beep()
if self.current_tab() is not conversation:
......@@ -447,9 +447,9 @@ def on_groupchat_message(self, message):
return
self.events.trigger('muc_msg', message, tab)
use_xhtml = config.get('enable_xhtml_im', True)
tmp_dir = config.get('tmp_image_dir', '') or path.join(CACHE_DIR, 'images')
extract_images = config.get('extract_inline_images', True)
use_xhtml = config.get('enable_xhtml_im')
tmp_dir = config.get('tmp_image_dir') or path.join(CACHE_DIR, 'images')
extract_images = config.get('extract_inline_images')
body = xhtml.get_body_from_message_stanza(message, use_xhtml=use_xhtml,
tmp_dir=tmp_dir,
extract_images=extract_images)
......@@ -487,7 +487,7 @@ def on_groupchat_message(self, message):
current.input.refresh()
self.doupdate()
if 'message' in config.get('beep_on', 'highlight private').split():
if 'message' in config.get('beep_on').split():
if (not config.get_by_tabname('disable_beep', room_from)
and self.own_nick != message['from'].resource):
curses.beep()
......@@ -508,9 +508,9 @@ def on_groupchat_private_message(self, message):
return self.on_groupchat_message(message)
room_from = jid.bare
use_xhtml = config.get('enable_xhtml_im', True)
tmp_dir = config.get('tmp_image_dir', '') or path.join(CACHE_DIR, 'images')
extract_images = config.get('extract_inline_images', True)
use_xhtml = config.get('enable_xhtml_im')
tmp_dir = config.get('tmp_image_dir') or path.join(CACHE_DIR, 'images')
extract_images = config.get('extract_inline_images')
body = xhtml.get_body_from_message_stanza(message, use_xhtml=use_xhtml,
tmp_dir=tmp_dir,
extract_images=extract_images)
......@@ -554,7 +554,7 @@ def on_groupchat_private_message(self, message):
tab.remote_wants_chatstates = True
else:
tab.remote_wants_chatstates = False
if 'private' in config.get('beep_on', 'highlight private').split():
if 'private' in config.get('beep_on').split():
if not config.get_by_tabname('disable_beep', jid.full):
curses.beep()
if tab is self.current_tab():
......@@ -876,23 +876,23 @@ def on_session_start(self, event):
# request the roster
self.xmpp.get_roster()
# send initial presence
if config.get('send_initial_presence', True):
if config.get('send_initial_presence'):
pres = self.xmpp.make_presence()
pres['show'] = self.status.show
pres['status'] = self.status.message
self.events.trigger('send_normal_presence', pres)
pres.send()
bookmark.get_local()
if not self.xmpp.anon and config.get('use_remote_bookmarks', True):
if not self.xmpp.anon and con