Software /
code /
prosody
Diff
plugins/mod_storage_xep0227.lua @ 6697:3d27f5855f4b
mod_storage_xep0227: Use configured storage path
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 15 May 2015 15:16:03 +0200 |
parent | 6696:6d717795708a |
child | 6698:95a8aeca1fc9 |
line wrap: on
line diff
--- a/plugins/mod_storage_xep0227.lua Fri May 15 15:14:30 2015 +0200 +++ b/plugins/mod_storage_xep0227.lua Fri May 15 15:16:03 2015 +0200 @@ -7,12 +7,13 @@ local os_remove = os.remove; local io_open = io.open; +local paths = require"util.paths"; local st = require "util.stanza"; local parse_xml_real = require "util.xml".parse; local function getXml(user, host) local jid = user.."@"..host; - local path = "data/"..jid..".xml"; + local path = paths.join(prosody.paths.data, jid..".xml"); local f = io_open(path); if not f then return; end local s = f:read("*a"); @@ -20,7 +21,7 @@ end local function setXml(user, host, xml) local jid = user.."@"..host; - local path = "data/"..jid..".xml"; + local path = paths.join(prosody.paths.data, jid..".xml"); if xml then local f = io_open(path, "w"); if not f then return; end