diff options
author | Matthew Wild <mwild1@gmail.com> | 2025-02-06 17:37:59 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2025-02-06 17:37:59 +0000 |
commit | 3d61988313d632dd5739a71119bd142fcd9c636b (patch) | |
tree | 3b4401d946aa7a36d40681de9ee0fd50472b9ae8 /plugins | |
parent | 857c61ffd3b8411ca27733d698d095ccb0d4c996 (diff) | |
download | prosody-3d61988313d632dd5739a71119bd142fcd9c636b.tar.gz prosody-3d61988313d632dd5739a71119bd142fcd9c636b.zip |
mod_vcard: Switch store name for MUC hosts (thanks lissine)
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_vcard.lua | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/plugins/mod_vcard.lua b/plugins/mod_vcard.lua index 4cb14f81..dfd43363 100644 --- a/plugins/mod_vcard.lua +++ b/plugins/mod_vcard.lua @@ -12,11 +12,17 @@ local sha1 = require "prosody.util.hashes".sha1; local st = require "prosody.util.stanza" local jid_split = require "prosody.util.jid".split; -local vcards = module:open_store(); +local store_name = module:get_option_string("vcard_store_name"); + +local is_component = module:get_host_type() == "component"; +if is_component and not store_name and module:get_option_string("component_module") == "muc" then + store_name = "vcard_muc"; +end + +local vcards = module:open_store(store_name); module:add_feature("vcard-temp"); -local is_component = module:get_host_type() == "component"; local function handle_vcard(event) local session, stanza = event.origin, event.stanza; |