Changeset

8387:7d61431e1aa6

MUC: Cache names of public rooms on eviction
author Kim Alvefur <zash@zash.se>
date Thu, 09 Nov 2017 17:27:52 +0100
parents 8386:9d5eb384daa8
children 8389:5d866eb8f18f
files plugins/muc/mod_muc.lua
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/muc/mod_muc.lua	Thu Nov 09 17:27:37 2017 +0100
+++ b/plugins/muc/mod_muc.lua	Thu Nov 09 17:27:52 2017 +0100
@@ -118,6 +118,7 @@
 local rooms = cache.new(module:get_option_number("muc_room_cache_size", 100), function (jid, room)
 	module:log("debug", "Evicting room %s", jid);
 	eviction_hit_rate();
+	room_items_cache[room.jid] = room:get_public() and room:get_name() or nil;
 	room_save(room, nil, true); -- Force to disk
 end);