Update create_history_stream to take args struct #135

Merged
glyph merged 1 commits from history_stream_args into main 2022-09-26 09:18:34 +00:00
1 changed files with 7 additions and 2 deletions

View File

@ -12,7 +12,11 @@ use async_std::task;
use dirs;
use futures::stream::TryStreamExt;
use golgi::{
api::friends::RelationshipQuery, blobs, messages::SsbMessageKVT, sbot::Keystore, Sbot,
api::{friends::RelationshipQuery, history_stream::CreateHistoryStream},
blobs,
messages::SsbMessageKVT,
sbot::Keystore,
Sbot,
};
use log::debug;
use peach_lib::config_manager;
@ -133,7 +137,8 @@ pub fn latest_sequence_number() -> Result<u64, Box<dyn Error>> {
// retrieve the local id
let id = sbot_client.whoami().await?;
let history_stream = sbot_client.create_history_stream(id).await?;
let args = CreateHistoryStream::new(id).keys_values(true, true);
let history_stream = sbot_client.create_history_stream(args).await?;
let mut msgs: Vec<SsbMessageKVT> = history_stream.try_collect().await?;
// there will be zero messages when the sbot is run for the first time