This commit is contained in:
parent
b6f12b7acf
commit
8f8ad3035a
33 changed files with 166 additions and 111 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue