diff mod_presence_cache/mod_presence_cache.lua @ 2146:39d958f4a0c3

mod_presence_cache: Remove caching of full presence
author Kim Alvefur <zash@zash.se>
date Fri, 01 Apr 2016 15:15:56 +0200
parents f965f86a5cad
children ed2bb50d4f91
line wrap: on
line diff
--- 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);