Diff

mod_smacks/mod_smacks.lua @ 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
parent 2744:f70c02c14161
child 2937:e672d1050529
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;