Software /
code /
prosody
Annotate
plugins/mod_storage_none.lua @ 5949:a9abbdeddbf3
net.server_select: Don't remove the socket from sendlist when we might have data in the buffer (we'll now let sendbuffer() take care of that) (thanks daurnimator)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Mon, 16 Dec 2013 23:31:43 +0000 |
parent | 5425:b00812c6daf8 |
child | 6283:7cf6d3a2c855 |
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); |