Mercurial > prosody-modules
comparison mod_easy_invite/mod_easy_invite.lua @ 4088:439ae12bb136
mod_easy_invite: Remove hard dependency on mod_invites_page and allow configuration of different landing page module
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Mon, 07 Sep 2020 13:48:22 +0100 |
| parents | 50644402c6f5 |
| children |
comparison
equal
deleted
inserted
replaced
| 4087:88a469b285f5 | 4088:439ae12bb136 |
|---|---|
| 3 local datetime = require "util.datetime"; | 3 local datetime = require "util.datetime"; |
| 4 local jid_bare = require "util.jid".bare; | 4 local jid_bare = require "util.jid".bare; |
| 5 local jid_split = require "util.jid".split; | 5 local jid_split = require "util.jid".split; |
| 6 local split_jid = require "util.jid".split; | 6 local split_jid = require "util.jid".split; |
| 7 local rostermanager = require "core.rostermanager"; | 7 local rostermanager = require "core.rostermanager"; |
| 8 local modulemanager = require "core.modulemanager"; | |
| 8 local st = require "util.stanza"; | 9 local st = require "util.stanza"; |
| 9 | 10 |
| 10 local invite_only = module:get_option_boolean("registration_invite_only", true); | 11 local invite_only = module:get_option_boolean("registration_invite_only", true); |
| 11 local require_encryption = module:get_option_boolean("c2s_require_encryption", | 12 local require_encryption = module:get_option_boolean("c2s_require_encryption", |
| 12 module:get_option_boolean("require_encryption", false)); | 13 module:get_option_boolean("require_encryption", false)); |
| 245 assert(hosts[host], "Host "..tostring(host).." does not exist"); | 246 assert(hosts[host], "Host "..tostring(host).." does not exist"); |
| 246 sm.initialize_host(host); | 247 sm.initialize_host(host); |
| 247 | 248 |
| 248 -- Load mod_invites | 249 -- Load mod_invites |
| 249 invites = module:context(host):depends("invites"); | 250 invites = module:context(host):depends("invites"); |
| 250 module:context(host):depends("invites_page"); | 251 local invites_page_module = module:context(host):get_option_string("easy_invite_page_module", "invites_page"); |
| 252 if modulemanager.get_modules_for_host(host):contains(invites_page_module) then | |
| 253 module:context(host):depends(invites_page_module); | |
| 254 end | |
| 251 | 255 |
| 252 table.remove(arg, 1); | 256 table.remove(arg, 1); |
| 253 table.remove(arg, 1); | 257 table.remove(arg, 1); |
| 254 | 258 |
| 255 local invite, roles; | 259 local invite, roles; |
