Software /
code /
prosody
Comparison
plugins/mod_storage_xep0227.lua @ 8350:3ca11d408382
mod_storage_xep0227: Correctly report that only key-value stores are supported
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 19 Oct 2017 12:21:49 +0200 |
parent | 6704:03afecdf2e3c |
child | 8351:cc05b6366576 |
comparison
equal
deleted
inserted
replaced
8349:2342eccf4a88 | 8350:3ca11d408382 |
---|---|
166 | 166 |
167 ----------------------------- | 167 ----------------------------- |
168 local driver = {}; | 168 local driver = {}; |
169 | 169 |
170 function driver:open(datastore, typ) | 170 function driver:open(datastore, typ) |
171 if typ and typ ~= "keyval" then return nil, "unsupported-store"; end | |
171 local handler = handlers[datastore]; | 172 local handler = handlers[datastore]; |
172 if not handler then return nil, "unsupported-datastore"; end | 173 if not handler then return nil, "unsupported-datastore"; end |
173 local instance = setmetatable({ host = module.host; datastore = datastore; }, { __index = handler }); | 174 local instance = setmetatable({ host = module.host; datastore = datastore; }, { __index = handler }); |
174 if instance.init then instance:init(); end | 175 if instance.init then instance:init(); end |
175 return instance; | 176 return instance; |