# HG changeset patch # User Kim Alvefur # Date 1514576959 -3600 # Node ID 9b81c22d5b542a1b8e2ae148c1ead628c44a1702 # Parent 4f75f4da6d4e0c8aea32320b733a3deaa6e51c4e rostermanager: Explicitly remove old-style 'pending' table from rosters (or it stays forever due to map stores) diff -r 4f75f4da6d4e -r 9b81c22d5b54 core/rostermanager.lua --- a/core/rostermanager.lua Thu Dec 28 17:32:56 2017 +0100 +++ b/core/rostermanager.lua Fri Dec 29 20:49:19 2017 +0100 @@ -112,7 +112,15 @@ 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);