Mercurial > prosody-modules
changeset 5843:79ae71f52c81
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.
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 23 Feb 2024 22:50:57 +0000 |
parents | ed82916e5796 |
children | 37e38ee534ea |
files | mod_pubsub_serverinfo/mod_pubsub_serverinfo.lua |
diffstat | 1 files changed, 3 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/mod_pubsub_serverinfo/mod_pubsub_serverinfo.lua Fri Feb 23 22:47:05 2024 +0000 +++ b/mod_pubsub_serverinfo/mod_pubsub_serverinfo.lua Fri Feb 23 22:50:57 2024 +0000 @@ -2,7 +2,6 @@ local json = require "util.json"; local st = require "util.stanza"; local new_id = require"util.id".medium; -local dataform = require "util.dataforms".new; local local_domain = module:get_host(); local service = module:get_option(module.name .. "_service") or "pubsub." .. local_domain; @@ -29,10 +28,9 @@ module:add_feature("urn:xmpp:serverinfo:0"); - module:add_extension(dataform { - { name = "FORM_TYPE", type = "hidden", value = "http://jabber.org/network/serverinfo" }, - { name = "serverinfo-pubsub-node", type = "text-single" }, - }:form({ ["serverinfo-pubsub-node"] = ("xmpp:%s?;node=%s"):format(service, node) }, "result")); + module:add_item("server-info-fields", { + { name = "serverinfo-pubsub-node", type = "text-single", value = ("xmpp:%s?;node=%s"):format(service, node) }; + }); if cache_ttl < publication_interval then module:log("warn", "It is recommended to have a cache interval higher than the publication interval");