mod_http_admin_api/mod_http_admin_api.lua
changeset 5895 512f912fdfa5
parent 5892 432efc39572f
child 5899 095030677ae6
--- 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