Skip to content

Commit

Permalink
Add CLI feature
Browse files Browse the repository at this point in the history
  • Loading branch information
gferon committed Jan 2, 2025
1 parent b611008 commit 1b14c6e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions presage-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,22 @@ async fn run<S: Store>(subcommand: Cmd, config_store: S) -> anyhow::Result<()> {
Cmd::SyncContacts => {
let mut manager = Manager::load_registered(config_store).await?;
manager.request_contacts().await?;

let messages = manager
.receive_messages()
.await
.context("failed to initialize messages stream")?;
pin_mut!(messages);

println!("synchronizing messages until we get contacts (dots are messages synced from the past timeline)");

while let Some(content) = messages.next().await {
match content {
Received::QueueEmpty => break,
Received::Contacts => println!("got contacts! thank you, come again."),
Received::Content(_) => print!("."),
}
}
}
Cmd::ListMessages {
group_master_key,
Expand Down

0 comments on commit 1b14c6e

Please sign in to comment.