aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_mam/mod_mam.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-02-14 23:42:11 +0100
committerKim Alvefur <zash@zash.se>2017-02-14 23:42:11 +0100
commit885e117a1fe2f0a77d330c89ad5e44636f25815e (patch)
tree2b8a5826f55d17228f3c87145bc37f798272f98c /plugins/mod_mam/mod_mam.lua
parent89a1476a741679c8b39ec5443fd921fb26f338a3 (diff)
parent0d09c3499df3a314e2fcd6495d495fb69d30809f (diff)
downloadprosody-885e117a1fe2f0a77d330c89ad5e44636f25815e.tar.gz
prosody-885e117a1fe2f0a77d330c89ad5e44636f25815e.zip
Merge 0.10->trunk
Diffstat (limited to 'plugins/mod_mam/mod_mam.lua')
-rw-r--r--plugins/mod_mam/mod_mam.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/mod_mam/mod_mam.lua b/plugins/mod_mam/mod_mam.lua
index 44141409..81b0690c 100644
--- a/plugins/mod_mam/mod_mam.lua
+++ b/plugins/mod_mam/mod_mam.lua
@@ -12,6 +12,7 @@
local xmlns_mam = "urn:xmpp:mam:1";
local xmlns_delay = "urn:xmpp:delay";
local xmlns_forward = "urn:xmpp:forward:0";
+local xmlns_st_id = "urn:xmpp:sid:0";
local um = require "core.usermanager";
local st = require "util.stanza";
@@ -248,7 +249,7 @@ local function message_handler(event, c2s)
-- Filter out <stanza-id> that claim to be from us
stanza:maptags(function (tag)
- if tag.name == "stanza-id" and tag.attr.xmlns == "urn:xmpp:sid:0" then
+ if tag.name == "stanza-id" and tag.attr.xmlns == xmlns_st_id then
local by_user, by_host, res = jid_prepped_split(tag.attr.by);
if not res and by_host == module.host and by_user == store_user then
return nil;
@@ -293,7 +294,7 @@ local function message_handler(event, c2s)
-- And stash it
local ok, id = archive:append(store_user, nil, stanza, time_now(), with);
if ok then
- stanza:tag("stanza-id", { xmlns = "urn:xmpp:sid:0", by = store_user.."@"..host, id = id }):up();
+ stanza:tag("stanza-id", { xmlns = xmlns_st_id, by = store_user.."@"..host, id = id }):up();
if cleanup then cleanup[store_user] = true; end
module:fire_event("archive-message-added", { origin = origin, stanza = stanza, for_user = store_user, id = id });
end
@@ -365,5 +366,6 @@ module:hook("message/full", message_handler, 0);
module:hook("account-disco-info", function(event)
(event.reply or event.stanza):tag("feature", {var=xmlns_mam}):up();
+ (event.reply or event.stanza):tag("feature", {var=xmlns_st_id}):up();
end);