comparison mod_mam_muc/mod_mam_muc.lua @ 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 b32d65e41755
children 1091be1c3aba
comparison
equal deleted inserted replaced
1139:b32d65e41755 1140:402cb9b604eb
39 if not room_obj then 39 if not room_obj then
40 return -- FIXME not found 40 return -- FIXME not found
41 end 41 end
42 local from = jid_bare(stanza.attr.from); 42 local from = jid_bare(stanza.attr.from);
43 43
44 -- Banned or not a member of a members-only room?
44 if room_obj._affiliations[from] == "outcast" 45 if room_obj._affiliations[from] == "outcast"
45 or room_obj._data.members_only and not room_obj._affiliations[from] then 46 or room_obj._data.members_only and not room_obj._affiliations[from] then
46 return -- FIXME unauth 47 return origin.send(st.error_reply(stanza, "auth", "forbidden"))
47 end 48 end
48 49
49 local qid = query.attr.queryid; 50 local qid = query.attr.queryid;
50 51
51 -- Search query parameters 52 -- Search query parameters