Compare commits
1 Commits
main
...
gethistory
Author | SHA1 | Date |
---|---|---|
glyph | b0b2532976 |
|
@ -7,7 +7,12 @@
|
||||||
use async_std::stream::Stream;
|
use async_std::stream::Stream;
|
||||||
use kuska_ssb::api::dto::CreateHistoryStreamIn;
|
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 {
|
impl Sbot {
|
||||||
/// Call the `createHistoryStream` RPC method.
|
/// Call the `createHistoryStream` RPC method.
|
||||||
|
@ -38,9 +43,11 @@ impl Sbot {
|
||||||
pub async fn create_history_stream(
|
pub async fn create_history_stream(
|
||||||
&mut self,
|
&mut self,
|
||||||
id: String,
|
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 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
|
let req_id = sbot_connection
|
||||||
.client
|
.client
|
||||||
.create_history_stream_req_send(&args)
|
.create_history_stream_req_send(&args)
|
||||||
|
@ -48,7 +55,8 @@ impl Sbot {
|
||||||
let history_stream = utils::get_source_stream(
|
let history_stream = utils::get_source_stream(
|
||||||
sbot_connection.rpc_reader,
|
sbot_connection.rpc_reader,
|
||||||
req_id,
|
req_id,
|
||||||
utils::ssb_message_res_parse,
|
//utils::ssb_message_res_parse,
|
||||||
|
utils::kvt_res_parse,
|
||||||
)
|
)
|
||||||
.await;
|
.await;
|
||||||
Ok(history_stream)
|
Ok(history_stream)
|
||||||
|
|
Loading…
Reference in New Issue