Software /
code /
prosody
Comparison
plugins/muc/mod_muc.lua @ 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 |
parent | 5016:56a0b13a3d42 |
child | 5062:88e198d65905 |
comparison
equal
deleted
inserted
replaced
5057:1e44678b5de2 | 5058:433cc9a4c7e9 |
---|---|
133 function stanza_handler(event) | 133 function stanza_handler(event) |
134 local origin, stanza = event.origin, event.stanza; | 134 local origin, stanza = event.origin, event.stanza; |
135 local bare = jid_bare(stanza.attr.to); | 135 local bare = jid_bare(stanza.attr.to); |
136 local room = rooms[bare]; | 136 local room = rooms[bare]; |
137 if not room then | 137 if not room then |
138 if stanza.name ~= "presence" then | |
139 origin.send(st.error_reply(stanza, "cancel", "item-not-found")); | |
140 return true; | |
141 end | |
138 if not(restrict_room_creation) or | 142 if not(restrict_room_creation) or |
139 (restrict_room_creation == "admin" and is_admin(stanza.attr.from)) or | 143 (restrict_room_creation == "admin" and is_admin(stanza.attr.from)) or |
140 (restrict_room_creation == "local" and select(2, jid_split(stanza.attr.from)) == module.host:gsub("^[^%.]+%.", "")) then | 144 (restrict_room_creation == "local" and select(2, jid_split(stanza.attr.from)) == module.host:gsub("^[^%.]+%.", "")) then |
141 room = muc_new_room(bare, { | 145 room = muc_new_room(bare, { |
142 max_history_length = max_history_messages; | 146 max_history_length = max_history_messages; |