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.
--- 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;