mod_http_roster_admin: No need to manually purge.

Wed, 15 Mar 2017 08:53:30 +0000

author
JC Brand <jc@opkode.com>
date
Wed, 15 Mar 2017 08:53:30 +0000
changeset 2621
c4c51e43b788
parent 2620
8b8cab2eb7fc
child 2622
ac3ca6233ded

mod_http_roster_admin: No need to manually purge.

mod_storage_memory now has the `auto_purge_enabled` option which does the job.

mod_http_roster_admin/mod_http_roster_admin.lua file | annotate | diff | comparison | revisions
--- a/mod_http_roster_admin/mod_http_roster_admin.lua	Tue Mar 14 17:46:51 2017 +0000
+++ b/mod_http_roster_admin/mod_http_roster_admin.lua	Wed Mar 15 08:53:30 2017 +0000
@@ -294,15 +294,6 @@
 	return true;
 end
 
-module:hook("resource-unbind", function (event)
-	local user_bare_jid = event.session.username.."@"..event.session.host;
-	if not bare_sessions[user_bare_jid] then -- User went offline
-		-- We don't need this user's info cached anymore, clear it.
-		module:log("debug", "Purging the roster for %s", user_bare_jid);
-		storagemanager.open(event.session.host, "roster", "keyval").store[event.session.username] = nil;
-	end
-end);
-
 module:provides("http", {
 	route = {
 		["POST /refresh"] = handle_refresh_multi;

mercurial