extract_community,
generate_activity_id,
verify_activity,
+ verify_is_public,
verify_person_in_community,
CreateOrUpdateType,
},
person::ApubPerson,
},
};
-use activitystreams::{base::AnyBase, link::Mention, primitives::OneOrMany, unparsed::Unparsed};
+use activitystreams::{
+ base::AnyBase,
+ link::Mention,
+ primitives::OneOrMany,
+ public,
+ unparsed::Unparsed,
+};
use lemmy_api_common::{blocking, check_post_deleted_or_removed};
use lemmy_apub_lib::{
data::Data,
traits::{ActivityFields, ActivityHandler, ActorType, ApubObject},
- values::PublicUrl,
verify::verify_domains_match,
};
use lemmy_db_schema::{
#[serde(rename_all = "camelCase")]
pub struct CreateOrUpdateComment {
actor: ObjectId<ApubPerson>,
- to: [PublicUrl; 1],
+ to: Vec<Url>,
object: Note,
cc: Vec<Url>,
tag: Vec<Mention>,
let create_or_update = CreateOrUpdateComment {
actor: ObjectId::new(actor.actor_id()),
- to: [PublicUrl::Public],
+ to: vec![public()],
object: comment.to_apub(context).await?,
cc: maa.ccs,
tag: maa.tags,
context: &Data<LemmyContext>,
request_counter: &mut i32,
) -> Result<(), LemmyError> {
+ verify_is_public(&self.to)?;
let community = extract_community(&self.cc, context, request_counter).await?;
let community_id = ObjectId::new(community.actor_id());
let post = self.object.get_parents(context, request_counter).await?.0;
generate_activity_id,
verify_activity,
verify_add_remove_moderator_target,
+ verify_is_public,
verify_mod_action,
verify_person_in_community,
},
activity::kind::AddType,
base::AnyBase,
primitives::OneOrMany,
+ public,
unparsed::Unparsed,
};
use lemmy_api_common::blocking;
use lemmy_apub_lib::{
data::Data,
traits::{ActivityFields, ActivityHandler, ActorType},
- values::PublicUrl,
};
use lemmy_db_schema::{
source::community::{CommunityModerator, CommunityModeratorForm},
#[serde(rename_all = "camelCase")]
pub struct AddMod {
actor: ObjectId<ApubPerson>,
- to: [PublicUrl; 1],
+ to: Vec<Url>,
object: ObjectId<ApubPerson>,
target: Url,
cc: [ObjectId<ApubCommunity>; 1],
)?;
let add = AddMod {
actor: ObjectId::new(actor.actor_id()),
- to: [PublicUrl::Public],
+ to: vec![public()],
object: ObjectId::new(added_mod.actor_id()),
target: generate_moderators_url(&community.actor_id)?.into(),
cc: [ObjectId::new(community.actor_id())],
context: &Data<LemmyContext>,
request_counter: &mut i32,
) -> Result<(), LemmyError> {
+ verify_is_public(&self.to)?;
verify_activity(self, &context.settings())?;
verify_person_in_community(&self.actor, &self.cc[0], context, request_counter).await?;
verify_mod_action(&self.actor, &self.cc[0], context, request_counter).await?;
post::create_or_update::CreateOrUpdatePost,
verify_activity,
verify_community,
+ verify_is_public,
voting::{undo_vote::UndoVote, vote::Vote},
},
context::lemmy_context,
activity::kind::AnnounceType,
base::AnyBase,
primitives::OneOrMany,
+ public,
unparsed::Unparsed,
};
use lemmy_apub_lib::{
data::Data,
traits::{ActivityFields, ActivityHandler, ActorType},
- values::PublicUrl,
};
use lemmy_utils::LemmyError;
use lemmy_websocket::LemmyContext;
#[serde(rename_all = "camelCase")]
pub struct AnnounceActivity {
actor: ObjectId<ApubCommunity>,
- to: [PublicUrl; 1],
+ to: Vec<Url>,
object: AnnouncableActivities,
cc: Vec<Url>,
#[serde(rename = "type")]
) -> Result<(), LemmyError> {
let announce = AnnounceActivity {
actor: ObjectId::new(community.actor_id()),
- to: [PublicUrl::Public],
+ to: vec![public()],
object,
cc: vec![community.followers_url()],
kind: AnnounceType::Announce,
context: &Data<LemmyContext>,
request_counter: &mut i32,
) -> Result<(), LemmyError> {
+ verify_is_public(&self.to)?;
verify_activity(self, &context.settings())?;
verify_community(&self.actor, context, request_counter).await?;
self.object.verify(context, request_counter).await?;
community::{announce::AnnouncableActivities, send_to_community},
generate_activity_id,
verify_activity,
+ verify_is_public,
verify_mod_action,
verify_person_in_community,
},
activity::kind::BlockType,
base::AnyBase,
primitives::OneOrMany,
+ public,
unparsed::Unparsed,
};
use lemmy_api_common::blocking;
use lemmy_apub_lib::{
data::Data,
traits::{ActivityFields, ActivityHandler, ActorType},
- values::PublicUrl,
};
use lemmy_db_schema::{
source::community::{
#[serde(rename_all = "camelCase")]
pub struct BlockUserFromCommunity {
actor: ObjectId<ApubPerson>,
- to: [PublicUrl; 1],
+ to: Vec<Url>,
pub(in crate::activities::community) object: ObjectId<ApubPerson>,
cc: [ObjectId<ApubCommunity>; 1],
#[serde(rename = "type")]
) -> Result<BlockUserFromCommunity, LemmyError> {
Ok(BlockUserFromCommunity {
actor: ObjectId::new(actor.actor_id()),
- to: [PublicUrl::Public],
+ to: vec![public()],
object: ObjectId::new(target.actor_id()),
cc: [ObjectId::new(community.actor_id())],
kind: BlockType::Block,
context: &Data<LemmyContext>,
request_counter: &mut i32,
) -> Result<(), LemmyError> {
+ verify_is_public(&self.to)?;
verify_activity(self, &context.settings())?;
verify_person_in_community(&self.actor, &self.cc[0], context, request_counter).await?;
verify_mod_action(&self.actor, &self.cc[0], context, request_counter).await?;
generate_activity_id,
verify_activity,
verify_add_remove_moderator_target,
+ verify_is_public,
verify_mod_action,
verify_person_in_community,
},
activity::kind::RemoveType,
base::AnyBase,
primitives::OneOrMany,
+ public,
unparsed::Unparsed,
};
use lemmy_api_common::blocking;
use lemmy_apub_lib::{
data::Data,
traits::{ActivityFields, ActivityHandler, ActorType},
- values::PublicUrl,
};
use lemmy_db_schema::{
source::community::{CommunityModerator, CommunityModeratorForm},
#[serde(rename_all = "camelCase")]
pub struct RemoveMod {
actor: ObjectId<ApubPerson>,
- to: [PublicUrl; 1],
+ to: Vec<Url>,
pub(in crate::activities) object: ObjectId<ApubPerson>,
cc: [ObjectId<ApubCommunity>; 1],
#[serde(rename = "type")]
)?;
let remove = RemoveMod {
actor: ObjectId::new(actor.actor_id()),
- to: [PublicUrl::Public],
+ to: vec![public()],
object: ObjectId::new(removed_mod.actor_id()),
target: generate_moderators_url(&community.actor_id)?.into(),
id: id.clone(),
context: &Data<LemmyContext>,
request_counter: &mut i32,
) -> Result<(), LemmyError> {
+ verify_is_public(&self.to)?;
verify_activity(self, &context.settings())?;
verify_person_in_community(&self.actor, &self.cc[0], context, request_counter).await?;
verify_mod_action(&self.actor, &self.cc[0], context, request_counter).await?;
},
generate_activity_id,
verify_activity,
+ verify_is_public,
verify_mod_action,
verify_person_in_community,
},
activity::kind::UndoType,
base::AnyBase,
primitives::OneOrMany,
+ public,
unparsed::Unparsed,
};
use lemmy_api_common::blocking;
use lemmy_apub_lib::{
data::Data,
traits::{ActivityFields, ActivityHandler, ActorType},
- values::PublicUrl,
};
use lemmy_db_schema::{
source::community::{CommunityPersonBan, CommunityPersonBanForm},
#[serde(rename_all = "camelCase")]
pub struct UndoBlockUserFromCommunity {
actor: ObjectId<ApubPerson>,
- to: [PublicUrl; 1],
+ to: Vec<Url>,
object: BlockUserFromCommunity,
cc: [ObjectId<ApubCommunity>; 1],
#[serde(rename = "type")]
)?;
let undo = UndoBlockUserFromCommunity {
actor: ObjectId::new(actor.actor_id()),
- to: [PublicUrl::Public],
+ to: vec![public()],
object: block,
cc: [ObjectId::new(community.actor_id())],
kind: UndoType::Undo,
context: &Data<LemmyContext>,
request_counter: &mut i32,
) -> Result<(), LemmyError> {
+ verify_is_public(&self.to)?;
verify_activity(self, &context.settings())?;
verify_person_in_community(&self.actor, &self.cc[0], context, request_counter).await?;
verify_mod_action(&self.actor, &self.cc[0], context, request_counter).await?;
community::{announce::AnnouncableActivities, send_to_community},
generate_activity_id,
verify_activity,
+ verify_is_public,
verify_mod_action,
verify_person_in_community,
},
activity::kind::UpdateType,
base::AnyBase,
primitives::OneOrMany,
+ public,
unparsed::Unparsed,
};
use lemmy_api_common::blocking;
use lemmy_apub_lib::{
data::Data,
traits::{ActivityFields, ActivityHandler, ActorType, ApubObject},
- values::PublicUrl,
};
use lemmy_db_schema::{
source::community::{Community, CommunityForm},
#[serde(rename_all = "camelCase")]
pub struct UpdateCommunity {
actor: ObjectId<ApubPerson>,
- to: [PublicUrl; 1],
+ to: Vec<Url>,
// TODO: would be nice to use a separate struct here, which only contains the fields updated here
object: Group,
cc: [ObjectId<ApubCommunity>; 1],
)?;
let update = UpdateCommunity {
actor: ObjectId::new(actor.actor_id()),
- to: [PublicUrl::Public],
+ to: vec![public()],
object: community.to_apub(context).await?,
cc: [ObjectId::new(community.actor_id())],
kind: UpdateType::Update,
context: &Data<LemmyContext>,
request_counter: &mut i32,
) -> Result<(), LemmyError> {
+ verify_is_public(&self.to)?;
verify_activity(self, &context.settings())?;
verify_person_in_community(&self.actor, &self.cc[0], context, request_counter).await?;
verify_mod_action(&self.actor, &self.cc[0], context, request_counter).await?;
},
generate_activity_id,
verify_activity,
+ verify_is_public,
},
context::lemmy_context,
fetcher::object_id::ObjectId,
activity::kind::DeleteType,
base::AnyBase,
primitives::OneOrMany,
+ public,
unparsed::Unparsed,
};
use anyhow::anyhow;
use lemmy_apub_lib::{
data::Data,
traits::{ActivityFields, ActivityHandler, ActorType},
- values::PublicUrl,
};
use lemmy_db_schema::{
source::{
#[serde(rename_all = "camelCase")]
pub struct Delete {
actor: ObjectId<ApubPerson>,
- to: [PublicUrl; 1],
+ to: Vec<Url>,
pub(in crate::activities::deletion) object: Url,
pub(in crate::activities::deletion) cc: [ObjectId<ApubCommunity>; 1],
#[serde(rename = "type")]
context: &Data<LemmyContext>,
request_counter: &mut i32,
) -> Result<(), LemmyError> {
+ verify_is_public(&self.to)?;
verify_activity(self, &context.settings())?;
verify_delete_activity(
&self.object,
) -> Result<Delete, LemmyError> {
Ok(Delete {
actor: ObjectId::new(actor.actor_id()),
- to: [PublicUrl::Public],
+ to: vec![public()],
object: object_id,
cc: [ObjectId::new(community.actor_id())],
kind: DeleteType::Delete,
},
generate_activity_id,
verify_activity,
+ verify_is_public,
},
context::lemmy_context,
fetcher::object_id::ObjectId,
activity::kind::UndoType,
base::AnyBase,
primitives::OneOrMany,
+ public,
unparsed::Unparsed,
};
use anyhow::anyhow;
use lemmy_apub_lib::{
data::Data,
traits::{ActivityFields, ActivityHandler, ActorType},
- values::PublicUrl,
};
use lemmy_db_schema::source::{comment::Comment, community::Community, post::Post};
use lemmy_utils::LemmyError;
#[serde(rename_all = "camelCase")]
pub struct UndoDelete {
actor: ObjectId<ApubPerson>,
- to: [PublicUrl; 1],
+ to: Vec<Url>,
object: Delete,
cc: [ObjectId<ApubCommunity>; 1],
#[serde(rename = "type")]
context: &Data<LemmyContext>,
request_counter: &mut i32,
) -> Result<(), LemmyError> {
+ verify_is_public(&self.to)?;
verify_activity(self, &context.settings())?;
self.object.verify(context, request_counter).await?;
verify_delete_activity(
)?;
let undo = UndoDelete {
actor: ObjectId::new(actor.actor_id()),
- to: [PublicUrl::Public],
+ to: vec![public()],
object,
cc: [ObjectId::new(community.actor_id())],
kind: UndoType::Undo,
#[serde(rename_all = "camelCase")]
pub struct AcceptFollowCommunity {
actor: ObjectId<ApubCommunity>,
- to: ObjectId<ApubPerson>,
+ to: [ObjectId<ApubPerson>; 1],
object: FollowCommunity,
#[serde(rename = "type")]
kind: AcceptType,
.await?;
let accept = AcceptFollowCommunity {
actor: ObjectId::new(community.actor_id()),
- to: ObjectId::new(person.actor_id()),
+ to: [ObjectId::new(person.actor_id())],
object: follow,
kind: AcceptType::Accept,
id: generate_activity_id(
request_counter: &mut i32,
) -> Result<(), LemmyError> {
verify_activity(self, &context.settings())?;
- verify_urls_match(self.to.inner(), self.object.actor())?;
- verify_urls_match(self.actor(), self.object.to.inner())?;
+ verify_urls_match(self.to[0].inner(), self.object.actor())?;
+ verify_urls_match(self.actor(), self.object.to[0].inner())?;
verify_community(&self.actor, context, request_counter).await?;
self.object.verify(context, request_counter).await?;
Ok(())
request_counter: &mut i32,
) -> Result<(), LemmyError> {
let actor = self.actor.dereference(context, request_counter).await?;
- let to = self.to.dereference(context, request_counter).await?;
+ let to = self.to[0].dereference(context, request_counter).await?;
// This will throw an error if no follow was requested
blocking(context.pool(), move |conn| {
CommunityFollower::follow_accepted(conn, actor.id, to.id)
#[serde(rename_all = "camelCase")]
pub struct FollowCommunity {
pub(in crate::activities::following) actor: ObjectId<ApubPerson>,
- // TODO: is there any reason to put the same community id twice, in to and object?
- pub(in crate::activities::following) to: ObjectId<ApubCommunity>,
+ pub(in crate::activities::following) to: [ObjectId<ApubCommunity>; 1],
pub(in crate::activities::following) object: ObjectId<ApubCommunity>,
#[serde(rename = "type")]
kind: FollowType,
) -> Result<FollowCommunity, LemmyError> {
Ok(FollowCommunity {
actor: ObjectId::new(actor.actor_id()),
- to: ObjectId::new(community.actor_id()),
+ to: [ObjectId::new(community.actor_id())],
object: ObjectId::new(community.actor_id()),
kind: FollowType::Follow,
id: generate_activity_id(
request_counter: &mut i32,
) -> Result<(), LemmyError> {
verify_activity(self, &context.settings())?;
- verify_urls_match(self.to.inner(), self.object.inner())?;
+ verify_urls_match(self.to[0].inner(), self.object.inner())?;
verify_person(&self.actor, context, request_counter).await?;
Ok(())
}
request_counter: &mut i32,
) -> Result<(), LemmyError> {
let actor = self.actor.dereference(context, request_counter).await?;
- let community = self.object.dereference(context, request_counter).await?;
+ let community = self.to[0].dereference(context, request_counter).await?;
let community_follower_form = CommunityFollowerForm {
community_id: community.id,
person_id: actor.id,
#[serde(rename_all = "camelCase")]
pub struct UndoFollowCommunity {
actor: ObjectId<ApubPerson>,
- to: ObjectId<ApubCommunity>,
+ to: [ObjectId<ApubCommunity>; 1],
object: FollowCommunity,
#[serde(rename = "type")]
kind: UndoType,
let object = FollowCommunity::new(actor, community, context)?;
let undo = UndoFollowCommunity {
actor: ObjectId::new(actor.actor_id()),
- to: ObjectId::new(community.actor_id()),
+ to: [ObjectId::new(community.actor_id())],
object,
kind: UndoType::Undo,
id: generate_activity_id(
request_counter: &mut i32,
) -> Result<(), LemmyError> {
verify_activity(self, &context.settings())?;
- verify_urls_match(self.to.inner(), self.object.object.inner())?;
+ verify_urls_match(self.to[0].inner(), self.object.object.inner())?;
verify_urls_match(self.actor(), self.object.actor())?;
verify_person(&self.actor, context, request_counter).await?;
self.object.verify(context, request_counter).await?;
request_counter: &mut i32,
) -> Result<(), LemmyError> {
let actor = self.actor.dereference(context, request_counter).await?;
- let community = self.to.dereference(context, request_counter).await?;
+ let community = self.to[0].dereference(context, request_counter).await?;
let community_follower_form = CommunityFollowerForm {
community_id: community.id,
community::{announce::AnnouncableActivities, send_to_community},
generate_activity_id,
verify_activity,
+ verify_is_public,
verify_mod_action,
verify_person_in_community,
CreateOrUpdateType,
post::{ApubPost, Page},
},
};
-use activitystreams::{base::AnyBase, primitives::OneOrMany, unparsed::Unparsed};
+use activitystreams::{base::AnyBase, primitives::OneOrMany, public, unparsed::Unparsed};
use anyhow::anyhow;
use lemmy_api_common::blocking;
use lemmy_apub_lib::{
data::Data,
traits::{ActivityFields, ActivityHandler, ActorType, ApubObject},
- values::PublicUrl,
verify::{verify_domains_match, verify_urls_match},
};
use lemmy_db_schema::{source::community::Community, traits::Crud};
#[serde(rename_all = "camelCase")]
pub struct CreateOrUpdatePost {
actor: ObjectId<ApubPerson>,
- to: [PublicUrl; 1],
+ to: Vec<Url>,
object: Page,
cc: [ObjectId<ApubCommunity>; 1],
#[serde(rename = "type")]
)?;
Ok(CreateOrUpdatePost {
actor: ObjectId::new(actor.actor_id()),
- to: [PublicUrl::Public],
+ to: vec![public()],
object: post.to_apub(context).await?,
cc: [ObjectId::new(community.actor_id())],
kind,
context: &Data<LemmyContext>,
request_counter: &mut i32,
) -> Result<(), LemmyError> {
+ verify_is_public(&self.to)?;
verify_activity(self, &context.settings())?;
let community = self.cc[0].dereference(context, request_counter).await?;
verify_person_in_community(&self.actor, &self.cc[0], context, request_counter).await?;
pub context: OneOrMany<AnyBase>,
id: Url,
actor: ObjectId<ApubPerson>,
- to: ObjectId<ApubPerson>,
+ to: [ObjectId<ApubPerson>; 1],
object: Note,
#[serde(rename = "type")]
kind: CreateOrUpdateType,
context: lemmy_context(),
id: id.clone(),
actor: ObjectId::new(actor.actor_id()),
- to: ObjectId::new(recipient.actor_id()),
+ to: [ObjectId::new(recipient.actor_id())],
object: private_message.to_apub(context).await?,
kind,
unparsed: Default::default(),
#[serde(rename_all = "camelCase")]
pub struct DeletePrivateMessage {
actor: ObjectId<ApubPerson>,
- to: ObjectId<ApubPerson>,
+ to: [ObjectId<ApubPerson>; 1],
pub(in crate::activities::private_message) object: ObjectId<ApubPrivateMessage>,
#[serde(rename = "type")]
kind: DeleteType,
) -> Result<DeletePrivateMessage, LemmyError> {
Ok(DeletePrivateMessage {
actor: ObjectId::new(actor.actor_id()),
- to: ObjectId::new(actor.actor_id()),
+ to: [ObjectId::new(actor.actor_id())],
object: ObjectId::new(pm.ap_id.clone()),
kind: DeleteType::Delete,
id: generate_activity_id(
#[serde(rename_all = "camelCase")]
pub struct UndoDeletePrivateMessage {
actor: ObjectId<ApubPerson>,
- to: ObjectId<ApubPerson>,
+ to: [ObjectId<ApubPerson>; 1],
object: DeletePrivateMessage,
#[serde(rename = "type")]
kind: UndoType,
)?;
let undo = UndoDeletePrivateMessage {
actor: ObjectId::new(actor.actor_id()),
- to: ObjectId::new(recipient.actor_id()),
+ to: [ObjectId::new(recipient.actor_id())],
object,
kind: UndoType::Undo,
id: id.clone(),
community::{announce::AnnouncableActivities, send_to_community},
generate_activity_id,
verify_activity,
+ verify_is_public,
verify_person_in_community,
voting::{
undo_vote_comment,
activity::kind::UndoType,
base::AnyBase,
primitives::OneOrMany,
+ public,
unparsed::Unparsed,
};
use lemmy_api_common::blocking;
use lemmy_apub_lib::{
data::Data,
traits::{ActivityFields, ActivityHandler, ActorType},
- values::PublicUrl,
verify::verify_urls_match,
};
use lemmy_db_schema::{newtypes::CommunityId, source::community::Community, traits::Crud};
#[serde(rename_all = "camelCase")]
pub struct UndoVote {
actor: ObjectId<ApubPerson>,
- to: [PublicUrl; 1],
+ to: Vec<Url>,
object: Vote,
cc: [ObjectId<ApubCommunity>; 1],
#[serde(rename = "type")]
)?;
let undo_vote = UndoVote {
actor: ObjectId::new(actor.actor_id()),
- to: [PublicUrl::Public],
+ to: vec![public()],
object,
cc: [ObjectId::new(community.actor_id())],
kind: UndoType::Undo,
context: &Data<LemmyContext>,
request_counter: &mut i32,
) -> Result<(), LemmyError> {
+ verify_is_public(&self.to)?;
verify_activity(self, &context.settings())?;
verify_person_in_community(&self.actor, &self.cc[0], context, request_counter).await?;
verify_urls_match(self.actor(), self.object.actor())?;
community::{announce::AnnouncableActivities, send_to_community},
generate_activity_id,
verify_activity,
+ verify_is_public,
verify_person_in_community,
voting::{vote_comment, vote_post},
},
objects::{community::ApubCommunity, person::ApubPerson},
PostOrComment,
};
-use activitystreams::{base::AnyBase, primitives::OneOrMany, unparsed::Unparsed};
+use activitystreams::{base::AnyBase, primitives::OneOrMany, public, unparsed::Unparsed};
use anyhow::anyhow;
use lemmy_api_common::blocking;
use lemmy_apub_lib::{
data::Data,
traits::{ActivityFields, ActivityHandler, ActorType},
- values::PublicUrl,
};
use lemmy_db_schema::{newtypes::CommunityId, source::community::Community, traits::Crud};
use lemmy_utils::LemmyError;
#[serde(rename_all = "camelCase")]
pub struct Vote {
actor: ObjectId<ApubPerson>,
- to: [PublicUrl; 1],
+ to: Vec<Url>,
pub(in crate::activities::voting) object: ObjectId<PostOrComment>,
cc: [ObjectId<ApubCommunity>; 1],
#[serde(rename = "type")]
) -> Result<Vote, LemmyError> {
Ok(Vote {
actor: ObjectId::new(actor.actor_id()),
- to: [PublicUrl::Public],
+ to: vec![public()],
object: ObjectId::new(object.ap_id()),
cc: [ObjectId::new(community.actor_id())],
kind: kind.clone(),
context: &Data<LemmyContext>,
request_counter: &mut i32,
) -> Result<(), LemmyError> {
+ verify_is_public(&self.to)?;
verify_activity(self, &context.settings())?;
verify_person_in_community(&self.actor, &self.cc[0], context, request_counter).await?;
Ok(())
use lemmy_db_views_actor::community_follower_view::CommunityFollowerView;
use lemmy_utils::LemmyError;
use lemmy_websocket::LemmyContext;
-use log::trace;
+use log::info;
use serde::{Deserialize, Serialize};
#[derive(Deserialize)]
context: web::Data<LemmyContext>,
) -> Result<HttpResponse, LemmyError> {
let unparsed = payload_to_string(payload).await?;
- trace!("Received community inbox activity {}", unparsed);
+ info!("Received community inbox activity {}", unparsed);
let activity = serde_json::from_str::<GroupInboxActivities>(&unparsed)?;
receive_group_inbox(activity.clone(), request, &context).await?;
use lemmy_db_schema::{source::activity::Activity, DbPool};
use lemmy_utils::{location_info, LemmyError};
use lemmy_websocket::LemmyContext;
-use log::{info, trace};
+use log::info;
use serde::{Deserialize, Serialize};
use std::{fmt::Debug, io::Read};
use url::Url;
context: web::Data<LemmyContext>,
) -> Result<HttpResponse, LemmyError> {
let unparsed = payload_to_string(payload).await?;
- trace!("Received shared inbox activity {}", unparsed);
+ info!("Received shared inbox activity {}", unparsed);
let activity = serde_json::from_str::<SharedInboxActivities>(&unparsed)?;
match activity {
SharedInboxActivities::GroupInboxActivities(g) => {
use lemmy_db_schema::source::person::Person;
use lemmy_utils::LemmyError;
use lemmy_websocket::LemmyContext;
-use log::trace;
+use log::info;
use serde::{Deserialize, Serialize};
use url::Url;
context: web::Data<LemmyContext>,
) -> Result<HttpResponse, LemmyError> {
let unparsed = payload_to_string(payload).await?;
- trace!("Received person inbox activity {}", unparsed);
+ info!("Received person inbox activity {}", unparsed);
let activity = serde_json::from_str::<PersonInboxActivities>(&unparsed)?;
receive_person_inbox(activity, request, &context).await
}
use serde::{Deserialize, Serialize};
-/// The identifier used to address activities to the public.
-///
-/// <https://www.w3.org/TR/activitypub/#public-addressing>
-#[derive(Debug, Clone, Deserialize, Serialize)]
-pub enum PublicUrl {
- #[serde(rename = "https://www.w3.org/ns/activitystreams#Public")]
- Public,
-}
-
/// Media type for markdown text.
///
/// <https://www.iana.org/assignments/media-types/media-types.xhtml>