mod_storage_xep0227: Correctly report that only key-value stores are supported
authorKim Alvefur <zash@zash.se>
Thu, 19 Oct 2017 12:21:49 +0200
changeset 8353 3ca11d408382
parent 8352 2342eccf4a88
child 8354 cc05b6366576
mod_storage_xep0227: Correctly report that only key-value stores are supported
plugins/mod_storage_xep0227.lua
--- a/plugins/mod_storage_xep0227.lua	Wed Oct 25 01:32:30 2017 +0200
+++ b/plugins/mod_storage_xep0227.lua	Thu Oct 19 12:21:49 2017 +0200
@@ -168,6 +168,7 @@
 local driver = {};
 
 function driver:open(datastore, typ)
+	if typ and typ ~= "keyval" then return nil, "unsupported-store"; end
 	local handler = handlers[datastore];
 	if not handler then return nil, "unsupported-datastore"; end
 	local instance = setmetatable({ host = module.host; datastore = datastore; }, { __index = handler });