# HG changeset patch # User Emmanuel Gil Peyrot # Date 1551890817 -3600 # Node ID 4ce945490a24cefab9552360a6efa35f5b132d14 # Parent 820c891a54ccacbccb5f388077928a9b043b2499 mod_bookmarks: Actually save node config diff -r 820c891a54cc -r 4ce945490a24 mod_bookmarks/mod_bookmarks.lua --- a/mod_bookmarks/mod_bookmarks.lua Wed Mar 06 01:30:54 2019 +0100 +++ b/mod_bookmarks/mod_bookmarks.lua Wed Mar 06 17:46:57 2019 +0100 @@ -125,9 +125,25 @@ if node ~= "storage:bookmarks" then return; end - local node_config = service.nodes[node].config; + local ok, config = service:get_node_config(node, actor); + if not ok then + module:log("error", "Failed to get node config of %s: %s", node, config); + return; + end + local changed = false; for config_field, value in pairs(default_options) do - node_config[config_field] = value; + 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, config); + if not ok then + module:log("error", "Failed to set node config of %s: %s", node, err); + return; end end