Comparison

plugins/mod_pep.lua @ 11566:6e67872bcba4 0.11

mod_pep: Remove obsolete node restoration code (now done by util.pubsub) Originally added in 202b9951b037 but util.pubsub gained a better method in 6c2c2fc4b8dd since then, which mod_pep uses since 9194431b6447 which should have deleted this. All these :create calls would have failed with a 'conflict' error, since the nodes had already been created. This was never noticed because of missing error handling. Also note that this code did not restore node configuration.
author Kim Alvefur <zash@zash.se>
date Sun, 16 May 2021 16:14:23 +0200
parent 11376:774811e2c6ab
child 11567:c471e19a238e
child 12085:1d213c6f781b
comparison
equal deleted inserted replaced
11565:087b275a9aee 11566:6e67872bcba4
205 205
206 normalize_jid = jid_bare; 206 normalize_jid = jid_bare;
207 207
208 check_node_config = check_node_config; 208 check_node_config = check_node_config;
209 }); 209 });
210 local nodes, err = known_nodes:get(username);
211 if nodes then
212 module:log("debug", "Restoring nodes for user %s", username);
213 for node in pairs(nodes) do
214 module:log("debug", "Restoring node %q", node);
215 service:create(node, true);
216 end
217 elseif err then
218 module:log("error", "Could not restore nodes for %s: %s", username, err);
219 else
220 module:log("debug", "No known nodes");
221 end
222 services[username] = service; 210 services[username] = service;
223 module:add_item("pep-service", { service = service, jid = user_bare }); 211 module:add_item("pep-service", { service = service, jid = user_bare });
224 return service; 212 return service;
225 end 213 end
226 214