Merge branch 'friends-requests' into invites
This commit is contained in:
commit
ed923abc2f
25
src/sbot.rs
25
src/sbot.rs
|
@ -210,29 +210,6 @@ impl Sbot {
|
|||
self.publish(msg).await
|
||||
}
|
||||
|
||||
/// Call the `friends follow` RPC method and return a message reference.
|
||||
/// if state is true, then sets the following status to true
|
||||
/// if state is false, then sets the following status to false (unfollow)
|
||||
/// TODO: currently this method is not working (seems to be missing from go-sbot)
|
||||
/// as a workaround, we can use set_relationship instead just fine
|
||||
pub async fn friends_follow(
|
||||
&mut self,
|
||||
ssb_id: &str,
|
||||
state: bool,
|
||||
) -> Result<String, GolgiError> {
|
||||
let mut sbot_connection = self.get_sbot_connection().await?;
|
||||
let req_id = sbot_connection
|
||||
.client
|
||||
.friends_follow_req_send(ssb_id, state)
|
||||
.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(
|
||||
|
@ -289,7 +266,7 @@ impl Sbot {
|
|||
/// TODO: currently this method is not working
|
||||
/// go-sbot does not seem to listen to the reverse=True parameter
|
||||
/// and just returns follows
|
||||
pub async fn get_followers(&mut self) -> Result<Vec<String>, GolgiError> {
|
||||
async fn get_followers(&mut self) -> Result<Vec<String>, GolgiError> {
|
||||
self.friends_hops(FriendsHopsOpts {
|
||||
max: 1,
|
||||
start: None,
|
||||
|
|
Loading…
Reference in New Issue