From 746dd5017b71e9ed2bb8a0d2776dacb2e1353a73 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 19 Dec 2022 21:50:45 -0800 Subject: pds: more stub endpoints (notifications, membership) --- adenosine-pds/src/lib.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'adenosine-pds') 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 -- cgit v1.2.3