use crate::{
- apub::{
- check_is_apub_id_valid,
- community::do_announce,
- extensions::signatures::verify,
- fetcher::{
- get_or_fetch_and_upsert_actor,
- get_or_fetch_and_upsert_community,
- get_or_fetch_and_upsert_user,
- },
- inbox::activities::{
- announce::receive_announce,
- create::receive_create,
- delete::receive_delete,
- dislike::receive_dislike,
- like::receive_like,
- remove::receive_remove,
- undo::receive_undo,
- update::receive_update,
- },
- insert_activity,
+ check_is_apub_id_valid,
+ community::do_announce,
+ extensions::signatures::verify,
+ fetcher::{
+ get_or_fetch_and_upsert_actor,
+ get_or_fetch_and_upsert_community,
+ get_or_fetch_and_upsert_user,
},
- LemmyContext,
+ inbox::activities::{
+ announce::receive_announce,
+ create::receive_create,
+ delete::receive_delete,
+ dislike::receive_dislike,
+ like::receive_like,
+ remove::receive_remove,
+ undo::receive_undo,
+ update::receive_update,
+ },
+ insert_activity,
};
use activitystreams::{
activity::{ActorAndObject, ActorAndObjectRef},
use anyhow::Context;
use lemmy_db::user::User_;
use lemmy_utils::{location_info, LemmyError};
+use lemmy_websocket::LemmyContext;
use log::debug;
use serde::{Deserialize, Serialize};
use std::fmt::Debug;
res
}
-pub(in crate::apub::inbox) fn receive_unhandled_activity<A>(
+pub(in crate::inbox) fn receive_unhandled_activity<A>(
activity: A,
) -> Result<HttpResponse, LemmyError>
where
Ok(HttpResponse::NotImplemented().finish())
}
-pub(in crate::apub::inbox) async fn get_user_from_activity<T, A>(
+pub(in crate::inbox) async fn get_user_from_activity<T, A>(
activity: &T,
context: &LemmyContext,
) -> Result<User_, LemmyError>
get_or_fetch_and_upsert_user(&user_uri, context).await
}
-pub(in crate::apub::inbox) fn get_community_id_from_activity<T, A>(
+pub(in crate::inbox) fn get_community_id_from_activity<T, A>(
activity: &T,
) -> Result<Url, LemmyError>
where
)
}
-pub(in crate::apub::inbox) async fn announce_if_community_is_local<T, Kind>(
+pub(in crate::inbox) async fn announce_if_community_is_local<T, Kind>(
activity: T,
user: &User_,
context: &LemmyContext,