285 end |
285 end |
286 end |
286 end |
287 elseif type ~= 'result' then -- bad type |
287 elseif type ~= 'result' then -- bad type |
288 origin.send(st.error_reply(stanza, "modify", "bad-request")); -- FIXME correct error? |
288 origin.send(st.error_reply(stanza, "modify", "bad-request")); -- FIXME correct error? |
289 end |
289 end |
290 elseif not current_nick then -- not in room |
290 elseif not current_nick and type ~= "error" then -- not in room |
291 origin.send(st.error_reply(stanza, "cancel", "not-acceptable")); |
291 origin.send(st.error_reply(stanza, "cancel", "not-acceptable")); |
292 elseif stanza.name == "message" and type == "groupchat" then -- groupchat messages not allowed in PM |
292 elseif stanza.name == "message" and type == "groupchat" then -- groupchat messages not allowed in PM |
293 origin.send(st.error_reply(stanza, "modify", "bad-request")); |
293 origin.send(st.error_reply(stanza, "modify", "bad-request")); |
294 elseif stanza.name == "message" and type == "error" then |
294 elseif stanza.name == "message" and type == "error" then |
295 log("debug", "%s kicked from %s for sending an error message", current_nick, room); |
295 log("debug", "%s kicked from %s for sending an error message", current_nick, room); |