Software /
code /
prosody
Diff
plugins/muc/mod_muc.lua @ 5335:bb81c13d2c6f
MUC: Always return <service-unavailable/> when a node is present in service discovery requests.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Tue, 26 Feb 2013 23:56:44 +0500 |
parent | 5210:862a6fae05e7 |
child | 5376:ba9be0be4bbb |
line wrap: on
line diff
--- a/plugins/muc/mod_muc.lua Tue Feb 26 20:31:41 2013 +0500 +++ b/plugins/muc/mod_muc.lua Tue Feb 26 23:56:44 2013 +0500 @@ -126,9 +126,10 @@ if type == "error" or type == "result" then return; end if stanza.name == "iq" and type == "get" then local xmlns = stanza.tags[1].attr.xmlns; - if xmlns == "http://jabber.org/protocol/disco#info" then + local node = stanza.tags[1].attr.node; + if xmlns == "http://jabber.org/protocol/disco#info" and not node then origin.send(get_disco_info(stanza)); - elseif xmlns == "http://jabber.org/protocol/disco#items" then + elseif xmlns == "http://jabber.org/protocol/disco#items" and not node then origin.send(get_disco_items(stanza)); elseif xmlns == "http://jabber.org/protocol/muc#unique" then origin.send(st.reply(stanza):tag("unique", {xmlns = xmlns}):text(uuid_gen())); -- FIXME Random UUIDs can theoretically have collisions