Comparison

plugins/mod_announce.lua @ 3199:0badae62de28

mod_announce: Fixed an edge case where non-admins attempting to announce would get two error replies.
author Waqas Hussain <waqas20@gmail.com>
date Tue, 08 Jun 2010 16:26:01 +0500
parent 2923:b7049746bd29
child 3228:65e5dfcf5a9f
comparison
equal deleted inserted replaced
3195:f22248192c3e 3199:0badae62de28
20 end 20 end
21 21
22 if not is_admin(stanza.attr.from) then 22 if not is_admin(stanza.attr.from) then
23 -- Not an admin? Not allowed! 23 -- Not an admin? Not allowed!
24 module:log("warn", "Non-admin %s tried to send server announcement", tostring(jid.bare(stanza.attr.from))); 24 module:log("warn", "Non-admin %s tried to send server announcement", tostring(jid.bare(stanza.attr.from)));
25 origin.send(st.error_reply(stanza, "cancel", "service-unavailable"));
26 return; 25 return;
27 end 26 end
28 27
29 module:log("info", "Sending server announcement to all online users"); 28 module:log("info", "Sending server announcement to all online users");
30 local host_session = hosts[host]; 29 local host_session = hosts[host];