Modern XMPP project discussion - 2023-06-14


  1. marc0s

    Hi, are there some best practices around handling offline messages in MUCs for mobile clients (aka clients that can enable and receive push notifications)? The expected scenario is to be able to receive via push notifications messages sent while the client is not in the foreground or even killed by the OS. I know that MUCs are presence-based and that when smacks-hibernated sessions timeout, an unavailable presence is emitted (we're using prosody), that's part of why I'm asking. How are app developers handling this? Thanks in advance!

  2. MattJ

    marc0s, there are currently a few different approaches. One is to just never go offline - which is what Conversations and Monal aim to do. If they get disconnected, the server sends them a push notification to wake them back up (and they can reconnect/resume). That way there is minimal change from how clients with a more permanent connection would work.

  3. MattJ

    Another approach, which is taken by e.g. the Tigase developers, is to have the MUC send notifications to the user if there is activity/mentions while they are not connected to the MUC. The server will then forward this to the client via a push notification, and then if the user opens the client it will connect to the MUC the normal way.

  4. MattJ

    Another approach, is similar to that, where the client registers for push notifications directly with a MUC service and the MUC speaks directly to the push gateway. There is a Prosody module for that one, but I don't know if anything is still using that approach.

  5. MattJ

    Of these three approaches, the first one is supported by Prosody, ejabberd and probably most others by now. The second approach is supported by Tigase and Prosody (with some additional modules, e.g. https://modules.prosody.im/mod_muc_offline_delivery ).

  6. MattJ

    I've been working on a proposal to unify the two approaches into a cleaner "Push 2.0" spec, which was presented and discussed at the last XMPP summit. Unfortunately I've not had time to work on it since then, but it mostly just neatens up the current protocols.

  7. marc0s

    Thank you for your feedback, MattJ. Really appreciated :)

  8. marc0s

    > Another approach, which is taken by e.g. the Tigase developers, is to have the MUC send notifications to the user if there is activity/mentions while they are not connected to the MUC. The server will then forward this to the client via a push notification, and then if the user opens the client it will connect to the MUC the normal way. I even uploaded a module to the community repo implementing a similar idea in the past, we probably had some stuff interfering and I think we never run it in production. I think the Tigase approach (I was just reading the module) and your implementation just look better than mine :)

  9. marc0s

    The "never go offline" approach, assuming that it will drain your battery faster, how is it supported by prosody? I mean, is it some configuration option or a module?

  10. marc0s

    > I've been working on a proposal to unify the two approaches into a cleaner "Push 2.0" spec, which was presented and discussed at the last XMPP summit. Unfortunately I've not had time to work on it since then, but it mostly just neatens up the current protocols. Are there any public docs about it? Will give them a read, if any. Thanks

  11. MattJ

    marc0s, https://pad.nixnet.services/s/GPBR4xa4k#

  12. marc0s

    MattJ, thank you!