Add initial feed structure, fix passkey id usage
This commit is contained in:
parent
ef91558600
commit
420f6e46c0
6 changed files with 162 additions and 118 deletions
32
storage-new/models/Feed.go
Normal file
32
storage-new/models/Feed.go
Normal 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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue