MUC: Added disco#info features to advertise room's password protection (muc_passwordprotected or muc_unsecured, depending on whether a password is set).

Sun, 13 Jun 2010 18:29:26 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Sun, 13 Jun 2010 18:29:26 +0500
changeset 3246
3371419eb0e1
parent 3245
a8a4c87a4fbf
child 3247
ee8aaca3226c

MUC: Added disco#info features to advertise room's password protection (muc_passwordprotected or muc_unsecured, depending on whether a password is set).

plugins/muc/muc.lib.lua file | annotate | diff | comparison | revisions
--- a/plugins/muc/muc.lib.lua	Sun Jun 13 18:14:46 2010 +0500
+++ b/plugins/muc/muc.lib.lua	Sun Jun 13 18:29:26 2010 +0500
@@ -206,7 +206,9 @@
 function room_mt:get_disco_info(stanza)
 	return st.reply(stanza):query("http://jabber.org/protocol/disco#info")
 		:tag("identity", {category="conference", type="text"}):up()
-		:tag("feature", {var="http://jabber.org/protocol/muc"});
+		:tag("feature", {var="http://jabber.org/protocol/muc"}):up()
+		:tag("feature", {var=self:get_password() and "muc_passwordprotected" or "muc_unsecured"}):up()
+	;
 end
 function room_mt:get_disco_items(stanza)
 	local reply = st.reply(stanza):query("http://jabber.org/protocol/disco#items");

mercurial