# Unfollow & soft block in c2s - how to find the original Follow in order to undo / reject?

**URL:** <https://socialhub.activitypub.rocks/t/unfollow-soft-block-in-c2s-how-to-find-the-original-follow-in-order-to-undo-reject/1484>\
**Category:** Client to Server\
**Created:** [March 5, 2021, 9:30pm UTC](https://socialhub.activitypub.rocks/t/unfollow-soft-block-in-c2s-how-to-find-the-original-follow-in-order-to-undo-reject/1484 "2021-03-05T21:30:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![datatitian](https://socialhub.activitypub.rocks/user_avatar/socialhub.activitypub.rocks/datatitian/32/625_2.png) [@datatitian](https://socialhub.activitypub.rocks/u/datatitian)\
**Post date:** [March 5, 2021, 9:30pm UTC](https://socialhub.activitypub.rocks/t/unfollow-soft-block-in-c2s-how-to-find-the-original-follow-in-order-to-undo-reject/1484/1 "2021-03-05T21:30:40Z")

</div>

If I want to stop following someone, I believe I should send an Undo whose object is the Follow that I sent them in the past. Likewise, if I want to rescind permission to follow me, I should either Reject the Follow they originally sent me or perhaps Undo my Accept.

In all those cases, I need a reference to a potentially very old activity to be the object of my new activity. How can I find that within a client-to-server implementation?

The way `activitypub-express` works, I am actually looking up those old Follows whenever I’m fetching `Following` & `Followers` collections, but spec says those endpoints return actors rather than activities, so the activity id I need does not reach the client.

The only other option I see that is strictly C2S spec would be to crawl my inbox or outbox page-by-page until I find the Follow I seek, but this could be a really long journey.

Am I missing something obvious? If I implement a custom unfollow endpoint, is my implementation no longer a true Client-to-Server AP implementation?

---

<div class="post-metadata">

**Author:** ![datatitian](https://socialhub.activitypub.rocks/user_avatar/socialhub.activitypub.rocks/datatitian/32/625_2.png) [@datatitian](https://socialhub.activitypub.rocks/u/datatitian)\
**Post date:** [March 5, 2021, 10:29pm UTC](https://socialhub.activitypub.rocks/t/unfollow-soft-block-in-c2s-how-to-find-the-original-follow-in-order-to-undo-reject/1484/2 "2021-03-05T22:29:53Z")

</div>

Answer via [ActivityPub Guppe group](https://gup.pe/u/activitypub):

> [22m](https://banana.dog/@yaaps/105839457031509053)[**yaaps :verified:** @yaaps@banana.dog](https://banana.dog/@yaaps)  
> When undo or reject is the correct semantics to change a follower or following status, then the original activity will be in scope. If the original activity isn’t trivial to reference, e.g. because the client is referencing the actor in a collection, then the client should remove the actor from the collection

> [**Will 🌹🏴** @datatitian](https://social.coop/@datatitian)  
> [@yaaps](https://banana.dog/@yaaps) [@activitypub](https://gup.pe/u/activitypub) ohhhhh. Client sends type: “Remove”, object: actorId, target: followers - and the server handles building the undo or reject to publish? That would work

---

<div class="post-metadata">

**Author:** ![datatitian](https://socialhub.activitypub.rocks/user_avatar/socialhub.activitypub.rocks/datatitian/32/625_2.png) [@datatitian](https://socialhub.activitypub.rocks/u/datatitian)\
**Post date:** [March 6, 2021, 3:21pm UTC](https://socialhub.activitypub.rocks/t/unfollow-soft-block-in-c2s-how-to-find-the-original-follow-in-order-to-undo-reject/1484/3 "2021-03-06T15:21:19Z")

</div>

While “remove from follow[ers/ing]” makes a lot of semantic sense, when implementing it was going to take a lot of special casing to get it to work with the existing validation and logic for “Remove” (i.e. removing an object from an actor’s miscellaneous streams).

So instead I added special casing to the validation for “Reject” & “Undo” that allows the client to send an Actor ID as the object and the server then finds and substitutes the related Follow

> <https://github.com/immers-space/activitypub-express/pull/36>
>
> Unfollow was difficult to achieve because you need a reference to a past follow …activity, this change allows the client to send a actor id instead and the server finds the necessary Follow activity and inserts it into the outgoing Undo/Reject

---

<div class="post-metadata">

**Author:** ![lanodan](https://socialhub.activitypub.rocks/user_avatar/socialhub.activitypub.rocks/lanodan/32/40_2.png) [@lanodan](https://socialhub.activitypub.rocks/u/lanodan)\
**Post date:** [March 7, 2021, 8:21pm UTC](https://socialhub.activitypub.rocks/t/unfollow-soft-block-in-c2s-how-to-find-the-original-follow-in-order-to-undo-reject/1484/4 "2021-03-07T20:21:33Z")

</div>

Add/Remove from follow\* collections makes sense but I’m not so sure about how well it’s going to be supported as it’s a workaround that requires extraneous transformation _just_ for AP C2S.

I think the filtering extensions in [https://github.com/go-ap/fedbox/blob/76081eb477da9819f3f344ea6530ad5a6ef8c788/doc/c2s.md](https://github.com/go-ap/fedbox/blob/76081eb477da9819f3f344ea6530ad5a6ef8c788/doc/c2s.md) by @marius are much better for this kind of thing (related fediverse thread: [https://metalhead.club/@mariusor/105802934292952905](https://metalhead.club/@mariusor/105802934292952905)).  
(haven’t tried to implement them in pleroma yet but should be easy enough)

---

<div class="post-metadata">

**Author:** ![kaniini](https://socialhub.activitypub.rocks/user_avatar/socialhub.activitypub.rocks/kaniini/32/89_2.png) [@kaniini](https://socialhub.activitypub.rocks/u/kaniini)\
**Post date:** [March 8, 2021, 6:07am UTC](https://socialhub.activitypub.rocks/t/unfollow-soft-block-in-c2s-how-to-find-the-original-follow-in-order-to-undo-reject/1484/5 "2021-03-08T06:07:40Z")

</div>

In Jejune, the general idea is that you would perform an Undo Follow that describes the original follow, and then not care about the `id`. This works because it’s really the side effect we’re after (removal from followers collection).
