diff options
author | Kim Alvefur <zash@zash.se> | 2019-11-25 23:52:45 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2019-11-25 23:52:45 +0100 |
commit | 093ef6bb23e47af21bcb5428386ace5013604424 (patch) | |
tree | 9cd9f1b37b299d0032987a89068405551103261a /plugins/muc/members_only.lib.lua | |
parent | c26f8beac4075c8d031ed9a620fac77653d1bb07 (diff) | |
download | prosody-093ef6bb23e47af21bcb5428386ace5013604424.tar.gz prosody-093ef6bb23e47af21bcb5428386ace5013604424.zip |
MUC: Indicate that the room is the origin of various errors where 'from' is an occupant JID
Diffstat (limited to 'plugins/muc/members_only.lib.lua')
-rw-r--r-- | plugins/muc/members_only.lib.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/muc/members_only.lib.lua b/plugins/muc/members_only.lib.lua index 4194c5c7..79077153 100644 --- a/plugins/muc/members_only.lib.lua +++ b/plugins/muc/members_only.lib.lua @@ -113,7 +113,7 @@ module:hook("muc-occupant-pre-join", function(event) local stanza = event.stanza; local affiliation = room:get_affiliation(stanza.attr.from); if valid_affiliations[affiliation or "none"] <= valid_affiliations.none then - local reply = st.error_reply(stanza, "auth", "registration-required"):up(); + local reply = st.error_reply(stanza, "auth", "registration-required", nil, room.jid):up(); reply.tags[1].attr.code = "407"; event.origin.send(reply:tag("x", {xmlns = "http://jabber.org/protocol/muc"})); return true; @@ -131,7 +131,7 @@ module:hook("muc-pre-invite", function(event) local inviter_affiliation = room:get_affiliation(stanza.attr.from) or "none"; local required_affiliation = room._data.allow_member_invites and "member" or "admin"; if valid_affiliations[inviter_affiliation] < valid_affiliations[required_affiliation] then - event.origin.send(st.error_reply(stanza, "auth", "forbidden")); + event.origin.send(st.error_reply(stanza, "auth", "forbidden", nil, room.jid)); return true; end end |