comparison 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
comparison
equal deleted inserted replaced
4000:2d59974a8e3e 4001:32d714a8ea51
452 # initial presence must be sent manually 452 # initial presence must be sent manually
453 d.addCallback(lambda __: client.presence.available()) 453 d.addCallback(lambda __: client.presence.available())
454 if plg_0045 is not None: 454 if plg_0045 is not None:
455 # we re-join MUC rooms 455 # we re-join MUC rooms
456 muc_d_list = defer.DeferredList( 456 muc_d_list = defer.DeferredList(
457 [plg_0045.join(*args) for args in muc_join_args]) 457 [defer.ensureDeferred(plg_0045.join(*args))
458 for args in muc_join_args]
459 )
458 d.addCallback(lambda __: muc_d_list) 460 d.addCallback(lambda __: muc_d_list)
459 # at the end we replay the buffer, as those stanzas have probably not 461 # at the end we replay the buffer, as those stanzas have probably not
460 # been received 462 # been received
461 d.addCallback(lambda __: self.replayBuffer(client, buffer_, 463 d.addCallback(lambda __: self.replayBuffer(client, buffer_,
462 discard_results=True)) 464 discard_results=True))