Annotate

plugins/mod_storage_none.lua @ 6269:f89d2dec2977

plugins/muc/muc.lib: Fix incorrect whois logic (thanks mva)
author daurnimator <quae@daurnimator.com>
date Sun, 01 Jun 2014 15:40:04 -0400
parent 5425:b00812c6daf8
child 6283:7cf6d3a2c855
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5425
b00812c6daf8 mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
1 local driver = {};
b00812c6daf8 mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
2 local driver_mt = { __index = driver };
b00812c6daf8 mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
3
b00812c6daf8 mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
4 function driver:open(store)
b00812c6daf8 mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
5 return setmetatable({ store = store }, driver_mt);
b00812c6daf8 mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
6 end
b00812c6daf8 mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
7 function driver:get(user)
b00812c6daf8 mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
8 return {};
b00812c6daf8 mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
9 end
b00812c6daf8 mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
10
b00812c6daf8 mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
11 function driver:set(user, data)
b00812c6daf8 mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
12 return nil, "Storage disabled";
b00812c6daf8 mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
13 end
b00812c6daf8 mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
14
b00812c6daf8 mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
15 function driver:stores(username)
b00812c6daf8 mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
16 return { "roster" };
b00812c6daf8 mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
17 end
b00812c6daf8 mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
18
b00812c6daf8 mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
19 function driver:purge(user)
b00812c6daf8 mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
20 return true;
b00812c6daf8 mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
21 end
b00812c6daf8 mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
22
b00812c6daf8 mod_storage_none: A null-like storage provider that returns all stores as empty, and fails to save anything to them
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
23 module:provides("storage", driver);