mod_service_outage_status/mod_service_outage_status.lua
author Matthew Wild <mwild1@gmail.com>
Fri, 23 Feb 2024 22:50:57 +0000
changeset 5847 79ae71f52c81
parent 5342 03044a6f5f4c
permissions -rw-r--r--
mod_pubsub_serverinfo: Update to use mod_server_info (fixes #1841) ...but only for Prosody trunk users, because 0.12 mod_server_contact_info does not use the new API in mod_server_info.

local dataforms = require "util.dataforms";

local form_layout = dataforms.new({
	{ type = "hidden"; var = "FORM_TYPE"; value = "urn:xmpp:sos:0" };
	{ type = "list-multi"; name = "addrs"; var = "external-status-addresses" };
});

local addresses = module:get_option_array("outage_status_urls");
module:add_extension(form_layout:form({ addrs = addresses }, "result"));