65 lines
1.1 KiB
Plaintext
65 lines
1.1 KiB
Plaintext
Higher level functions:
|
|
|
|
```rust
|
|
let mut sbot_client = Sbot::connect();
|
|
|
|
// second parameter is `Option<id>`; if `None`, return our relationship with `id`
|
|
// if second parameter is `Some(dest_id)`, return id's relationship with dest_id
|
|
match sbot_client.get_relationship(id, None) {
|
|
Relationship::Following => ,
|
|
Relationship::NotFollowing => ,
|
|
Relationship::Blocking => ,
|
|
Relationship::Muting => ,
|
|
}
|
|
|
|
sbot_client.set_relationship(id,
|
|
```
|
|
|
|
data structures
|
|
|
|
```rust
|
|
enum Relationship {
|
|
Following,
|
|
NotFollowing,
|
|
Blocking,
|
|
Muting
|
|
}
|
|
|
|
struct Profile {
|
|
id: String,
|
|
name: String,
|
|
description: String,
|
|
// blob reference (maybe?)
|
|
image: String,
|
|
}
|
|
```
|
|
|
|
-----
|
|
|
|
whoami - id: String
|
|
|
|
name(id) -> name: String
|
|
description(id) -> description: String
|
|
|
|
publish_description(id, text) -> msg_ref: String
|
|
publish_name(id, text) -> msg_ref: String
|
|
publish_post(text) -> msg_ref: String
|
|
|
|
follows(id) -> Vec<SsbId>
|
|
followers(id) -> Vec<SsbId>
|
|
friends(id) -> Vec<SsbId>
|
|
blocks(id) -> Vec<SsbId>
|
|
|
|
follow(id) -> msg_ref
|
|
unfollow(id) -> msg_ref
|
|
block(id) -> msg_ref
|
|
|
|
profile_image(id)
|
|
|
|
-----
|
|
|
|
```
|
|
let mut sbot_client = Sbot::init();
|
|
```
|
|
|
|
----- |