Software /
code /
prosody-modules
Diff
mod_presence_cache/mod_presence_cache.lua @ 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 |
parent | 3183:b718092e442f |
child | 3760:830a01443a2f |
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