comparison mod_storage_xmlarchive/mod_storage_xmlarchive.lua @ 5741:5232d12eb74d

mod_storage_xmlarchive: Pass hostname to converter for converting all users
author Kim Alvefur <zash@zash.se>
date Tue, 28 Nov 2023 19:55:43 +0100
parents 100110d539d3
children 645de410dbca
comparison
equal deleted inserted replaced
5740:100110d539d3 5741:5232d12eb74d
546 end 546 end
547 end 547 end
548 548
549 local store = arg[4]; 549 local store = arg[4];
550 if arg[3] == "internal" then 550 if arg[3] == "internal" then
551 if arg[5] then 551 for i = 5, #arg do
552 for i = 5, #arg do 552 local user, host = jid.prepped_split(arg[i]);
553 local user, host = jid.prepped_split(arg[i]); 553 if user then
554 if not user then 554 print(arg[i]);
555 print(string.format("Argument #%d (%q) is an invalid JID, aborting", i, arg[i])); 555 convert(user, host, store);
556 os.exit(1); 556 else
557 -- luacheck: ignore 421/user
558 for user in archive.users({ host = host; store = store }) do
559 print(user.."@"..host);
560 convert(user, host, store);
557 end 561 end
558 convert(user, host, store);
559 end
560 else
561 for user in archive.users({ host = host; store = store }) do
562 convert(user, host, store);
563 end 562 end
564 end 563 end
565 print("Done"); 564 print("Done");
566 return 0; 565 return 0;
567 else 566 else