Add initial feed structure, fix passkey id usage

This commit is contained in:
Melody Becker 2025-04-02 13:44:33 +02:00
parent ef91558600
commit 420f6e46c0
Signed by: mstar
SSH key fingerprint: SHA256:9VAo09aaVNTWKzPW7Hq2LW+ox9OdwmTSHRoD4mlz1yI
6 changed files with 162 additions and 118 deletions

View file

@ -0,0 +1,32 @@
package models
import (
"database/sql"
"gorm.io/gorm"
)
// A feed is the initial entry point for all 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:
//
// 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
type Feed struct {
gorm.Model
Name string
Owner User
OwnerId string
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
}