# HG changeset patch # User Matthew Wild # Date 1713962868 -3600 # Node ID 512f912fdfa5c6c52aaf77f6f5b49c8ee205ca67 # Parent ba71fdc8ea735ef7d56e1e3ad0d0b02259ad23fc mod_http_admin_api: Use new API in mod_announce to send announcements diff -r ba71fdc8ea73 -r 512f912fdfa5 mod_http_admin_api/mod_http_admin_api.lua --- a/mod_http_admin_api/mod_http_admin_api.lua Tue Apr 23 12:10:38 2024 +0100 +++ b/mod_http_admin_api/mod_http_admin_api.lua Wed Apr 24 13:47:48 2024 +0100 @@ -799,9 +799,13 @@ if body.recipients == "online" then announce.send_to_online(message, host); elseif body.recipients == "all" then - for username in usermanager.users(host) do - message.attr.to = username .. "@" .. host - module:send(st.clone(message)) + if announce.send_to_all then + announce.send_to_all(message, host); + else -- COMPAT w/ 0.12 and trunk before e22609460975 + for username in usermanager.users(host) do + message.attr.to = username .. "@" .. host + module:send(st.clone(message)) + end end else for _, addr in ipairs(body.recipients) do