purifetchi / Toki

A C# Fediverse server.
GNU Affero General Public License v3.0
47 stars 1 forks source link

Sending a Like/Announce activity should pick the actor's followers collection. #26

Closed purifetchi closed 2 months ago

purifetchi commented 2 months ago

For now when we send a Like/Announce to a post, we render the followers collection of the actor who's made the Note, which is... wrong. Instead we should render the collection of the actor who made the activity, and attach the receiving actor in the "to" field.

{
    "@context":
    [
        "https://www.w3.org/ns/activitystreams",
        "https://w3id.org/security/v1",
        {
            "Bite": "https://ns.mia.jetzt/as#Bite",
            "Emoji": "toot:Emoji",
            "EmojiReact": "litepub:EmojiReact",
            "Hashtag": "as:Hashtag",
            "PropertyValue": "schema:PropertyValue",
            "fedibird": "http://fedibird.com/ns#",
            "sensitive": "as:sensitive",
            "toot": "http://joinmastodon.org/ns#",
            "value": "schema:value",
            "isCat": "https://misskey-hub.net/ns#isCat",
            "litepub": "http://litepub.social/ns#",
            "manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
            "quoteUri": "fedibird:quoteUri",
            "schema": "http://schema.org#"
        }
    ],
    "actor": "https://testpilot.shinolabs.com/users/prefetcher",
    "object": "https://miku.place/objects/931c458c-03f9-43ba-84cb-585b2b706a17",
    "to":
    [
        "https://www.w3.org/ns/activitystreams#Public",
        "https://testpilot.shinolabs.com/users/prefetcher@miku.place/followers"
    ],
    "id": "https://testpilot.shinolabs.com/users/prefetcher#likes/01HVH4M8XZ6PMJRHJ29F5G93E9",
    "type": "Like",
    "published": "2024-04-16T10:23:09.3652372+00:00"
}