mod_announce: Work with non-local admins

Tue, 23 Jun 2009 23:59:21 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Tue, 23 Jun 2009 23:59:21 +0500
changeset 1397
4c7b8b8ab569
parent 1396
ce3eb5f71899
child 1398
141fec125af0

mod_announce: Work with non-local admins

plugins/mod_announce.lua file | annotate | diff | comparison | revisions
--- 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

mercurial