Drop feeds/merge them into user

This commit is contained in:
Melody Becker 2025-07-11 10:12:52 +02:00
parent 59373c6380
commit f12059c760
13 changed files with 78 additions and 920 deletions

View file

@ -6,7 +6,6 @@ var AllTypes = []any{
&Collection{},
&Emote{},
&FailedOutboundRequest{},
&Feed{},
&MediaMetadata{},
&Note{},
&NoteEdit{},

View file

@ -1,37 +0,0 @@
package models
import (
"database/sql"
"gorm.io/gorm"
)
// 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.
//
// 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`).
//
// 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 // 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
}
// Suffix added to feeds created as the default feed for a user
const FeedDefaultSuffix = "-default"
const GlobalFeedName = "global"

View file

@ -25,7 +25,7 @@ type NoteToFeed struct {
CreatedAt time.Time
Note Note // The note being assigned
NoteId string
Feed *Feed
FeedId uint64
ForUser *User
ForUserId string
Reason string
}

View file

@ -73,6 +73,12 @@ type User struct {
FinishedRegistration bool // Whether this account has completed registration yet
PrivateKeyRsa []byte
PrivateKeyEd []byte
// Is this user a placeholder for a feed?
// If yes, various settings will be forcefully overwritten
// Description says that it's a feed, displayname will have -feed appended,
// all optional feeds are empty, always verified and registration complete
// not indexable, marked as bot, restricted follows with auto-reject
IsFeed bool
RawData []byte

View file

@ -13,10 +13,6 @@ type UserToUserRelation struct {
}
type IUserToUserRelation interface {
// FIXME: Include local users in these queries
// Currently local users don't have an entry in user_remote_links
// causing them to be ignored by these functions as of now
// Get all inbox links for accounts following the user with the specified id
//
// SELECT u.inbox_link