diff --git a/src/main.rs b/src/main.rs index c1e7446f..3a8e12a6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,4 @@ -pub mod server; // TODO there are some methods that i dont use yet, make it public so that ra shuts up +mod server; mod model; mod routes; diff --git a/src/server/auth.rs b/src/server/auth.rs index 2eddd9d5..cacf2cca 100644 --- a/src/server/auth.rs +++ b/src/server/auth.rs @@ -48,24 +48,20 @@ impl Identity { } } + #[allow(unused)] pub fn is_anon(&self) -> bool { matches!(self, Self::Anonymous) } + #[allow(unused)] pub fn is_local(&self) -> bool { matches!(self, Self::Local { .. }) } + #[allow(unused)] pub fn is_remote(&self) -> bool { matches!(self, Self::Remote { .. }) } - - pub fn is_local_user(&self, uid: &str) -> bool { - match self { - Self::Local { id, .. } => id == uid, - _ => false, - } - } } pub struct AuthIdentity(pub Identity); diff --git a/src/server/context.rs b/src/server/context.rs index 1db4b344..2b023864 100644 --- a/src/server/context.rs +++ b/src/server/context.rs @@ -188,6 +188,7 @@ impl Context { Ok(model::activity::Entity::find_by_id(internal).select_only().one(self.db()).await?.is_some()) } + #[allow(unused)] pub async fn is_local_internal_actor(&self, internal: i64) -> crate::Result { Ok(model::actor::Entity::find_by_id(internal).select_only().one(self.db()).await?.is_some()) }