Decode unfollow activities in inbox properly (#316)

This commit is contained in:
KokaKiwi 2018-11-23 13:17:37 +01:00 committed by Baptiste Gelez
parent 00a205a882
commit 67fe28177e

View file

@ -1,4 +1,15 @@
use activitypub::{activity::{Announce, Create, Delete, Like, Undo, Update}, object::Tombstone}; use activitypub::{
activity::{
Announce,
Create,
Delete,
Follow as FollowAct,
Like,
Undo,
Update
},
object::Tombstone
};
use failure::Error; use failure::Error;
use serde_json; use serde_json;
@ -57,7 +68,7 @@ pub trait Inbox {
Ok(()) Ok(())
}, },
"Follow" => { "Follow" => {
Follow::delete_id(act.undo_props.object_object::<Like>()?.object_props.id_string()?, actor_id.into(), conn); Follow::delete_id(act.undo_props.object_object::<FollowAct>()?.object_props.id_string()?, actor_id.into(), conn);
Ok(()) Ok(())
} }
_ => Err(InboxError::CantUndo)? _ => Err(InboxError::CantUndo)?