aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2022-01-10 16:53:58 +0100
committerKim Alvefur <zash@zash.se>2022-01-10 16:53:58 +0100
commitbdd8dddff5161776e864f6a82ab47dab162c6f38 (patch)
tree9d473ff419d88d621af90f8a95249b8b231e2b88 /plugins
parente65e3cad0fe68301e83be7686ed881fd7547061b (diff)
downloadprosody-bdd8dddff5161776e864f6a82ab47dab162c6f38.tar.gz
prosody-bdd8dddff5161776e864f6a82ab47dab162c6f38.zip
mod_storage_xep0227: Fix writing non-user data
Attempt to concatenate nil 'user' Not much data actually makes sense but the migrator tries to write or clear these.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_storage_xep0227.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/mod_storage_xep0227.lua b/plugins/mod_storage_xep0227.lua
index 8b4a6a3e..fa6bffc7 100644
--- a/plugins/mod_storage_xep0227.lua
+++ b/plugins/mod_storage_xep0227.lua
@@ -7,6 +7,7 @@ local os_remove = os.remove;
local io_open = io.open;
local jid_bare = require "util.jid".bare;
local jid_prep = require "util.jid".prep;
+local jid_join = require "util.jid".join;
local array = require "util.array";
local base64 = require "util.encodings".base64;
@@ -21,7 +22,7 @@ local parse_xml_real = require "util.xml".parse;
local lfs = require "lfs";
local function default_get_user_xml(self, user, host) --luacheck: ignore 212/self
- local jid = user.."@"..host;
+ local jid = jid_join(user, host);
local path = paths.join(prosody.paths.data, jid..".xml");
local f, err = io_open(path);
if not f then
@@ -34,7 +35,7 @@ local function default_get_user_xml(self, user, host) --luacheck: ignore 212/sel
return parse_xml_real(s);
end
local function default_set_user_xml(user, host, xml)
- local jid = user.."@"..host;
+ local jid = jid_join(user, host);
local path = paths.join(prosody.paths.data, jid..".xml");
local f, err = io_open(path, "w");
if not f then return f, err; end