32 lines
904 B
Go
32 lines
904 B
Go
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
|
|
}
|