diff sat/core/constants.py @ 2691:1ecceac3df96

plugin XEP-0198: Stream Management implementation: - hooks can now be set in stream onElement and send methods - xmllog refactored to use new hooks - client.isConnected now uses transport.connected method - fixed reconnection, SàT will now try to reconnect indefinitely until it success, unresolvable failure happen (e.g. invalid certificate), or explicit disconnection is requested (or a plugin change this behaviour) - new triggers: "stream_hooks", "disconnecting", "disconnected", and "xml_init" (replace "XML Initialized")
author Goffi <goffi@goffi.org>
date Sun, 18 Nov 2018 15:49:46 +0100
parents a7529543bbb1
children a8ec00731ce7
line wrap: on
line diff
--- a/sat/core/constants.py	Sat Nov 10 10:16:38 2018 +0100
+++ b/sat/core/constants.py	Sun Nov 18 15:49:46 2018 +0100
@@ -50,7 +50,7 @@
     ## Protocol ##
     XMPP_C2S_PORT = 5222
     XMPP_KEEP_ALIFE = 180
-    XMPP_MAX_RETRIES = 2
+    XMPP_MAX_RETRIES = None
     # default port used on Prosody, may differ on other servers
     XMPP_COMPONENT_PORT = 5347
 
@@ -403,6 +403,11 @@
     NO_LIMIT = -1  # used in bridge when a integer value is expected
     DEFAULT_MAX_AGE = 1209600  # default max age of cached files, in seconds
     HASH_SHA1_EMPTY = "da39a3ee5e6b4b0d3255bfef95601890afd80709"
+    STANZA_NAMES = (u"iq", u"message", u"presence")
+
+    # Stream Hooks
+    STREAM_HOOK_SEND = u"send"
+    STREAM_HOOK_RECEIVE = u"receive"
 
     @classmethod
     def LOG_OPTIONS(cls):