Comparison

plugins/muc/muc.lib.lua @ 3257:fae054e15e03

MUC: Added disco#info features to advertise room's members-only status (muc_membersonly or muc_open).
author Waqas Hussain <waqas20@gmail.com>
date Sun, 13 Jun 2010 20:55:07 +0500
parent 3256:d96172f78ec2
child 3258:bc07564bec6d
comparison
equal deleted inserted replaced
3256:d96172f78ec2 3257:fae054e15e03
211 return st.reply(stanza):query("http://jabber.org/protocol/disco#info") 211 return st.reply(stanza):query("http://jabber.org/protocol/disco#info")
212 :tag("identity", {category="conference", type="text"}):up() 212 :tag("identity", {category="conference", type="text"}):up()
213 :tag("feature", {var="http://jabber.org/protocol/muc"}):up() 213 :tag("feature", {var="http://jabber.org/protocol/muc"}):up()
214 :tag("feature", {var=self:get_password() and "muc_passwordprotected" or "muc_unsecured"}):up() 214 :tag("feature", {var=self:get_password() and "muc_passwordprotected" or "muc_unsecured"}):up()
215 :tag("feature", {var=self:is_moderated() and "muc_moderated" or "muc_unmoderated"}):up() 215 :tag("feature", {var=self:is_moderated() and "muc_moderated" or "muc_unmoderated"}):up()
216 :tag("feature", {var=self:is_members_only() and "muc_membersonly" or "muc_open"}):up()
216 ; 217 ;
217 end 218 end
218 function room_mt:get_disco_items(stanza) 219 function room_mt:get_disco_items(stanza)
219 local reply = st.reply(stanza):query("http://jabber.org/protocol/disco#items"); 220 local reply = st.reply(stanza):query("http://jabber.org/protocol/disco#items");
220 for room_jid in pairs(self._occupants) do 221 for room_jid in pairs(self._occupants) do