Mercurial > prosody-modules
changeset 2756:dbba101601b4
mod_smacks: Fix #921
See also https://mail.jabber.org/pipermail/standards/2017-May/032773.html
author | tmolitor <thilo@eightysoft.de> |
---|---|
date | Sun, 27 Aug 2017 21:34:48 +0200 |
parents | dbab58abd3e2 |
children | 595d9d68fd11 |
files | mod_smacks/mod_smacks.lua |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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;