aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-09-21 02:36:28 +0200
committerKim Alvefur <zash@zash.se>2017-09-21 02:36:28 +0200
commit43e5d4df2985e069c52fb21e4636e3e44053d1bf (patch)
treeaf392dbae3065aa54b4a971eb3c368a74624958d /plugins
parent8cb654ff632fd09ca39941952bd09e2f5d45cecc (diff)
parent1574b7a818dfd40ba2fd5cb3ebf8687ba5a37a4d (diff)
downloadprosody-43e5d4df2985e069c52fb21e4636e3e44053d1bf.tar.gz
prosody-43e5d4df2985e069c52fb21e4636e3e44053d1bf.zip
Merge 0.10->trunk
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_mam/mod_mam.lua13
1 files changed, 6 insertions, 7 deletions
diff --git a/plugins/mod_mam/mod_mam.lua b/plugins/mod_mam/mod_mam.lua
index 298c770c..7499c9ea 100644
--- a/plugins/mod_mam/mod_mam.lua
+++ b/plugins/mod_mam/mod_mam.lua
@@ -67,20 +67,18 @@ end
module:hook("iq/self/"..xmlns_mam..":prefs", function(event)
local origin, stanza = event.origin, event.stanza;
local user = origin.username;
- if stanza.attr.type == "get" then
- local prefs = prefs_to_stanza(get_prefs(user));
- local reply = st.reply(stanza):add_child(prefs);
- origin.send(reply);
- else -- type == "set"
+ if stanza.attr.type == "set" then
local new_prefs = stanza:get_child("prefs", xmlns_mam);
local prefs = prefs_from_stanza(new_prefs);
local ok, err = set_prefs(user, prefs);
if not ok then
origin.send(st.error_reply(stanza, "cancel", "internal-server-error", "Error storing preferences: "..tostring(err)));
- else
- origin.send(st.reply(stanza));
+ return true;
end
end
+ local prefs = prefs_to_stanza(get_prefs(user));
+ local reply = st.reply(stanza):add_child(prefs);
+ origin.send(reply);
return true;
end);
@@ -294,6 +292,7 @@ local function message_handler(event, c2s)
end
end);
if #clone_for_storage.tags == 0 then
+ log("debug", "Not archiving stanza: %s (empty when stripped)", stanza:top_tag());
return;
end
else