mod_storage_xmlarchive/mod_storage_xmlarchive.lua
changeset 5745 5232d12eb74d
parent 5744 100110d539d3
child 5746 645de410dbca
equal deleted inserted replaced
5744:100110d539d3 5745: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