diff --git a/src/api/history_stream.rs b/src/api/history_stream.rs index 1a2e4d1..0cfbe8f 100644 --- a/src/api/history_stream.rs +++ b/src/api/history_stream.rs @@ -7,10 +7,11 @@ 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, sbot::Sbot, utils}; impl Sbot { - /// Call the `createHistoryStream` RPC method. + /// Call the `createHistoryStream` RPC method. Returns messages in the form + /// of KVTs (Key Value Timestamp). /// /// # Example /// @@ -38,19 +39,16 @@ impl Sbot { pub async fn create_history_stream( &mut self, id: String, - ) -> Result>, GolgiError> { + ) -> Result>, GolgiError> { let mut sbot_connection = self.get_sbot_connection().await?; - let args = CreateHistoryStreamIn::new(id); + let args = CreateHistoryStreamIn::new(id).keys_values(true, true); let req_id = sbot_connection .client .create_history_stream_req_send(&args) .await?; - let history_stream = utils::get_source_stream( - sbot_connection.rpc_reader, - req_id, - utils::ssb_message_res_parse, - ) - .await; + let history_stream = + utils::get_source_stream(sbot_connection.rpc_reader, req_id, utils::kvt_res_parse) + .await; Ok(history_stream) } }