Changeset

5058:433cc9a4c7e9

MUC: Return <item-not-found/> on message and iq to non-existent rooms (thanks Maranda).
author Waqas Hussain <waqas20@gmail.com>
date Wed, 01 Aug 2012 01:36:11 +0500
parents 5057:1e44678b5de2
children 5059:246ba539a5cd
files plugins/muc/mod_muc.lua
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/muc/mod_muc.lua	Tue Jul 31 08:23:55 2012 +0200
+++ b/plugins/muc/mod_muc.lua	Wed Aug 01 01:36:11 2012 +0500
@@ -135,6 +135,10 @@
 	local bare = jid_bare(stanza.attr.to);
 	local room = rooms[bare];
 	if not room then
+		if stanza.name ~= "presence" then
+			origin.send(st.error_reply(stanza, "cancel", "item-not-found"));
+			return true;
+		end
 		if not(restrict_room_creation) or
 		  (restrict_room_creation == "admin" and is_admin(stanza.attr.from)) or
 		  (restrict_room_creation == "local" and select(2, jid_split(stanza.attr.from)) == module.host:gsub("^[^%.]+%.", "")) then