Comparison

plugins/mod_vcard_legacy.lua @ 9813:071aaaa5cb34 0.11

mod_vcard_legacy: Allow disabling vcard conversion Once everyone has been migrated it might be nice to skip these checks
author Kim Alvefur <zash@zash.se>
date Fri, 25 Jan 2019 23:31:02 +0100
parent 9812:330a937e085e
child 9814:5eb4ef537e98
comparison
equal deleted inserted replaced
9812:330a937e085e 9813:071aaaa5cb34
305 305
306 module:hook("pre-presence/full", inject_xep153, 1); 306 module:hook("pre-presence/full", inject_xep153, 1);
307 module:hook("pre-presence/bare", inject_xep153, 1); 307 module:hook("pre-presence/bare", inject_xep153, 1);
308 module:hook("pre-presence/host", inject_xep153, 1); 308 module:hook("pre-presence/host", inject_xep153, 1);
309 309
310 if module:get_option_boolean("upgrade_legacy_vcards", true) then
310 module:hook("resource-bind", function (event) 311 module:hook("resource-bind", function (event)
311 local session = event.session; 312 local session = event.session;
312 local username = session.username; 313 local username = session.username;
313 local vcard_temp = vcards:get(username); 314 local vcard_temp = vcards:get(username);
314 if not vcard_temp then 315 if not vcard_temp then
329 session.log("info", "Migrated vCard-temp to PEP"); 330 session.log("info", "Migrated vCard-temp to PEP");
330 else 331 else
331 session.log("info", "Failed to migrate vCard-temp to PEP: %s", err or "problem emptying 'vcard' store"); 332 session.log("info", "Failed to migrate vCard-temp to PEP: %s", err or "problem emptying 'vcard' store");
332 end 333 end
333 end); 334 end);
335 end