mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-24 03:03:33 -06:00
parent
8c9a853343
commit
16e486ad96
5 changed files with 100 additions and 26 deletions
|
|
@ -125,16 +125,22 @@ type timeline struct {
|
|||
}
|
||||
|
||||
// NewTimeline returns a new Timeline for the given account ID
|
||||
func NewTimeline(accountID string, db db.DB, typeConverter typeutils.TypeConverter, log *logrus.Logger) Timeline {
|
||||
func NewTimeline(accountID string, db db.DB, typeConverter typeutils.TypeConverter, log *logrus.Logger) (Timeline, error) {
|
||||
timelineOwnerAccount := >smodel.Account{}
|
||||
if err := db.GetByID(accountID, timelineOwnerAccount); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &timeline{
|
||||
postIndex: &postIndex{},
|
||||
preparedPosts: &preparedPosts{},
|
||||
accountID: accountID,
|
||||
account: timelineOwnerAccount,
|
||||
db: db,
|
||||
filter: visibility.NewFilter(db, log),
|
||||
tc: typeConverter,
|
||||
log: log,
|
||||
}
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (t *timeline) Reset() error {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue