Comparison

plugins/muc/mod_muc.lua @ 7746:3dff38ffdcd0

MUC: Don't create room in response to unavailable presence
author Kim Alvefur <zash@zash.se>
date Sun, 27 Nov 2016 00:10:51 +0100
parent 7266:f0a2a305b788
child 7747:0e442402cebc
child 8025:8a7c4497569a
comparison
equal deleted inserted replaced
7744:4d9186d990a5 7746:3dff38ffdcd0
157 function stanza_handler(event) 157 function stanza_handler(event)
158 local origin, stanza = event.origin, event.stanza; 158 local origin, stanza = event.origin, event.stanza;
159 local bare = jid_bare(stanza.attr.to); 159 local bare = jid_bare(stanza.attr.to);
160 local room = rooms[bare]; 160 local room = rooms[bare];
161 if not room then 161 if not room then
162 if stanza.name ~= "presence" then 162 if stanza.name ~= "presence" or stanza.attr.type ~= nil then
163 origin.send(st.error_reply(stanza, "cancel", "item-not-found")); 163 origin.send(st.error_reply(stanza, "cancel", "item-not-found"));
164 return true; 164 return true;
165 end 165 end
166 if not(restrict_room_creation) or 166 if not(restrict_room_creation) or
167 is_admin(stanza.attr.from) or 167 is_admin(stanza.attr.from) or