Comparison

mod_muc_bot/mod_muc_bot.lua @ 4824:205b9d06fe6b

mod_muc_bot: Use correct JID for virtual occupant Mistake introduced in d25f0fea270f Thanks valdikss
author Kim Alvefur <zash@zash.se>
date Sun, 12 Dec 2021 18:33:06 +0100
parent 4567:bcf4518d18d4
comparison
equal deleted inserted replaced
4823:d3e926bf0c8a 4824:205b9d06fe6b
22 if not virtual_occupant_jid then 22 if not virtual_occupant_jid then
23 module:send(st.error_reply(event.stanza, "modify", "jid-malformed", "Nickname must pass strict validation", room.jid)); 23 module:send(st.error_reply(event.stanza, "modify", "jid-malformed", "Nickname must pass strict validation", room.jid));
24 return true; 24 return true;
25 end 25 end
26 26
27 local occupant = room:new_occupant(module.host, virtual_occupant_jid); 27 local occupant = room:new_occupant(jid.bare(event.from), virtual_occupant_jid);
28 local join = st.presence({from = event.from; to = virtual_occupant_jid}); 28 local join = st.presence({from = event.from; to = virtual_occupant_jid});
29 local dest_x = st.stanza("x", {xmlns = "http://jabber.org/protocol/muc#user"}); 29 local dest_x = st.stanza("x", {xmlns = "http://jabber.org/protocol/muc#user"});
30 occupant:set_session(event.from, join, true); 30 occupant:set_session(event.from, join, true);
31 room:save_occupant(occupant); 31 room:save_occupant(occupant);
32 room:publicise_occupant_status(occupant, dest_x); 32 room:publicise_occupant_status(occupant, dest_x);