Diff

plugins/mod_announce.lua @ 1397:4c7b8b8ab569

mod_announce: Work with non-local admins
author Waqas Hussain <waqas20@gmail.com>
date Tue, 23 Jun 2009 23:59:21 +0500
parent 1396:ce3eb5f71899
child 1522:569d58d21612
line wrap: on
line diff
--- a/plugins/mod_announce.lua	Tue Jun 23 23:55:56 2009 +0500
+++ b/plugins/mod_announce.lua	Tue Jun 23 23:59:21 2009 +0500
@@ -11,9 +11,9 @@
 		return; -- Not an announcement
 	end
 	
-	if not is_admin(origin.full_jid) then
+	if not is_admin(stanza.attr.from) then
 		-- Not an admin? Not allowed!
-		module:log("warn", "Non-admin %s tried to send server announcement", tostring(jid.bare(origin.full_jid)));
+		module:log("warn", "Non-admin %s tried to send server announcement", tostring(jid.bare(stanza.attr.from)));
 		origin.send(st.error_reply(stanza, "cancel", "service-unavailable"));
 		return;
 	end