diff options
author | Waqas Hussain <waqas20@gmail.com> | 2008-10-09 01:20:43 +0500 |
---|---|---|
committer | Waqas Hussain <waqas20@gmail.com> | 2008-10-09 01:20:43 +0500 |
commit | 4202397776bb1c34a5accb5de9cd0d58337b79b0 (patch) | |
tree | 8be13d6efa3b828fa63639450916a72f85c22ae0 /util | |
parent | 1c366baed7725a746e75a041fc161c7b7aec2d7e (diff) | |
download | prosody-4202397776bb1c34a5accb5de9cd0d58337b79b0.tar.gz prosody-4202397776bb1c34a5accb5de9cd0d58337b79b0.zip |
Added: Datastore support for hosts and global data in addition to users
Diffstat (limited to 'util')
-rw-r--r-- | util/datamanager.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/util/datamanager.lua b/util/datamanager.lua index be63673e..adc320a9 100644 --- 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) |