aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_announce.lua
diff options
context:
space:
mode:
authorFlorian Zeitz <florob@babelmonkeys.de>2013-08-09 17:48:21 +0200
committerFlorian Zeitz <florob@babelmonkeys.de>2013-08-09 17:48:21 +0200
commit4b618a8727365b880e115c6fd53869040c2ad238 (patch)
tree8031ff6fd0e32a78a157f8e6542a954e7e634c5d /plugins/mod_announce.lua
parent7dd77281432685907926d50feb2d32c0c2a0ec8c (diff)
downloadprosody-4b618a8727365b880e115c6fd53869040c2ad238.tar.gz
prosody-4b618a8727365b880e115c6fd53869040c2ad238.zip
Remove all trailing whitespace
Diffstat (limited to 'plugins/mod_announce.lua')
-rw-r--r--plugins/mod_announce.lua14
1 files changed, 7 insertions, 7 deletions
diff --git a/plugins/mod_announce.lua b/plugins/mod_announce.lua
index 96976d6f..9327556c 100644
--- a/plugins/mod_announce.lua
+++ b/plugins/mod_announce.lua
@@ -1,7 +1,7 @@
-- Prosody IM
-- Copyright (C) 2008-2010 Matthew Wild
-- Copyright (C) 2008-2010 Waqas Hussain
---
+--
-- This project is MIT/X11 licensed. Please see the
-- COPYING file in the source package for more information.
--
@@ -39,22 +39,22 @@ end
function handle_announcement(event)
local origin, stanza = event.origin, event.stanza;
local node, host, resource = jid.split(stanza.attr.to);
-
+
if resource ~= "announce/online" then
return; -- Not an announcement
end
-
+
if not is_admin(stanza.attr.from) then
-- Not an admin? Not allowed!
module:log("warn", "Non-admin '%s' tried to send server announcement", stanza.attr.from);
return;
end
-
+
module:log("info", "Sending server announcement to all online users");
local message = st.clone(stanza);
message.attr.type = "headline";
message.attr.from = host;
-
+
local c = send_to_online(message, host);
module:log("info", "Announcement sent to %d online users", c);
return true;
@@ -83,9 +83,9 @@ function announce_handler(self, data, state)
module:log("info", "Sending server announcement to all online users");
local message = st.message({type = "headline"}, fields.announcement):up()
:tag("subject"):text(fields.subject or "Announcement");
-
+
local count = send_to_online(message, data.to);
-
+
module:log("info", "Announcement sent to %d online users", count);
return { status = "completed", info = ("Announcement sent to %d online users"):format(count) };
else