Add a whitespace_interval option
This commit is contained in:
parent
6d2af1116c
commit
27a7bfc92c
3 changed files with 17 additions and 0 deletions
|
@ -19,6 +19,12 @@ certificate =
|
|||
# the same certificate.
|
||||
ignore_certificate = false
|
||||
|
||||
# The interval to send a whitespace keepalive to the server
|
||||
# 300 should be fine, except for specific services, in that case, change the
|
||||
# value to the services default.
|
||||
whitespace_interval = 300
|
||||
|
||||
|
||||
# Path to the certificate authenticating the Authority
|
||||
# A server may have several certificates, but if it uses a CA, it will often
|
||||
# keep the same for obvious reasons, so this is a good option if your server
|
||||
|
|
|
@ -67,6 +67,12 @@ section of this documentation.
|
|||
affected by _ignore_certificate_ and boths checks may be active at the same
|
||||
time.
|
||||
|
||||
*whitespace_interval*:: 300
|
||||
|
||||
Interval of the whitespace keepalive sending to the server.
|
||||
300 should be fine, but change it if some services have a stricter policy
|
||||
on client inactivity.
|
||||
|
||||
*resource*:: [empty]
|
||||
|
||||
the resource you will use
|
||||
|
|
|
@ -45,6 +45,11 @@ class Connection(sleekxmpp.ClientXMPP):
|
|||
self.auto_reconnect = True if config.get('auto_reconnect', 'false').lower() in ('true', '1') else False
|
||||
self.auto_authorize = None
|
||||
self.ca_certs = config.get('ca_cert_path', '') or None
|
||||
interval = config.get('whitespace_interval', '300')
|
||||
if interval.isnumeric():
|
||||
self.whitespace_keepalive_interval = int(interval)
|
||||
else:
|
||||
self.whitespace_keepalive_interval = 300
|
||||
self.register_plugin('xep_0030')
|
||||
self.register_plugin('xep_0004')
|
||||
self.register_plugin('xep_0045')
|
||||
|
|
Loading…
Reference in a new issue