Software / code / prosody
Comparison
plugins/mod_invites_register.lua @ 12285:ed23bbf3b946
mod_invites_register: Load mod_register_ibr in invite only mode
This ensures that registration actually works even if allow_registration
is not enabled.
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Thu, 10 Feb 2022 21:21:03 +0100 |
| parent | 12284:b4424f131d5c |
| child | 12329:c980210ca095 |
comparison
equal
deleted
inserted
replaced
| 12284:b4424f131d5c | 12285:ed23bbf3b946 |
|---|---|
| 8 local invite_only = module:get_option_boolean("registration_invite_only", true); | 8 local invite_only = module:get_option_boolean("registration_invite_only", true); |
| 9 | 9 |
| 10 local invites; | 10 local invites; |
| 11 if prosody.process_type == "prosody" then | 11 if prosody.process_type == "prosody" then |
| 12 invites = module:depends("invites"); | 12 invites = module:depends("invites"); |
| 13 | |
| 14 if invite_only then | |
| 15 module:depends("register_ibr"); | |
| 16 end | |
| 13 end | 17 end |
| 14 | 18 |
| 15 local legacy_invite_stream_feature = st.stanza("register", { xmlns = "urn:xmpp:invite" }):up(); | 19 local legacy_invite_stream_feature = st.stanza("register", { xmlns = "urn:xmpp:invite" }):up(); |
| 16 local invite_stream_feature = st.stanza("register", { xmlns = "urn:xmpp:ibr-token:0" }):up(); | 20 local invite_stream_feature = st.stanza("register", { xmlns = "urn:xmpp:ibr-token:0" }):up(); |
| 17 module:hook("stream-features", function(event) | 21 module:hook("stream-features", function(event) |