Changeset

1140:402cb9b604eb

mod_mam_muc: Send proper error reply when one is not allowed to query archive
author Kim Alvefur <zash@zash.se>
date Sat, 10 Aug 2013 21:10:03 +0200
parents 1139:b32d65e41755
children 1141:1091be1c3aba
files mod_mam_muc/mod_mam_muc.lua
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_mam_muc/mod_mam_muc.lua	Sat Aug 10 21:08:45 2013 +0200
+++ b/mod_mam_muc/mod_mam_muc.lua	Sat Aug 10 21:10:03 2013 +0200
@@ -41,9 +41,10 @@
 	end
 	local from = jid_bare(stanza.attr.from);
 
+	-- Banned or not a member of a members-only room?
 	if room_obj._affiliations[from] == "outcast"
 		or room_obj._data.members_only and not room_obj._affiliations[from] then
-		return -- FIXME unauth
+		return origin.send(st.error_reply(stanza, "auth", "forbidden"))
 	end
 
 	local qid = query.attr.queryid;