# HG changeset patch # User Emmanuel Gil Peyrot # Date 1573660476 -3600 # Node ID 5eab799b5fa45cb455a76f595c18321a212c2211 # Parent 05bca7a771d63323aa29bde8e1aece62f9341996 mod_bookmarks2: Delete legacy PEP bookmarks whenever they get recreated, to prevent them from being used. diff -r 05bca7a771d6 -r 5eab799b5fa4 mod_bookmarks2/mod_bookmarks2.lua --- a/mod_bookmarks2/mod_bookmarks2.lua Wed Nov 13 16:45:48 2019 +0100 +++ b/mod_bookmarks2/mod_bookmarks2.lua Wed Nov 13 16:54:36 2019 +0100 @@ -276,26 +276,13 @@ if node ~= "storage:bookmarks" then return; end - local ok, node_config = service:get_node_config(node, actor); + + module:log("debug", "Something tried to create legacy PEP bookmarks for %s.", actor); + local ok, err = service:delete("storage:bookmarks", actor); if not ok then - module:log("error", "Failed to get node config of %s: %s", node, node_config); - return; + module:log("error", "Failed to delete legacy PEP bookmarks for %s: %s", actor, err); end - local changed = false; - for config_field, value in pairs(default_options) do - if node_config[config_field] ~= value then - node_config[config_field] = value; - changed = true; - end - end - if not changed then - return; - end - local ok, err = service:set_node_config(node, actor, node_config); - if not ok then - module:log("error", "Failed to set node config of %s: %s", node, err); - return; - end + module:log("debug", "Legacy PEP bookmarks node of %s deleted.", actor); end module:hook("iq/bare/jabber:iq:private:query", function (event)