X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=plugins%2Fmod_groups.lua;h=f7f632c230564697a68ac314621ed10aa33c737a;hb=136f1107f5b9553c7ae040f5321494a7e65f50b8;hp=7a876f1d6845a67f4e69f57d4564cdd73e086176;hpb=03155b96e17626e8b93a7834c0500133730e064a;p=prosody.git diff --git a/plugins/mod_groups.lua b/plugins/mod_groups.lua index 7a876f1d..f7f632c2 100644 --- a/plugins/mod_groups.lua +++ b/plugins/mod_groups.lua @@ -13,7 +13,7 @@ local members; local groups_file; local jid, datamanager = require "util.jid", require "util.datamanager"; -local jid_bare, jid_prep = jid.bare, jid.prep; +local jid_prep = jid.prep; local module_host = module:get_host(); @@ -80,7 +80,7 @@ function remove_virtual_contacts(username, host, datastore, data) end function module.load() - groups_file = config.get(module:get_host(), "core", "groups_file"); + groups_file = module:get_option_string("groups_file"); if not groups_file then return; end module:hook("roster-load", inject_roster_contacts); @@ -121,3 +121,8 @@ end function module.unload() datamanager.remove_callback(remove_virtual_contacts); end + +-- Public for other modules to access +function group_contains(group_name, jid) + return groups[group_name][jid]; +end