Comment all new code
Some checks are pending
/ test (push) Waiting to run

This commit is contained in:
Melody Becker 2025-04-02 15:33:07 +02:00
parent b6f12b7acf
commit 8f8ad3035a
Signed by: mstar
SSH key fingerprint: SHA256:9VAo09aaVNTWKzPW7Hq2LW+ox9OdwmTSHRoD4mlz1yI
33 changed files with 166 additions and 111 deletions

View file

@ -6,26 +6,27 @@ import (
"gorm.io/gorm"
)
// A feed is the initial entry point for all inbound Activitypub events.
// A feed is the initial entry point for inbound Activitypub events.
// However, its primary and only user-facing use case is to be a collection
// of inbound messages, nothing else.
//
// Thus, the flow for inbound events is the following:
// If the event is a note:
// Feeds are split into two groups, default and non-default.
// Default feeds are feeds automatically created for each user, where their normal
// timeline lives in. Additionally, they also relay inbound non-note events,
// such as likes/reactions, boosts or follow requests, to their owner.
// Default feeds also act using their owner's username (others would ge a follow request from
// `username@host`).
//
// Add it to the receiving feed. If it's a reply and the feed is a default
// create a notification for the owner
//
// If it's an event:
//
// If the feed is not a default feed for a user, discard the event
// If it is the default feed for a user, create a notification for the owner
// Non-default feeds, in comparison, are explicitly created by users and can be shared
// between them. Thus, they also only accept note events, dropping everything else.
// They also are explicitly labeled as such when issuing follow requests (ex `somename-feed@host`)
type Feed struct {
gorm.Model
// The name of the feed. Will be equal to the owner username if a default feed
Name string
Owner User
OwnerId string
IsDefault bool // Whether the feed is the default one for the user
Owner User // The owner of the feed
OwnerId string // Id of the owner
IsDefault bool // Whether the feed is the default one for the user
// If a feed is the default one for a user, use that user's public key.
// Otherwise, use its own key
PublicKey sql.NullString