mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-10-01 01:36:12 -04:00
Make Undo/Block work for remote mods
This commit is contained in:
parent
01a514f969
commit
80ce7f19ec
@ -208,6 +208,7 @@ impl CommunityType for Community {
|
||||
.set_to(public())
|
||||
.set_many_ccs(ccs);
|
||||
|
||||
dbg!(&object_actor_inbox);
|
||||
send_to_community_followers(announce, self, object_actor_inbox, context).await?;
|
||||
|
||||
Ok(())
|
||||
|
@ -241,7 +241,18 @@ pub(crate) async fn community_receive_message(
|
||||
if do_announce {
|
||||
// Check again that the activity is public, just to be sure
|
||||
verify_is_addressed_to_public(&activity)?;
|
||||
let object_actor = activity.object().clone().single_xsd_any_uri();
|
||||
let mut object_actor = activity.object().clone().single_xsd_any_uri();
|
||||
// If activity is something like Undo/Block, we need to access activity.object.object
|
||||
if object_actor.is_none() {
|
||||
object_actor = activity
|
||||
.object()
|
||||
.as_one()
|
||||
.map(|a| ActorAndObject::from_any_base(a.to_owned()).ok())
|
||||
.flatten()
|
||||
.flatten()
|
||||
.map(|a: ActorAndObject<CommunityValidTypes>| a.object().to_owned().single_xsd_any_uri())
|
||||
.flatten();
|
||||
}
|
||||
to_community
|
||||
.send_announce(activity.into_any_base()?, object_actor, context)
|
||||
.await?;
|
||||
|
@ -34,6 +34,7 @@ pub enum ValidTypes {
|
||||
Remove,
|
||||
Announce,
|
||||
Add,
|
||||
Block,
|
||||
}
|
||||
|
||||
// TODO: this isnt entirely correct, cause some of these receive are not ActorAndObject,
|
||||
|
Loading…
Reference in New Issue
Block a user