# HG changeset patch # User Kim Alvefur # Date 1618075405 -7200 # Node ID 3b2ae854842c822b70bdf8e1a25aee2d198ca63d # Parent d25f0fea270f73d6743f316be08ca50a75d5eb03 mod_muc_bot: Save occupant to room This has some side-effects: Firstly, the bot shows up in occupant list, which is nice. Secondly, the bot starts receiving messages from the room which might be wanted, but it would be better to join the room for real in this case. diff -r d25f0fea270f -r 3b2ae854842c mod_muc_bot/mod_muc_bot.lua --- a/mod_muc_bot/mod_muc_bot.lua Sat Apr 10 19:20:03 2021 +0200 +++ b/mod_muc_bot/mod_muc_bot.lua Sat Apr 10 19:23:25 2021 +0200 @@ -28,6 +28,8 @@ local join = st.presence({from = event.from; to = virtual_occupant_jid}); local dest_x = st.stanza("x", {xmlns = "http://jabber.org/protocol/muc#user"}); occupant:set_session(event.from, join, true); + room:save_occupant(occupant); + room:publicise_occupant_status(occupant, dest_x); -- Inject virtual occupant to trick all the other hooks on this event that -- this is an actual legitimate participant. event.occupant = occupant;