forked from mirrors/relay
Support Remove activity, forward verbatim
This commit is contained in:
parent
359ec68aa0
commit
675fddcfeb
3 changed files with 5 additions and 3 deletions
|
@ -33,13 +33,14 @@ pub struct PublicKey {
|
|||
#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd, serde::Deserialize, serde::Serialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub enum ValidTypes {
|
||||
Add,
|
||||
Accept,
|
||||
Add,
|
||||
Announce,
|
||||
Create,
|
||||
Delete,
|
||||
Follow,
|
||||
Reject,
|
||||
Remove,
|
||||
Undo,
|
||||
Update,
|
||||
}
|
||||
|
|
|
@ -197,7 +197,8 @@ impl ResponseError for Error {
|
|||
ErrorKind::Kind(_)
|
||||
| ErrorKind::MissingKind
|
||||
| ErrorKind::MissingId
|
||||
| ErrorKind::ObjectCount | ErrorKind::NoSignature(_) => StatusCode::BAD_REQUEST,
|
||||
| ErrorKind::ObjectCount
|
||||
| ErrorKind::NoSignature(_) => StatusCode::BAD_REQUEST,
|
||||
_ => StatusCode::INTERNAL_SERVER_ERROR,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ pub(crate) async fn route(
|
|||
handle_announce(&state, &jobs, input, actor).await?
|
||||
}
|
||||
ValidTypes::Follow => handle_follow(&config, &jobs, input, actor).await?,
|
||||
ValidTypes::Add | ValidTypes::Delete | ValidTypes::Update => {
|
||||
ValidTypes::Add | ValidTypes::Delete | ValidTypes::Remove | ValidTypes::Update => {
|
||||
handle_forward(&jobs, input, actor).await?
|
||||
}
|
||||
ValidTypes::Undo => handle_undo(&config, &jobs, input, actor, is_connected).await?,
|
||||
|
|
Loading…
Reference in a new issue