aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2010-06-13 18:13:18 +0500
committerWaqas Hussain <waqas20@gmail.com>2010-06-13 18:13:18 +0500
commit56973dec5cac985f010148029df0195cda8218db (patch)
tree47ae3e3fc375531d759eb3956788e2034f858998 /plugins
parent8fcc2761e665bfbb50dd8a48a6de7e8f894964a8 (diff)
downloadprosody-56973dec5cac985f010148029df0195cda8218db.tar.gz
prosody-56973dec5cac985f010148029df0195cda8218db.zip
MUC: Added room:get_password() and room:set_password().
Diffstat (limited to 'plugins')
-rw-r--r--plugins/muc/muc.lib.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index 273e21ce..813a071c 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -236,6 +236,15 @@ local function build_unavailable_presence_from_error(stanza)
:tag('status'):text(error_message);
end
+function room_mt:set_password(password)
+ if password == "" or type(password) ~= "string" then password = nil; end
+ self._data.password = password;
+ return password;
+end
+function room_mt:get_password()
+ return self._data.password;
+end
+
function room_mt:handle_to_occupant(origin, stanza) -- PM, vCards, etc
local from, to = stanza.attr.from, stanza.attr.to;
local room = jid_bare(to);