From f6efb7e00f49c6133e687074e045c114ff247e00 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 29 Dec 2017 20:49:19 +0100 Subject: rostermanager: Explicitly remove old-style 'pending' table from rosters (or it stays forever due to map stores) --- core/rostermanager.lua | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'core/rostermanager.lua') diff --git a/core/rostermanager.lua b/core/rostermanager.lua index f6a44028..65be0de0 100644 --- a/core/rostermanager.lua +++ b/core/rostermanager.lua @@ -112,7 +112,15 @@ local function load_roster(username, host) local data, err = roster_store:get(username); roster = data or {}; if user then user.roster = roster; end + local legacy_pending = roster.pending and type(roster.pending.subscription) ~= "string"; roster_metadata(roster, err); + if legacy_pending then + -- Due to map store use, we need to manually delete this entry + log("debug", "Removing legacy 'pending' entry"); + if not save_roster(username, host, roster, "pending") then + log("warn", "Could not remove legacy 'pendig' entry"); + end + end if roster[jid] then roster[jid] = nil; log("debug", "Roster for %s had a self-contact, removing", jid); -- cgit v1.2.3