Mercurial > prosody-modules
comparison mod_bookmarks/mod_bookmarks.lua @ 3487:e60933722248
mod_bookmarks: Use correct variable, fixes a traceback (thanks dan)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 14 Mar 2019 01:26:54 +0100 |
parents | 4ce945490a24 |
children | 11629f04ddd0 |
comparison
equal
deleted
inserted
replaced
3486:887ce59cf396 | 3487:e60933722248 |
---|---|
123 local function on_node_created(event) | 123 local function on_node_created(event) |
124 local service, node, actor = event.service, event.node, event.actor; | 124 local service, node, actor = event.service, event.node, event.actor; |
125 if node ~= "storage:bookmarks" then | 125 if node ~= "storage:bookmarks" then |
126 return; | 126 return; |
127 end | 127 end |
128 local ok, config = service:get_node_config(node, actor); | 128 local ok, node_config = service:get_node_config(node, actor); |
129 if not ok then | 129 if not ok then |
130 module:log("error", "Failed to get node config of %s: %s", node, config); | 130 module:log("error", "Failed to get node config of %s: %s", node, node_config); |
131 return; | 131 return; |
132 end | 132 end |
133 local changed = false; | 133 local changed = false; |
134 for config_field, value in pairs(default_options) do | 134 for config_field, value in pairs(default_options) do |
135 if node_config[config_field] ~= value then | 135 if node_config[config_field] ~= value then |
138 end | 138 end |
139 end | 139 end |
140 if not changed then | 140 if not changed then |
141 return; | 141 return; |
142 end | 142 end |
143 local ok, err = service:set_node_config(node, actor, config); | 143 local ok, err = service:set_node_config(node, actor, node_config); |
144 if not ok then | 144 if not ok then |
145 module:log("error", "Failed to set node config of %s: %s", node, err); | 145 module:log("error", "Failed to set node config of %s: %s", node, err); |
146 return; | 146 return; |
147 end | 147 end |
148 end | 148 end |