# HG changeset patch # User daurnimator # Date 1393027593 18000 # Node ID a861dc18e08d00c74a382650bd0a379aa385c10e # Parent c78ba94d3261d322da606f22f1a5f37e95740686 plugins/muc/muc.lib: Add disco iq handlers with compatible argument signature diff -r c78ba94d3261 -r a861dc18e08d plugins/muc/muc.lib.lua --- a/plugins/muc/muc.lib.lua Fri Feb 21 18:04:38 2014 -0500 +++ b/plugins/muc/muc.lib.lua Fri Feb 21 19:06:33 2014 -0500 @@ -827,6 +827,16 @@ module:fire_event("muc-room-destroyed", { room = self }); end +function room_mt:handle_disco_info_get_query(origin, stanza) + origin.send(self:get_disco_info(stanza)); + return true; +end + +function room_mt:handle_disco_items_get_query(origin, stanza) + origin.send(self:get_disco_items(stanza)); + return true; +end + function room_mt:handle_admin_item_set_command(origin, stanza) local item = stanza.tags[1].tags[1]; if item.attr.jid then -- Validate provided JID @@ -951,11 +961,9 @@ local type = stanza.attr.type; local xmlns = stanza.tags[1] and stanza.tags[1].attr.xmlns; if xmlns == "http://jabber.org/protocol/disco#info" and type == "get" and not stanza.tags[1].attr.node then - origin.send(self:get_disco_info(stanza)); - return true; + return self:handle_disco_info_get_query(origin, stanza) elseif xmlns == "http://jabber.org/protocol/disco#items" and type == "get" and not stanza.tags[1].attr.node then - origin.send(self:get_disco_items(stanza)); - return true; + return self:handle_disco_items_get_query(origin, stanza) elseif xmlns == "http://jabber.org/protocol/muc#admin" then local item = stanza.tags[1].tags[1]; if item and item.name == "item" then