Skip to content

Instantly share code, notes, and snippets.

@alexalouit
Created December 5, 2016 23:35
Show Gist options
  • Save alexalouit/3dc83548f642dd63b35606340fd97b86 to your computer and use it in GitHub Desktop.
Save alexalouit/3dc83548f642dd63b35606340fd97b86 to your computer and use it in GitHub Desktop.
Metronome XMPP XEP-0045 (mod_muc): allow anonymous to create chat room
diff -ruN mod_muc.lua.orig mod_muc.lua
--- mod_muc.lua.orig 2016-12-06 00:33:20.276048023 +0100
+++ mod_muc.lua 2016-12-05 23:33:31.013246048 +0100
@@ -201,7 +201,8 @@
return true;
end
local from_host = jid_section(stanza.attr.from, "host");
- if not origin.is_anonymous and
+-- if not origin.is_anonymous and
+ if
(not restrict_room_creation or (restrict_room_creation == "admin" and is_admin(stanza.attr.from)) or
(restrict_room_creation == "local" and from_host == module.host:gsub("^[^%.]+%.", ""))) then
room = muc_new_room(bare);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment