From 4281f40523fef479c408701872433412f56156e0 Mon Sep 17 00:00:00 2001 From: glyph Date: Wed, 16 Feb 2022 14:17:28 +0200 Subject: [PATCH] clarify the friends.hops method and set max to 0 --- src/api/friends.rs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/api/friends.rs b/src/api/friends.rs index 63c73af..ff598ed 100644 --- a/src/api/friends.rs +++ b/src/api/friends.rs @@ -236,7 +236,7 @@ impl Sbot { /// ``` pub async fn get_follows(&mut self) -> Result, GolgiError> { self.friends_hops(FriendsHops { - max: 1, + max: 0, start: None, reverse: Some(false), }) @@ -272,7 +272,7 @@ impl Sbot { /// ``` async fn _get_followers(&mut self) -> Result, GolgiError> { self.friends_hops(FriendsHops { - max: 1, + max: 0, start: None, reverse: Some(true), }) @@ -283,8 +283,18 @@ impl Sbot { /// /// A `RelationshipQuery` `struct` must be defined and passed into this method. /// - /// When opts.reverse = True, it should return peers who are following you - /// (but this is not currently working). + /// Hops = 0 returns a list of peers followed by the local identity. + /// Those peers may or may not be mutual follows (ie. friends). + /// + /// Hops = 1 includes the peers followed by the peers we follow. + /// For example, if the local identity follows Aiko and Aiko follows + /// Bridgette and Chris, hops = 1 will return a list including the public + /// keys for Aiko, Bridgette and Chris (even though Bridgette and Chris + /// are not followed by the local identity). + /// + /// When reverse = True, hops = 0 should return a list of peers who + /// follow the local identity, ie. followers (but this is not currently + /// implemented in go-sbot). /// /// # Example ///