diff options
author | Kim Alvefur <zash@zash.se> | 2019-11-26 00:02:13 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2019-11-26 00:02:13 +0100 |
commit | b2e9ee4b6bf0950e73252277c9d15c629b2308e0 (patch) | |
tree | 2cd07cf97251f564eae0d399b580aa47a115137c /plugins | |
parent | 093ef6bb23e47af21bcb5428386ace5013604424 (diff) | |
download | prosody-b2e9ee4b6bf0950e73252277c9d15c629b2308e0.tar.gz prosody-b2e9ee4b6bf0950e73252277c9d15c629b2308e0.zip |
MUC: Indicate the component as origin of various errors where there's no room
A room that doesn't exist can't return an error, can it?
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/muc/lock.lib.lua | 2 | ||||
-rw-r--r-- | plugins/muc/mod_muc.lua | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/plugins/muc/lock.lib.lua b/plugins/muc/lock.lib.lua index 062ab615..32f2647b 100644 --- a/plugins/muc/lock.lib.lua +++ b/plugins/muc/lock.lib.lua @@ -43,7 +43,7 @@ end module:hook("muc-occupant-pre-join", function(event) if not event.is_new_room and is_locked(event.room) then -- Deny entry module:log("debug", "Room is locked, denying entry"); - event.origin.send(st.error_reply(event.stanza, "cancel", "item-not-found")); + event.origin.send(st.error_reply(event.stanza, "cancel", "item-not-found", nil, module.host)); return true; end end, -30); diff --git a/plugins/muc/mod_muc.lua b/plugins/muc/mod_muc.lua index 9481c977..fc39d89f 100644 --- a/plugins/muc/mod_muc.lua +++ b/plugins/muc/mod_muc.lua @@ -355,7 +355,7 @@ end, 1); module:hook("muc-room-pre-create", function(event) local origin, stanza = event.origin, event.stanza; if not track_room(event.room) then - origin.send(st.error_reply(stanza, "wait", "resource-constraint")); + origin.send(st.error_reply(stanza, "wait", "resource-constraint", nil, module.host)); return true; end end, -1000); @@ -406,7 +406,7 @@ do restrict_room_creation == "local" and select(2, jid_split(user_jid)) == host_suffix ) then - origin.send(st.error_reply(stanza, "cancel", "not-allowed", "Room creation is restricted")); + origin.send(st.error_reply(stanza, "cancel", "not-allowed", "Room creation is restricted", module.host)); return true; end end); @@ -451,7 +451,7 @@ for event_name, method in pairs { room = nil; else if stanza.attr.type ~= "error" then - local reply = st.error_reply(stanza, "cancel", "gone", room._data.reason) + local reply = st.error_reply(stanza, "cancel", "gone", room._data.reason, module.host) if room._data.newjid then local uri = "xmpp:"..room._data.newjid.."?join"; reply:get_child("error"):child_with_name("gone"):text(uri); @@ -465,20 +465,20 @@ for event_name, method in pairs { if room == nil then -- Watch presence to create rooms if not jid_prep(room_jid, true) then - origin.send(st.error_reply(stanza, "modify", "jid-malformed")); + origin.send(st.error_reply(stanza, "modify", "jid-malformed", nil, module.host)); return true; end if stanza.attr.type == nil and stanza.name == "presence" and stanza:get_child("x", "http://jabber.org/protocol/muc") then room = muclib.new_room(room_jid); return room:handle_first_presence(origin, stanza); elseif stanza.attr.type ~= "error" then - origin.send(st.error_reply(stanza, "cancel", "item-not-found")); + origin.send(st.error_reply(stanza, "cancel", "item-not-found", nil, module.host)); return true; else return; end elseif room == false then -- Error loading room - origin.send(st.error_reply(stanza, "wait", "resource-constraint")); + origin.send(st.error_reply(stanza, "wait", "resource-constraint", nil, module.host)); return true; end return room[method](room, origin, stanza); |