projects
/
prosody.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2f21a52
)
MUC: Wrap "support" for the groupchat 1.0 join protocol in a config option to allow...
author
Kim Alvefur
<zash@zash.se>
Mon, 18 Apr 2016 17:20:51 +0000
(19:20 +0200)
committer
Kim Alvefur
<zash@zash.se>
Mon, 18 Apr 2016 17:20:51 +0000
(19:20 +0200)
plugins/muc/muc.lib.lua
patch
|
blob
|
history
diff --git
a/plugins/muc/muc.lib.lua
b/plugins/muc/muc.lib.lua
index 0ea24c08385c8141d7c394537a1b21c4812d6c5b..a7a968650d72bef06245461e49e268b0953e2e96 100644
(file)
--- a/
plugins/muc/muc.lib.lua
+++ b/
plugins/muc/muc.lib.lua
@@
-357,6
+357,16
@@
function room_mt:handle_kickable(origin, stanza) -- luacheck: ignore 212
return true;
end
return true;
end
+if not module:get_option_boolean("muc_compat_create", true) then
+ module:hook("muc-room-pre-create", function(event)
+ local origin, stanza = event.origin, event.stanza;
+ if not stanza:get_child("x", "http://jabber.org/protocol/muc") then
+ origin.send(st.error_reply(stanza, "cancel", "item-not-found"));
+ return true;
+ end
+ end, -1);
+end
+
-- Give the room creator owner affiliation
module:hook("muc-room-pre-create", function(event)
event.room:set_affiliation(true, jid_bare(event.stanza.attr.from), "owner");
-- Give the room creator owner affiliation
module:hook("muc-room-pre-create", function(event)
event.room:set_affiliation(true, jid_bare(event.stanza.attr.from), "owner");