Limit visibility of some traits and methods
This commit is contained in:
parent
9435994405
commit
2bdb15b06d
|
@ -33,7 +33,7 @@ use url::Url;
|
||||||
/// * `activity` the apub activity to be sent
|
/// * `activity` the apub activity to be sent
|
||||||
/// * `creator` the local actor which created the activity
|
/// * `creator` the local actor which created the activity
|
||||||
/// * `inbox` the inbox url where the activity should be delivered to
|
/// * `inbox` the inbox url where the activity should be delivered to
|
||||||
pub async fn send_activity_single_dest<T, Kind>(
|
pub(crate) async fn send_activity_single_dest<T, Kind>(
|
||||||
activity: T,
|
activity: T,
|
||||||
creator: &dyn ActorType,
|
creator: &dyn ActorType,
|
||||||
inbox: Url,
|
inbox: Url,
|
||||||
|
@ -71,7 +71,7 @@ where
|
||||||
/// * `community` the sending community
|
/// * `community` the sending community
|
||||||
/// * `sender_shared_inbox` in case of an announce, this should be the shared inbox of the inner
|
/// * `sender_shared_inbox` in case of an announce, this should be the shared inbox of the inner
|
||||||
/// activities creator, as receiving a known activity will cause an error
|
/// activities creator, as receiving a known activity will cause an error
|
||||||
pub async fn send_to_community_followers<T, Kind>(
|
pub(crate) async fn send_to_community_followers<T, Kind>(
|
||||||
activity: T,
|
activity: T,
|
||||||
community: &Community,
|
community: &Community,
|
||||||
context: &LemmyContext,
|
context: &LemmyContext,
|
||||||
|
@ -116,7 +116,7 @@ where
|
||||||
/// * `creator` the creator of the activity
|
/// * `creator` the creator of the activity
|
||||||
/// * `community` the destination community
|
/// * `community` the destination community
|
||||||
///
|
///
|
||||||
pub async fn send_to_community<T, Kind>(
|
pub(crate) async fn send_to_community<T, Kind>(
|
||||||
activity: T,
|
activity: T,
|
||||||
creator: &User_,
|
creator: &User_,
|
||||||
community: &Community,
|
community: &Community,
|
||||||
|
@ -160,7 +160,7 @@ where
|
||||||
/// * `creator` user who created the comment
|
/// * `creator` user who created the comment
|
||||||
/// * `mentions` list of inboxes of users which are mentioned in the comment
|
/// * `mentions` list of inboxes of users which are mentioned in the comment
|
||||||
/// * `activity` either a `Create/Note` or `Update/Note`
|
/// * `activity` either a `Create/Note` or `Update/Note`
|
||||||
pub async fn send_comment_mentions<T, Kind>(
|
pub(crate) async fn send_comment_mentions<T, Kind>(
|
||||||
creator: &User_,
|
creator: &User_,
|
||||||
mentions: Vec<Url>,
|
mentions: Vec<Url>,
|
||||||
activity: T,
|
activity: T,
|
||||||
|
|
|
@ -65,7 +65,10 @@ pub async fn sign_and_send(
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Verifies the HTTP signature on an incoming inbox request.
|
/// Verifies the HTTP signature on an incoming inbox request.
|
||||||
pub fn verify_signature(request: &HttpRequest, actor: &dyn ActorType) -> Result<(), LemmyError> {
|
pub(crate) fn verify_signature(
|
||||||
|
request: &HttpRequest,
|
||||||
|
actor: &dyn ActorType,
|
||||||
|
) -> Result<(), LemmyError> {
|
||||||
let public_key = actor.public_key().context(location_info!())?;
|
let public_key = actor.public_key().context(location_info!())?;
|
||||||
let verified = CONFIG2
|
let verified = CONFIG2
|
||||||
.begin_verify(
|
.begin_verify(
|
||||||
|
|
|
@ -111,14 +111,14 @@ fn check_is_apub_id_valid(apub_id: &Url) -> Result<(), LemmyError> {
|
||||||
|
|
||||||
/// Trait for converting an object or actor into the respective ActivityPub type.
|
/// Trait for converting an object or actor into the respective ActivityPub type.
|
||||||
#[async_trait::async_trait(?Send)]
|
#[async_trait::async_trait(?Send)]
|
||||||
pub trait ToApub {
|
pub(crate) trait ToApub {
|
||||||
type ApubType;
|
type ApubType;
|
||||||
async fn to_apub(&self, pool: &DbPool) -> Result<Self::ApubType, LemmyError>;
|
async fn to_apub(&self, pool: &DbPool) -> Result<Self::ApubType, LemmyError>;
|
||||||
fn to_tombstone(&self) -> Result<Tombstone, LemmyError>;
|
fn to_tombstone(&self) -> Result<Tombstone, LemmyError>;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[async_trait::async_trait(?Send)]
|
#[async_trait::async_trait(?Send)]
|
||||||
pub trait FromApub {
|
pub(crate) trait FromApub {
|
||||||
type ApubType;
|
type ApubType;
|
||||||
/// Converts an object from ActivityPub type to Lemmy internal type.
|
/// Converts an object from ActivityPub type to Lemmy internal type.
|
||||||
///
|
///
|
||||||
|
@ -248,7 +248,7 @@ pub trait ActorType {
|
||||||
|
|
||||||
/// Store a sent or received activity in the database, for logging purposes. These records are not
|
/// Store a sent or received activity in the database, for logging purposes. These records are not
|
||||||
/// persistent.
|
/// persistent.
|
||||||
pub async fn insert_activity<T>(
|
pub(crate) async fn insert_activity<T>(
|
||||||
ap_id: &Url,
|
ap_id: &Url,
|
||||||
activity: T,
|
activity: T,
|
||||||
local: bool,
|
local: bool,
|
||||||
|
|
Loading…
Reference in New Issue