moduleapi: in module:provides(), add the name of the module in item._provided_by
[prosody.git] / plugins / mod_groups.lua
index 7a876f1d6845a67f4e69f57d4564cdd73e086176..f7f632c230564697a68ac314621ed10aa33c737a 100644 (file)
@@ -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