Compare commits

...

1 Commits

Author SHA1 Message Date
glyph b0b2532976 messy implementation used for lykin testing 2022-05-18 09:03:18 +02:00
1 changed files with 12 additions and 4 deletions

View File

@ -7,7 +7,12 @@
use async_std::stream::Stream;
use kuska_ssb::api::dto::CreateHistoryStreamIn;
use crate::{error::GolgiError, messages::SsbMessageValue, sbot::Sbot, utils};
use crate::{
error::GolgiError,
messages::{SsbMessageKVT, SsbMessageValue},
sbot::Sbot,
utils,
};
impl Sbot {
/// Call the `createHistoryStream` RPC method.
@ -38,9 +43,11 @@ impl Sbot {
pub async fn create_history_stream(
&mut self,
id: String,
) -> Result<impl Stream<Item = Result<SsbMessageValue, GolgiError>>, GolgiError> {
//) -> Result<impl Stream<Item = Result<SsbMessageValue, GolgiError>>, GolgiError> {
) -> Result<impl Stream<Item = Result<SsbMessageKVT, GolgiError>>, GolgiError> {
let mut sbot_connection = self.get_sbot_connection().await?;
let args = CreateHistoryStreamIn::new(id);
let args = CreateHistoryStreamIn::new(id).keys_values(true, true);
//.limit(10);
let req_id = sbot_connection
.client
.create_history_stream_req_send(&args)
@ -48,7 +55,8 @@ impl Sbot {
let history_stream = utils::get_source_stream(
sbot_connection.rpc_reader,
req_id,
utils::ssb_message_res_parse,
//utils::ssb_message_res_parse,
utils::kvt_res_parse,
)
.await;
Ok(history_stream)