Working on friends methods
This commit is contained in:
parent
6fd27827a0
commit
bacd954fa0
26
src/sbot.rs
26
src/sbot.rs
|
@ -180,6 +180,32 @@ impl Sbot {
|
|||
.await
|
||||
}
|
||||
|
||||
/// Call the `friends follow` RPC method and return a message reference.
|
||||
pub async fn friends_follow(&mut self, ssb_id: &str) -> Result<String, GolgiError> {
|
||||
let mut sbot_connection = self.get_sbot_connection().await?;
|
||||
let req_id = sbot_connection.client.friends_follow_req_send(ssb_id).await?;
|
||||
|
||||
utils::get_async(
|
||||
&mut sbot_connection.rpc_reader,
|
||||
req_id,
|
||||
utils::string_res_parse,
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
/// Call the `friends isfollowing` RPC method and return a message reference.
|
||||
/// returns true if src_id is following dest_id and false otherwise
|
||||
pub async fn friends_is_following(&mut self, src_id: &str, dest_id: &str) -> Result<String, GolgiError> {
|
||||
let mut sbot_connection = self.get_sbot_connection().await?;
|
||||
let req_id = sbot_connection.client.friends_isfollowing_req_send(src_id, dest_id).await?;
|
||||
|
||||
utils::get_async(
|
||||
&mut sbot_connection.rpc_reader,
|
||||
req_id,
|
||||
utils::string_res_parse,
|
||||
).await
|
||||
}
|
||||
|
||||
/// Wrapper for publish which constructs and publishes a post message appropriately from a string.
|
||||
///
|
||||
/// # Arguments
|
||||
|
|
Loading…
Reference in New Issue