Move actions to apub

This commit is contained in:
asonix 2021-01-04 11:41:34 -06:00
parent 5d56504507
commit 397f67ade6
16 changed files with 19 additions and 16 deletions

View file

@ -1,5 +1,5 @@
use crate::{
actions::{CreateBlock, DeleteBlock},
apub::actions::{CreateBlock, DeleteBlock},
recover, Action, Context, Error, RecoverableError, Required,
};
use activitystreams::prelude::*;

View file

@ -1,5 +1,5 @@
use crate::{
actions::{
apub::actions::{
AcceptFollowRequest, CreateFollowRequest, DeleteFollow, DeleteFollowRequest,
RejectFollowRequest,
},

View file

@ -1,5 +1,5 @@
use crate::{
actions::{CreateReact, DeleteReact},
apub::actions::{CreateReact, DeleteReact},
recover, Action, Context, Error, RecoverableError, Required,
};
use activitystreams::prelude::*;

View file

@ -1,5 +1,5 @@
use crate::{
actions::{
apub::actions::{
AnnounceComment, AnnounceSubmission, CreateComment, CreateSubmission, DeleteComment,
DeleteSubmission, UpdateComment, UpdateSubmission,
},

View file

@ -1,5 +1,5 @@
use crate::{
actions::{CreateProfile, DeleteProfile, UpdateProfile},
apub::actions::{CreateProfile, DeleteProfile, UpdateProfile},
apub::ExtendedPerson,
recover,
store::OwnerSource,

View file

@ -1,5 +1,5 @@
use crate::{
actions::{CreateBlock, DeleteBlock, DeleteFollow, RejectFollowRequest},
apub::actions::{CreateBlock, DeleteBlock, DeleteFollow, RejectFollowRequest},
Action, Context, Error,
};

View file

@ -1,5 +1,5 @@
use crate::{
actions::{AnnounceComment, CreateComment, DeleteComment, DeleteReact, UpdateComment},
apub::actions::{AnnounceComment, CreateComment, DeleteComment, DeleteReact, UpdateComment},
Action, Context, Error, Required,
};

View file

@ -1,4 +1,4 @@
use crate::{actions::DeleteFollow, Action, Context, Error};
use crate::{apub::actions::DeleteFollow, Action, Context, Error};
impl Action for DeleteFollow {
fn perform(&self, context: &Context) -> Result<(), Error> {

View file

@ -1,5 +1,7 @@
use crate::{
actions::{AcceptFollowRequest, CreateFollowRequest, DeleteFollowRequest, RejectFollowRequest},
apub::actions::{
AcceptFollowRequest, CreateFollowRequest, DeleteFollowRequest, RejectFollowRequest,
},
Action, Context, Error,
};

View file

@ -12,7 +12,7 @@ mod profile;
mod react;
mod submission;
pub(super) use apub::ingest;
pub(crate) use apub::ingest;
pub struct CreateReact {
apub_id: Url,

View file

@ -1,5 +1,5 @@
use crate::{
actions::{CreateProfile, DeleteProfile, DeleteSubmission, UpdateProfile},
apub::actions::{CreateProfile, DeleteProfile, DeleteSubmission, UpdateProfile},
Action, Context, Error, Required,
};

View file

@ -1,5 +1,5 @@
use crate::{
actions::{CreateReact, DeleteReact},
apub::actions::{CreateReact, DeleteReact},
Action, Context, Error, Required,
};

View file

@ -1,5 +1,5 @@
use crate::{
actions::{
apub::actions::{
AnnounceSubmission, CreateSubmission, DeleteComment, DeleteSubmission, UpdateSubmission,
},
Action, Context, Error, Required,

View file

@ -4,9 +4,11 @@ use std::{fmt, sync::Arc};
use url::Url;
use uuid::Uuid;
mod actions;
mod keys;
pub use keys::{ExtendedPerson, PublicKey, PublicKeyInner};
pub(crate) use actions::ingest;
use keys::ExtendedPerson;
pub trait ApubIds {
fn gen_id(&self) -> Url;

View file

@ -16,7 +16,6 @@ macro_rules! recover {
};
}
mod actions;
pub mod apub;
pub mod pictrs;
pub mod store;
@ -118,7 +117,7 @@ impl State {
pub async fn ingest(&self, any_base: AnyBase, stack: Vec<AnyBase>) -> Result<(), Error> {
let context = Context::from_state(self).await;
actions::ingest(any_base, &context, stack)?;
apub::ingest(any_base, &context, stack)?;
Ok(())
}
}