From a763b60a93e49bb13426dd12d601a82503852890 Mon Sep 17 00:00:00 2001 From: alemi Date: Mon, 22 Apr 2024 22:42:45 +0200 Subject: [PATCH] feat(apb): added all outbox routes, authed inbox --- apb/src/server.rs | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/apb/src/server.rs b/apb/src/server.rs index 3089cf1..e76a53a 100644 --- a/apb/src/server.rs +++ b/apb/src/server.rs @@ -8,9 +8,12 @@ pub trait Outbox { async fn create(&self, uid: String, activity: Self::Activity) -> Result; async fn like(&self, uid: String, activity: Self::Activity) -> Result; async fn follow(&self, uid: String, activity: Self::Activity) -> Result; + async fn announce(&self, uid: String, activity: Self::Activity) -> Result; async fn accept(&self, uid: String, activity: Self::Activity) -> Result; async fn reject(&self, _uid: String, _activity: Self::Activity) -> Result; async fn undo(&self, uid: String, activity: Self::Activity) -> Result; + async fn delete(&self, uid: String, activity: Self::Activity) -> Result; + async fn update(&self, uid: String, activity: Self::Activity) -> Result; } #[async_trait::async_trait] @@ -18,13 +21,13 @@ pub trait Inbox { type Activity: crate::Activity; type Error: std::error::Error; - async fn create(&self, activity: Self::Activity) -> Result<(), Self::Error>; - async fn like(&self, activity: Self::Activity) -> Result<(), Self::Error>; - async fn follow(&self, activity: Self::Activity) -> Result<(), Self::Error>; - async fn announce(&self, activity: Self::Activity) -> Result<(), Self::Error>; - async fn accept(&self, activity: Self::Activity) -> Result<(), Self::Error>; - async fn reject(&self, activity: Self::Activity) -> Result<(), Self::Error>; - async fn undo(&self, activity: Self::Activity) -> Result<(), Self::Error>; - async fn delete(&self, activity: Self::Activity) -> Result<(), Self::Error>; - async fn update(&self, activity: Self::Activity) -> Result<(), Self::Error>; + async fn create(&self, server: String, activity: Self::Activity) -> Result<(), Self::Error>; + async fn like(&self, server: String, activity: Self::Activity) -> Result<(), Self::Error>; + async fn follow(&self, server: String, activity: Self::Activity) -> Result<(), Self::Error>; + async fn announce(&self, server: String, activity: Self::Activity) -> Result<(), Self::Error>; + async fn accept(&self, server: String, activity: Self::Activity) -> Result<(), Self::Error>; + async fn reject(&self, server: String, activity: Self::Activity) -> Result<(), Self::Error>; + async fn undo(&self, server: String, activity: Self::Activity) -> Result<(), Self::Error>; + async fn delete(&self, server: String, activity: Self::Activity) -> Result<(), Self::Error>; + async fn update(&self, server: String, activity: Self::Activity) -> Result<(), Self::Error>; }