From 38fec5d17dcd4011f906f0bc32ca90449f19fb78 Mon Sep 17 00:00:00 2001
From: Waqas Hussain <waqas20@gmail.com>
Date: Tue, 23 Jun 2009 23:59:21 +0500
Subject: mod_announce: Work with non-local admins

---
 plugins/mod_announce.lua | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/plugins/mod_announce.lua b/plugins/mod_announce.lua
index 5ea61e28..010b45d9 100644
--- a/plugins/mod_announce.lua
+++ b/plugins/mod_announce.lua
@@ -11,9 +11,9 @@ function handle_announcement(data)
 		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
-- 
cgit v1.2.3