Comparison

plugins/muc/muc.lib.lua @ 3264:e1c787c6f86e

MUC: Added disco#info features to advertise room's anonymity status (muc_semianonymous or muc_nonanonymous).
author Waqas Hussain <waqas20@gmail.com>
date Sun, 13 Jun 2010 22:06:06 +0500
parent 3263:4973b737d4c7
child 3279:8b0a4a7d2c6e
comparison
equal deleted inserted replaced
3263:4973b737d4c7 3264:e1c787c6f86e
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 :tag("feature", {var=self:is_members_only() and "muc_membersonly" or "muc_open"}):up()
217 :tag("feature", {var=self:is_persistent() and "muc_persistent" or "muc_temporary"}):up() 217 :tag("feature", {var=self:is_persistent() and "muc_persistent" or "muc_temporary"}):up()
218 :tag("feature", {var=self:is_hidden() and "muc_hidden" or "muc_public"}):up() 218 :tag("feature", {var=self:is_hidden() and "muc_hidden" or "muc_public"}):up()
219 :tag("feature", {var=self._data.whois ~= "anyone" and "muc_semianonymous" or "muc_nonanonymous"}):up()
219 ; 220 ;
220 end 221 end
221 function room_mt:get_disco_items(stanza) 222 function room_mt:get_disco_items(stanza)
222 local reply = st.reply(stanza):query("http://jabber.org/protocol/disco#items"); 223 local reply = st.reply(stanza):query("http://jabber.org/protocol/disco#items");
223 for room_jid in pairs(self._occupants) do 224 for room_jid in pairs(self._occupants) do