1mod support;
3
4fn main() -> anyhow::Result<()> {
5 if std::env::args().skip(1).any(|arg| arg == "--help") {
6 println!("sync_once: approve a test-account QR login and summarize one initial sync page.");
7 return Ok(());
8 }
9 let (client, mut state) = support::login()?;
10 let batch = client.sync(&mut state, &[])?;
11 let mut messages = 0;
12 for command in &batch.commands {
13 if command.id == 5 {
14 let _message =
15 wechat_protocol::wire::decode_add_message(&command.payload, &state.own_username)?;
16 messages += 1;
17 }
18 }
19 println!(
20 "commands={} add_messages={} other_commands={} continuation={}",
21 batch.commands.len(),
22 messages,
23 batch.commands.len() - messages,
24 batch.continuation
25 );
26 println!("Preview only. No history or sync cursor was saved.");
30 Ok(())
31}