--- a/mod_broadcast/mod_broadcast.lua Sun May 19 22:09:54 2013 +0100
+++ b/mod_broadcast/mod_broadcast.lua Sun May 19 22:25:54 2013 +0100
@@ -1,5 +1,6 @@
local is_admin = require "core.usermanager".is_admin;
local allowed_senders = module:get_option_set("broadcast_senders", {});
+local from_address = module:get_option_string("broadcast_from");
local jid_bare = require "util.jid".bare;
@@ -21,6 +22,10 @@
local stanza = event.stanza;
local from = stanza.attr.from;
if is_admin(from) or allowed_senders:contains(jid_bare(from)) then
+ if from_address then
+ stanza = st.clone(stanza);
+ stanza.attr.from = from_address;
+ end
local c = send_to_online(stanza);
module:log("debug", "Broadcast stanza from %s to %d online users", from, c);
return true;