# HG changeset patch # User tmolitor # Date 1503862488 -7200 # Node ID dbba101601b4dea428b8d684409722c25892c3e9 # Parent dbab58abd3e26b389b62748170ddf3f9a99bc82b mod_smacks: Fix #921 See also https://mail.jabber.org/pipermail/standards/2017-May/032773.html diff -r dbab58abd3e2 -r dbba101601b4 mod_smacks/mod_smacks.lua --- a/mod_smacks/mod_smacks.lua Sun Aug 27 21:16:37 2017 +0200 +++ b/mod_smacks/mod_smacks.lua Sun Aug 27 21:34:48 2017 +0200 @@ -15,6 +15,7 @@ local dep = require "util.dependencies"; local cache = dep.softreq("util.cache"); -- only available in prosody 0.10+ local uuid_generate = require "util.uuid".generate; +local jid = require "util.jid"; local t_insert, t_remove = table.insert, table.remove; local math_min = math.min; @@ -192,7 +193,11 @@ cached_stanza._cached = true; if cached_stanza and cached_stanza.name ~= "iq" and cached_stanza:get_child("delay", xmlns_delay) == nil then - cached_stanza = cached_stanza:tag("delay", { xmlns = xmlns_delay, from = session.host, stamp = datetime.datetime()}); + cached_stanza = cached_stanza:tag("delay", { + xmlns = xmlns_delay, + from = jid.bare(session.full_jid or session.host), + stamp = datetime.datetime() + }); end queue[#queue+1] = cached_stanza;