projects
/
prosody.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e7fa23b
)
Added: Datastore support for hosts and global data in addition to users
author
Waqas Hussain
<waqas20@gmail.com>
Wed, 8 Oct 2008 20:20:43 +0000
(
01:20
+0500)
committer
Waqas Hussain
<waqas20@gmail.com>
Wed, 8 Oct 2008 20:20:43 +0000
(
01:20
+0500)
util/datamanager.lua
patch
|
blob
|
history
diff --git
a/util/datamanager.lua
b/util/datamanager.lua
index be63673e80d090ec59567a06eb1c3df5e4755830..adc320a9ecbf0487c682dc5324d85b8d1f61433d 100644
(file)
--- a/
util/datamanager.lua
+++ b/
util/datamanager.lua
@@
-56,7
+56,13
@@
local function simplesave (f, o)
------- API -------------
function getpath(username, host, datastore)
- return format("data/%s/%s/%s.dat", encode(host), datastore, encode(username));
+ if username then
+ return format("data/%s/%s/%s.dat", encode(host), datastore, encode(username));
+ elseif host then
+ return format("data/%s/%s.dat", encode(host), datastore);
+ else
+ return format("data/%s.dat", datastore);
+ end
end
function load(username, host, datastore)