85 end |
85 end |
86 local function get_disco_items(stanza) |
86 local function get_disco_items(stanza) |
87 local reply = st.iq({type='result', id=stanza.attr.id, from=muc_host, to=stanza.attr.from}):query("http://jabber.org/protocol/disco#items"); |
87 local reply = st.iq({type='result', id=stanza.attr.id, from=muc_host, to=stanza.attr.from}):query("http://jabber.org/protocol/disco#items"); |
88 for jid, room in pairs(rooms) do |
88 for jid, room in pairs(rooms) do |
89 if not room:is_hidden() then |
89 if not room:is_hidden() then |
90 reply:tag("item", {jid=jid, name=jid}):up(); |
90 reply:tag("item", {jid=jid, name=room:get_name()}):up(); |
91 end |
91 end |
92 end |
92 end |
93 return reply; -- TODO cache disco reply |
93 return reply; -- TODO cache disco reply |
94 end |
94 end |
95 |
95 |