aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-12-23 15:34:19 +0100
committerKim Alvefur <zash@zash.se>2018-12-23 15:34:19 +0100
commit36ac4d0ad5bd5d2623e0c83a69899cbd0926315e (patch)
treea8294834db6faf39e642040aa0b0d5b78390bebb /plugins
parent0a11d53f81d33de026024e624f062cf73f6fd006 (diff)
parent76fa7586ef490a4a6ea87a541ed1a5f09aa1f272 (diff)
downloadprosody-36ac4d0ad5bd5d2623e0c83a69899cbd0926315e.tar.gz
prosody-36ac4d0ad5bd5d2623e0c83a69899cbd0926315e.zip
Merge 0.11->trunk
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_mam/mamprefsxml.lib.lua14
1 files changed, 10 insertions, 4 deletions
diff --git a/plugins/mod_mam/mamprefsxml.lib.lua b/plugins/mod_mam/mamprefsxml.lib.lua
index 8eee78d8..c408fbea 100644
--- a/plugins/mod_mam/mamprefsxml.lib.lua
+++ b/plugins/mod_mam/mamprefsxml.lib.lua
@@ -2,6 +2,7 @@
-- Copyright (C) 2008-2017 Matthew Wild
-- Copyright (C) 2008-2017 Waqas Hussain
-- Copyright (C) 2011-2017 Kim Alvefur
+-- Copyright (C) 2018 Emmanuel Gil Peyrot
--
-- This project is MIT/X11 licensed. Please see the
-- COPYING file in the source package for more information.
@@ -10,6 +11,7 @@
--
local st = require"util.stanza";
+local jid_prep = require"util.jid".prep;
local xmlns_mam = "urn:xmpp:mam:2";
local default_attrs = {
@@ -42,16 +44,20 @@ local function fromstanza(prefstanza)
local always = prefstanza:get_child("always");
if always then
for rule in always:childtags("jid") do
- local jid = rule:get_text();
- prefs[jid] = true;
+ local jid = jid_prep(rule:get_text());
+ if jid then
+ prefs[jid] = true;
+ end
end
end
local never = prefstanza:get_child("never");
if never then
for rule in never:childtags("jid") do
- local jid = rule:get_text();
- prefs[jid] = false;
+ local jid = jid_prep(rule:get_text());
+ if jid then
+ prefs[jid] = false;
+ end
end
end