aboutsummaryrefslogtreecommitdiffstats
path: root/adenosine-pds/src
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2022-12-19 21:50:45 -0800
committerbryan newbold <bnewbold@robocracy.org>2022-12-20 00:29:58 -0800
commit746dd5017b71e9ed2bb8a0d2776dacb2e1353a73 (patch)
treef3983b07ae2ad620ed1ba6fd5cb89deb243ea315 /adenosine-pds/src
parent2cd76edf9d418edce85ad624d99e2eb1d4bf267d (diff)
downloadadenosine-746dd5017b71e9ed2bb8a0d2776dacb2e1353a73.tar.gz
adenosine-746dd5017b71e9ed2bb8a0d2776dacb2e1353a73.zip
pds: more stub endpoints (notifications, membership)
Diffstat (limited to 'adenosine-pds/src')
-rw-r--r--adenosine-pds/src/lib.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/adenosine-pds/src/lib.rs b/adenosine-pds/src/lib.rs
index f855e59..2b89eac 100644
--- a/adenosine-pds/src/lib.rs
+++ b/adenosine-pds/src/lib.rs
@@ -477,6 +477,24 @@ fn xrpc_get_handler(
let mut srv = srv.lock().unwrap();
Ok(json!(bsky_get_thread(&mut srv, &uri, None)?))
}
+ "app.bsky.graph.getMemberships" => {
+ // TODO: actual implementation
+ // TODO did or handle
+ let _actor = Did::from_str(&xrpc_required_param(request, "actor")?)?;
+ Ok(json!({"memberships": []}))
+ }
+ "app.bsky.notification.getCount" => {
+ // TODO: actual implementation
+ let mut srv = srv.lock().or(Err(XrpcError::MutexPoisoned))?;
+ let _auth_did = &xrpc_check_auth_header(&mut srv, request, None)?;
+ Ok(json!({"count": 0}))
+ }
+ "app.bsky.notification.list" => {
+ // TODO: actual implementation
+ let mut srv = srv.lock().or(Err(XrpcError::MutexPoisoned))?;
+ let _auth_did = &xrpc_check_auth_header(&mut srv, request, None)?;
+ Ok(json!({"notifications": []}))
+ }
_ => Err(anyhow!(XrpcError::NotFound(format!(
"XRPC endpoint handler not found: {}",
method
@@ -748,6 +766,12 @@ fn xrpc_post_handler(
bsky_update_profile(&mut srv, auth_did, profile)?;
Ok(json!({}))
}
+ "app.bsky.notification.updateSeen" => {
+ // TODO: actual implementation
+ let mut srv = srv.lock().unwrap();
+ let _auth_did = &xrpc_check_auth_header(&mut srv, request, None)?;
+ Ok(json!({}))
+ }
_ => Err(anyhow!(XrpcError::NotFound(format!(
"XRPC endpoint handler not found: {}",
method