Compare commits
2 Commits
a08f3adbef
...
8dac8b1a62
Author | SHA1 | Date |
---|---|---|
glyph | 8dac8b1a62 | |
glyph | 87f75fae94 |
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue