changeset 3373:322e8e7ba7d4

mod_presence_cache: Set delay source to bare JID instead of host Could be argued that this is more correct, since the cache is per user.
author Kim Alvefur <zash@zash.se>
date Wed, 07 Nov 2018 22:20:56 +0100
parents 866167118d23
children 5fdbf416bd40
files mod_presence_cache/mod_presence_cache.lua
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_presence_cache/mod_presence_cache.lua	Wed Nov 07 17:49:27 2018 +0100
+++ b/mod_presence_cache/mod_presence_cache.lua	Wed Nov 07 22:20:56 2018 +0100
@@ -86,13 +86,14 @@
 
 	local cached = bare_cache[bare_cache_key];
 	if not cached then return end
+	local user_bare = jid_bare(origin.full_jid);
 	for jid, presence_bits in pairs(cached) do
 		local presence = st.presence({ to = origin.full_jid, from = jid })
 		if presence_bits.show then
 			presence:tag("show"):text(presence_bits.show):up();
 		end
 		if presence_bits.stamp then
-			presence:tag("delay", { xmlns = "urn:xmpp:delay", from = module.host, stamp = presence_bits.stamp }):up();
+			presence:tag("delay", { xmlns = "urn:xmpp:delay", from = user_bare, stamp = presence_bits.stamp }):up();
 		end
 		origin.send(presence);
 	end