aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_storage_none.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2013-04-05 10:01:02 +0100
committerMatthew Wild <mwild1@gmail.com>2013-04-05 10:01:02 +0100
commit35c29e6177000d7adc28fbc35e48293fc958a63b (patch)
tree3bbb92598c0acc6f9f6c73a512669866c4153f28 /plugins/mod_storage_none.lua
parentbd72dc3f8816eba31da05ade9c5ed8478571515b (diff)
downloadprosody-35c29e6177000d7adc28fbc35e48293fc958a63b.tar.gz
prosody-35c29e6177000d7adc28fbc35e48293fc958a63b.zip
mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Diffstat (limited to 'plugins/mod_storage_none.lua')
-rw-r--r--plugins/mod_storage_none.lua23
1 files changed, 23 insertions, 0 deletions
diff --git a/plugins/mod_storage_none.lua b/plugins/mod_storage_none.lua
new file mode 100644
index 00000000..8f2d2f56
--- /dev/null
+++ b/plugins/mod_storage_none.lua
@@ -0,0 +1,23 @@
+local driver = {};
+local driver_mt = { __index = driver };
+
+function driver:open(store)
+ return setmetatable({ store = store }, driver_mt);
+end
+function driver:get(user)
+ return {};
+end
+
+function driver:set(user, data)
+ return nil, "Storage disabled";
+end
+
+function driver:stores(username)
+ return { "roster" };
+end
+
+function driver:purge(user)
+ return true;
+end
+
+module:provides("storage", driver);