76 :tag("feature", {var="http://jabber.org/protocol/muc"}); -- TODO cache disco reply |
76 :tag("feature", {var="http://jabber.org/protocol/muc"}); -- TODO cache disco reply |
77 end |
77 end |
78 local function get_disco_items(stanza) |
78 local function get_disco_items(stanza) |
79 local reply = st.iq({type='result', id=stanza.attr.id, from=muc_host, to=stanza.attr.from}):query("http://jabber.org/protocol/disco#items"); |
79 local reply = st.iq({type='result', id=stanza.attr.id, from=muc_host, to=stanza.attr.from}):query("http://jabber.org/protocol/disco#items"); |
80 for jid, room in pairs(rooms) do |
80 for jid, room in pairs(rooms) do |
81 if not room._data.hidden then |
81 if not room:is_hidden() then |
82 reply:tag("item", {jid=jid, name=jid}):up(); |
82 reply:tag("item", {jid=jid, name=jid}):up(); |
83 end |
83 end |
84 end |
84 end |
85 return reply; -- TODO cache disco reply |
85 return reply; -- TODO cache disco reply |
86 end |
86 end |