# HG changeset patch # User Kim Alvefur # Date 1459516556 -7200 # Node ID 39d958f4a0c382ed7f8f47dda8519605c6c09c6b # Parent f965f86a5cad6ec5f338267fb1580fb261200122 mod_presence_cache: Remove caching of full presence diff -r f965f86a5cad -r 39d958f4a0c3 mod_presence_cache/README.markdown --- a/mod_presence_cache/README.markdown Fri Apr 01 15:11:25 2016 +0200 +++ b/mod_presence_cache/README.markdown Fri Apr 01 15:15:56 2016 +0200 @@ -13,10 +13,6 @@ client is doubled, as the client would get both the cached stanzas and replies to presence probes. Also see [mod\_throttle\_presence]. -By default, only binary (online or offline) state is stored. It can -optionally store the full presence but this requires much more memory -and bandwidth. - Configuration ============= @@ -30,12 +26,8 @@ Advanced configuration ====================== -To enable *experimental* full stanza caching: - presence_cache_full = false -This will usually double the presence data sent to clients, pending -support for deduplication. TODO ==== diff -r f965f86a5cad -r 39d958f4a0c3 mod_presence_cache/mod_presence_cache.lua --- a/mod_presence_cache/mod_presence_cache.lua Fri Apr 01 15:11:25 2016 +0200 +++ b/mod_presence_cache/mod_presence_cache.lua Fri Apr 01 15:15:56 2016 +0200 @@ -6,8 +6,6 @@ local presence_cache = {}; -- Reload to empty -local cache_full = module:get_option_boolean(module.name.."_full", false); - local function cache_hook(event) local origin, stanza = event.origin, event.stanza; local typ = stanza.attr.type; @@ -42,10 +40,6 @@ presence_cache[username] = nil; end end - elseif cache_full then - stanza = st.clone(stanza); - stanza:tag("delay", { xmlns = "urn:xmpp:delay", from = module.host, stamp = datetime.datetime() }):up(); - contact_presence_cache[from_jid] = stanza; else -- only cache binary state contact_presence_cache[from_jid] = datetime.datetime(); end @@ -77,9 +71,6 @@ end origin.send(presence); end - if cache_full then - return true; - end end module:hook("pre-presence/bare", answer_probe_from_cache, 10);