aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/muc')
-rw-r--r--plugins/muc/password.lib.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/muc/password.lib.lua b/plugins/muc/password.lib.lua
index 7edab767..fb603d88 100644
--- a/plugins/muc/password.lib.lua
+++ b/plugins/muc/password.lib.lua
@@ -65,6 +65,14 @@ module:hook("muc-invite", function(event)
end
end);
+module:hook("muc-room-pre-create", function (event)
+ local stanza, room = event.stanza, event.room;
+ local muc_x = stanza:get_child("x", "http://jabber.org/protocol/muc");
+ if not muc_x then return end
+ local password = muc_x:get_child_text("password", "http://jabber.org/protocol/muc");
+ set_password(room, password);
+end);
+
return {
get = get_password;
set = set_password;