mod_auth_internal_hashed: Log calls to provider methods and be consistent with mod_au...
[prosody.git] / plugins / mod_storage_internal.lua
index d8fdfc6f35764314d39a87ab5aca9e24c3273a07..972ecbee33d1b1a71c7f5a8b582ff6bb4c99c6ec 100644 (file)
@@ -2,11 +2,11 @@ local datamanager = require "core.storagemanager".olddm;
 
 local host = module.host;
 
-local driver = { name = "internal" };
+local driver = {};
 local driver_mt = { __index = driver };
 
-function driver:open(store)
-       return setmetatable({ store = store }, driver_mt);
+function driver:open(store, typ)
+       return setmetatable({ store = store, type = typ }, driver_mt);
 end
 function driver:get(user)
        return datamanager.load(user, host, self.store);
@@ -20,8 +20,12 @@ function driver:stores(username)
        return datamanager.stores(username, host);
 end
 
+function driver:users()
+       return datamanager.users(host, self.store, self.type);
+end
+
 function driver:purge(user)
        return datamanager.purge(user, host);
 end
 
-module:add_item("data-driver", driver);
+module:provides("storage", driver);