aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2015-05-15 15:29:05 +0200
committerKim Alvefur <zash@zash.se>2015-05-15 15:29:05 +0200
commitf10a0325075702d86c763e3f495f9c35d89801a1 (patch)
tree22dcedd653b6613d9f559cc91484c42c4a81f660
parent33c20a1220a3ca8a0c7ea35702a914d2c10a30c5 (diff)
downloadprosody-f10a0325075702d86c763e3f495f9c35d89801a1.tar.gz
prosody-f10a0325075702d86c763e3f495f9c35d89801a1.zip
mod_storage_xep0227: Update open method for current API
-rw-r--r--plugins/mod_storage_xep0227.lua11
1 files changed, 3 insertions, 8 deletions
diff --git a/plugins/mod_storage_xep0227.lua b/plugins/mod_storage_xep0227.lua
index 61ef7d6d..f3c6866c 100644
--- a/plugins/mod_storage_xep0227.lua
+++ b/plugins/mod_storage_xep0227.lua
@@ -150,15 +150,10 @@ handlers.private = {
-----------------------------
local driver = {};
-function driver:open(host, datastore, typ)
- local instance = setmetatable({}, self);
- instance.host = host;
- instance.datastore = datastore;
+function driver:open(datastore, typ)
local handler = handlers[datastore];
- if not handler then return nil; end
- for key,val in pairs(handler) do
- instance[key] = val;
- end
+ if not handler then return nil, "unsupported-datastore"; end
+ local instance = setmetatable({ host = module.host; datastore = datastore; }, { __index = handler });
if instance.init then instance:init(); end
return instance;
end