Compare commits

...

2 Commits

Author SHA1 Message Date
glyph 8dac8b1a62 remove unneeded imports 2022-11-22 09:44:55 +02:00
glyph 87f75fae94 remove debugging println 2022-11-22 09:44:36 +02:00
2 changed files with 1 additions and 19 deletions

View File

@ -1,19 +1,8 @@
use std::process;
use async_std::stream::StreamExt;
use futures::TryStreamExt;
use golgi::{
api::{
friends::{FriendsHops, RelationshipQuery},
get_subset::{SubsetQuery, SubsetQueryOptions},
history_stream::CreateHistoryStream,
tangles::TanglesThread,
},
messages::{SsbMessageContentType, SsbMessageKVT},
sbot::Keystore,
GolgiError, Sbot,
};
use golgi::{api::tangles::TanglesThread, sbot::Keystore, GolgiError, Sbot};
// Golgi is an asynchronous library so we must call it from within an
// async function. The `GolgiError` type encapsulates all possible

View File

@ -8,11 +8,8 @@ use async_std::stream::Stream;
pub use kuska_ssb::api::dto::TanglesThread;
use crate::{error::GolgiError, messages::SsbMessageKVT, sbot::Sbot, utils};
//use crate::{error::GolgiError, messages::SsbMessageValue, sbot::Sbot, utils};
impl Sbot {
// TODO: update this example code
/// Call the `tanglesThread` RPC method. Returns messages in the form
/// of KVTs (Key Value Timestamp).
///
@ -48,18 +45,14 @@ impl Sbot {
&mut self,
args: TanglesThread,
) -> Result<impl Stream<Item = Result<SsbMessageKVT, GolgiError>>, GolgiError> {
// ) -> Result<impl Stream<Item = Result<SsbMessageValue, GolgiError>>, GolgiError> {
let mut sbot_connection = self.get_sbot_connection().await?;
let req_id = sbot_connection
.client
.tangles_thread_req_send(&args)
.await?;
println!("{}", req_id);
let thread_stream =
utils::get_source_stream(sbot_connection.rpc_reader, req_id, utils::kvt_res_parse)
//utils::get_source_stream(sbot_connection.rpc_reader, req_id, utils::ssb_message_res_parse)
.await;
Ok(thread_stream)
}