projects
/
prosody.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
util.pluginloader: Return full file path from internal file loader on success, not...
[prosody.git]
/
util
/
datamanager.lua
diff --git
a/util/datamanager.lua
b/util/datamanager.lua
index 5aee289d66cc47b572c99e60c909a2eaf2d3fcad..d5e9c88ca7ad0130b879060950d579420edb65d1 100644
(file)
--- a/
util/datamanager.lua
+++ b/
util/datamanager.lua
@@
-57,7
+57,7
@@
local function mkdir(path)
return path;
end
return path;
end
-local data_path =
prosody.paths.data
;
+local data_path =
(prosody and prosody.paths and prosody.paths.data) or "."
;
local callbacks = {};
------- API -------------
local callbacks = {};
------- API -------------
@@
-115,7
+115,7
@@
function load(username, host, datastore)
if not data then
local mode = lfs.attributes(getpath(username, host, datastore), "mode");
if not mode then
if not data then
local mode = lfs.attributes(getpath(username, host, datastore), "mode");
if not mode then
- log("debug", "
Failed to load
"..datastore.." storage ('"..ret.."') for user: "..(username or "nil").."@"..(host or "nil"));
+ log("debug", "
Assuming empty
"..datastore.." storage ('"..ret.."') for user: "..(username or "nil").."@"..(host or "nil"));
return nil;
else -- file exists, but can't be read
-- TODO more detailed error checking and logging?
return nil;
else -- file exists, but can't be read
-- TODO more detailed error checking and logging?
@@
-207,7
+207,7
@@
function list_load(username, host, datastore)
if not data then
local mode = lfs.attributes(getpath(username, host, datastore, "list"), "mode");
if not mode then
if not data then
local mode = lfs.attributes(getpath(username, host, datastore, "list"), "mode");
if not mode then
- log("debug", "
Failed to load
"..datastore.." storage ('"..ret.."') for user: "..(username or "nil").."@"..(host or "nil"));
+ log("debug", "
Assuming empty
"..datastore.." storage ('"..ret.."') for user: "..(username or "nil").."@"..(host or "nil"));
return nil;
else -- file exists, but can't be read
-- TODO more detailed error checking and logging?
return nil;
else -- file exists, but can't be read
-- TODO more detailed error checking and logging?