comparison mod_http_admin_api/mod_http_admin_api.lua @ 5891:512f912fdfa5

mod_http_admin_api: Use new API in mod_announce to send announcements
author Matthew Wild <mwild1@gmail.com>
date Wed, 24 Apr 2024 13:47:48 +0100
parents 432efc39572f
children 095030677ae6
comparison
equal deleted inserted replaced
5890:ba71fdc8ea73 5891:512f912fdfa5
797 local host = module.host 797 local host = module.host
798 message.attr.from = host 798 message.attr.from = host
799 if body.recipients == "online" then 799 if body.recipients == "online" then
800 announce.send_to_online(message, host); 800 announce.send_to_online(message, host);
801 elseif body.recipients == "all" then 801 elseif body.recipients == "all" then
802 for username in usermanager.users(host) do 802 if announce.send_to_all then
803 message.attr.to = username .. "@" .. host 803 announce.send_to_all(message, host);
804 module:send(st.clone(message)) 804 else -- COMPAT w/ 0.12 and trunk before e22609460975
805 for username in usermanager.users(host) do
806 message.attr.to = username .. "@" .. host
807 module:send(st.clone(message))
808 end
805 end 809 end
806 else 810 else
807 for _, addr in ipairs(body.recipients) do 811 for _, addr in ipairs(body.recipients) do
808 message.attr.to = addr 812 message.attr.to = addr
809 module:send(message) 813 module:send(message)