Software /
code /
prosody
Diff
plugins/mod_storage_sql.lua @ 6283:7cf6d3a2c855
mod_storage_{none,internal,sql}: Return error for unsupported (everything but keyval) store types
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 20 Jun 2014 16:22:23 +0200 |
parent | 6165:6a184b16b717 |
child | 6951:99de8f30d99e |
line wrap: on
line diff
--- a/plugins/mod_storage_sql.lua Fri Jun 20 16:16:33 2014 +0200 +++ b/plugins/mod_storage_sql.lua Fri Jun 20 16:22:23 2014 +0200 @@ -380,10 +380,10 @@ local driver = {}; function driver:open(store, typ) - if not typ then -- default key-value store - return setmetatable({ store = store }, keyval_store); + if typ and typ ~= "keyval" then + return nil, "unsupported-store"; end - return nil, "unsupported-store"; + return setmetatable({ store = store }, keyval_store); end function driver:stores(username)