diff sat/plugins/plugin_xep_0198.py @ 4001:32d714a8ea51

plugin XEP-0045: dot not wait for MAM retrieval to be completed: in `_join_MAM`, `room.fully_joined` is called before retrieving the MAM archive, as the process can be very long, and is not necessary to have the room working (message can be received after being in the room, and added out of order). This avoid blocking the `join` workflow for an extended time. Some renaming and coroutine integrations.
author Goffi <goffi@goffi.org>
date Fri, 10 Mar 2023 17:22:41 +0100
parents 888109774673
children 524856bd7b19
line wrap: on
line diff
--- a/sat/plugins/plugin_xep_0198.py	Fri Mar 10 17:01:09 2023 +0100
+++ b/sat/plugins/plugin_xep_0198.py	Fri Mar 10 17:22:41 2023 +0100
@@ -454,7 +454,9 @@
             if plg_0045 is not None:
                 # we re-join MUC rooms
                 muc_d_list = defer.DeferredList(
-                    [plg_0045.join(*args) for args in muc_join_args])
+                    [defer.ensureDeferred(plg_0045.join(*args))
+                     for args in muc_join_args]
+                )
                 d.addCallback(lambda __: muc_d_list)
             # at the end we replay the buffer, as those stanzas have probably not
             # been received