Add an auto_reconnect option

This commit is contained in:
mathieui 2012-01-26 17:21:13 +01:00
parent 7433510470
commit bbcd9c631c
3 changed files with 10 additions and 1 deletions

View file

@ -10,6 +10,10 @@ server = anon.louiz.org
# the port you'll use to connect
port = 5222
# Auto-reconnects you when you get disconnected from the server
# defaults to false because it should not be necessary
auto_reconnect = false
# the resource you will use
# If it's empty, your resource will be chosen (most likely randomly) by the server
# It is not recommended to use a resource that is easy to guess, because it can lead

View file

@ -55,6 +55,11 @@ section of this documentation.
It is not recommended to use a resource that is easy to guess, because it can lead
to presence leak.
*auto_reconnect*:: false
Auto-reconnects you when you get disconnected. Should not be necessary, so
the default is false.
*default_nick*:: [empty]

View file

@ -42,7 +42,7 @@ class Connection(sleekxmpp.ClientXMPP):
password = None
sleekxmpp.ClientXMPP.__init__(self, jid, password, ssl=True)
self.core = None
self.auto_reconnect = False
self.auto_reconnect = True if config.get('auto_reconnect', 'false').lower() in ('true', '1') else False
self.auto_authorize = None
self.register_plugin('xep_0030')
self.register_plugin('xep_0004')