# HG changeset patch # User Maxime “pep” Buquet # Date 1588688879 -7200 # Node ID ae27f3359df86f4757153198fe86520baa0a828e # Parent 362997ededb18c91b905a8e5ff46db5b13c3c101 mod_muc_occupant_id: Don't store occupant-ids. It seems it's cheap enough to generate so don't unnecessarily store everyone's occupant-ids forever. diff -r 362997ededb1 -r ae27f3359df8 mod_muc_occupant_id/mod_muc_occupant_id.lua --- a/mod_muc_occupant_id/mod_muc_occupant_id.lua Fri May 01 22:24:10 2020 +0200 +++ b/mod_muc_occupant_id/mod_muc_occupant_id.lua Tue May 05 16:27:59 2020 +0200 @@ -17,16 +17,12 @@ room._data.occupant_id_salt = uuid.generate(); end - if room._data.occupant_ids == nil then - room._data.occupant_ids = {}; - end + -- XXX: Temporary not-so-important migration measure. Remove this next time + -- somebody looks at it. This module used to store every participant's + -- occupant-id all the time forever. + room._data.occupant_ids = nil; - if room._data.occupant_ids[bare] == nil then - local unique_id = b64encode(hmac_sha256(bare, room._data.occupant_id_salt)); - room._data.occupant_ids[bare] = unique_id; - end - - return room._data.occupant_ids[bare]; + return b64encode(hmac_sha256(bare, room._data.occupant_id_salt)); end local function update_occupant(event)