Software /
code /
prosody
Comparison
plugins/muc/muc.lib.lua @ 11142:552cafd30eb2 0.11
MUC: Preserve disco 'node' attribute (or lack thereof) in response (fix #1595) (thanks lessthan3)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 07 Oct 2020 13:33:02 +0200 |
parent | 10753:925081396c59 |
child | 11143:818255f49297 |
child | 11235:1dba335eacea |
comparison
equal
deleted
inserted
replaced
11140:e17b98feb0b7 | 11142:552cafd30eb2 |
---|---|
334 end | 334 end |
335 end | 335 end |
336 end | 336 end |
337 | 337 |
338 function room_mt:get_disco_info(stanza) | 338 function room_mt:get_disco_info(stanza) |
339 local node = stanza.tags[1].attr.node or ""; | 339 local node = stanza.tags[1].attr.node; |
340 local reply = st.reply(stanza):tag("query", { xmlns = "http://jabber.org/protocol/disco#info", node = node }); | 340 local reply = st.reply(stanza):tag("query", { xmlns = "http://jabber.org/protocol/disco#info", node = node }); |
341 local event_name = "muc-disco#info"; | 341 local event_name = "muc-disco#info"; |
342 local event_data = { room = self, reply = reply, stanza = stanza }; | 342 local event_data = { room = self, reply = reply, stanza = stanza }; |
343 | 343 |
344 if node ~= "" then | 344 if node and node ~= "" then |
345 event_name = event_name.."/"..node; | 345 event_name = event_name.."/"..node; |
346 else | 346 else |
347 event_data.form = dataform.new { | 347 event_data.form = dataform.new { |
348 { name = "FORM_TYPE", type = "hidden", value = "http://jabber.org/protocol/muc#roominfo" }; | 348 { name = "FORM_TYPE", type = "hidden", value = "http://jabber.org/protocol/muc#roominfo" }; |
349 }; | 349 }; |