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
1 changed files with 13 additions and 2 deletions

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 serde_json;
@ -57,7 +68,7 @@ pub trait Inbox {
Ok(())
},
"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(())
}
_ => Err(InboxError::CantUndo)?