From 37b29231e47a0c4458dc1c15d98588f16f07e1e2 Mon Sep 17 00:00:00 2001 From: Marius Cramer <m.cramer@pixcept.de> Date: Thu, 06 Aug 2015 03:18:44 -0400 Subject: [PATCH] - don't set password via remoting if field is empty --- install/apps/metronome_libs/mod_discoitems.lua | 24 ++++++++++++++++++++++++ 1 files changed, 24 insertions(+), 0 deletions(-) diff --git a/install/apps/metronome_libs/mod_discoitems.lua b/install/apps/metronome_libs/mod_discoitems.lua new file mode 100644 index 0000000..f05b904 --- /dev/null +++ b/install/apps/metronome_libs/mod_discoitems.lua @@ -0,0 +1,24 @@ +-- * Metronome IM * +-- +-- This file is part of the Metronome XMPP server and is released under the +-- ISC License, please see the LICENSE file in this source package for more +-- information about copyright and licensing. +-- +-- As per the sublicensing clause, this file is also MIT/X11 Licensed. +-- ** Copyright (c) 2009, Waqas Hussain + +local st = require "util.stanza"; + +local result_query = st.stanza("query", {xmlns = "http://jabber.org/protocol/disco#items"}); +for _, item in ipairs(module:get_option("disco_items") or {}) do + result_query:tag("item", {jid = item[1], name = item[2]}):up(); +end + +module:hook("iq/host/http://jabber.org/protocol/disco#items:query", function(event) + local stanza = event.stanza; + local query = stanza.tags[1]; + if stanza.attr.type == "get" and not query.attr.node then + event.origin.send(st.reply(stanza):add_child(result_query)); + return true; + end +end, 100); -- Gitblit v1.9.1