Software /
code /
prosody
Changeset
84:d0a0bac6815e
Added: Datastore support for hosts and global data in addition to users
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Thu, 09 Oct 2008 01:20:43 +0500 |
parents | 83:79608fc8f98d |
children | 85:a115b99419ad |
files | util/datamanager.lua |
diffstat | 1 files changed, 7 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/util/datamanager.lua Thu Oct 09 01:18:48 2008 +0500 +++ b/util/datamanager.lua Thu Oct 09 01:20:43 2008 +0500 @@ -56,7 +56,13 @@ ------- 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)