projects
/
prosody.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
555497b
)
mod_storage_xep0227: Open file for writing even if removing so os.remove has a file...
author
Kim Alvefur
<zash@zash.se>
Fri, 15 May 2015 13:25:37 +0000
(15:25 +0200)
committer
Kim Alvefur
<zash@zash.se>
Fri, 15 May 2015 13:25:37 +0000
(15:25 +0200)
plugins/mod_storage_xep0227.lua
patch
|
blob
|
history
diff --git
a/plugins/mod_storage_xep0227.lua
b/plugins/mod_storage_xep0227.lua
index b41fc6cee70b47eeaae66f96780b2754755b5be9..22575fe32dacfbdef0c8779daf5e8b25804d460c 100644
(file)
--- a/
plugins/mod_storage_xep0227.lua
+++ b/
plugins/mod_storage_xep0227.lua
@@
-23,14
+23,15
@@
end
local function setXml(user, host, xml)
local jid = user.."@"..host;
local path = paths.join(prosody.paths.data, jid..".xml");
+ local f = io_open(path, "w");
+ if not f then return; end
if xml then
- local f = io_open(path, "w");
- if not f then return; end
local s = tostring(xml);
f:write(s);
f:close();
return true;
else
+ f:close();
return os_remove(path);
end
end