Comparison

plugins/muc/muc.lib.lua @ 3246:3371419eb0e1

MUC: Added disco#info features to advertise room's password protection (muc_passwordprotected or muc_unsecured, depending on whether a password is set).
author Waqas Hussain <waqas20@gmail.com>
date Sun, 13 Jun 2010 18:29:26 +0500
parent 3245:a8a4c87a4fbf
child 3247:ee8aaca3226c
comparison
equal deleted inserted replaced
3245:a8a4c87a4fbf 3246:3371419eb0e1
204 end 204 end
205 205
206 function room_mt:get_disco_info(stanza) 206 function room_mt:get_disco_info(stanza)
207 return st.reply(stanza):query("http://jabber.org/protocol/disco#info") 207 return st.reply(stanza):query("http://jabber.org/protocol/disco#info")
208 :tag("identity", {category="conference", type="text"}):up() 208 :tag("identity", {category="conference", type="text"}):up()
209 :tag("feature", {var="http://jabber.org/protocol/muc"}); 209 :tag("feature", {var="http://jabber.org/protocol/muc"}):up()
210 :tag("feature", {var=self:get_password() and "muc_passwordprotected" or "muc_unsecured"}):up()
211 ;
210 end 212 end
211 function room_mt:get_disco_items(stanza) 213 function room_mt:get_disco_items(stanza)
212 local reply = st.reply(stanza):query("http://jabber.org/protocol/disco#items"); 214 local reply = st.reply(stanza):query("http://jabber.org/protocol/disco#items");
213 for room_jid in pairs(self._occupants) do 215 for room_jid in pairs(self._occupants) do
214 reply:tag("item", {jid = room_jid, name = room_jid:match("/(.*)")}):up(); 216 reply:tag("item", {jid = room_jid, name = room_jid:match("/(.*)")}):up();