mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-31 23:52:26 -05:00
Tidy + timeline embetterment (#38)
* tidy up timelines a bit + stub out some endpoints * who's faved and who's boosted, reblog notifs * linting * Update progress with new endpoints
This commit is contained in:
parent
3d77f81c7f
commit
6ac6f8d614
23 changed files with 692 additions and 15 deletions
|
|
@ -28,13 +28,36 @@ import (
|
|||
)
|
||||
|
||||
func (p *processor) HomeTimelineGet(authed *oauth.Auth, maxID string, sinceID string, minID string, limit int, local bool) ([]apimodel.Status, ErrorWithCode) {
|
||||
l := p.log.WithField("func", "HomeTimelineGet")
|
||||
|
||||
statuses, err := p.db.GetHomeTimelineForAccount(authed.Account.ID, maxID, sinceID, minID, limit, local)
|
||||
if err != nil {
|
||||
return nil, NewErrorInternalError(err)
|
||||
}
|
||||
|
||||
s, err := p.filterStatuses(authed, statuses)
|
||||
if err != nil {
|
||||
return nil, NewErrorInternalError(err)
|
||||
}
|
||||
|
||||
return s, nil
|
||||
}
|
||||
|
||||
func (p *processor) PublicTimelineGet(authed *oauth.Auth, maxID string, sinceID string, minID string, limit int, local bool) ([]apimodel.Status, ErrorWithCode) {
|
||||
statuses, err := p.db.GetPublicTimelineForAccount(authed.Account.ID, maxID, sinceID, minID, limit, local)
|
||||
if err != nil {
|
||||
return nil, NewErrorInternalError(err)
|
||||
}
|
||||
|
||||
s, err := p.filterStatuses(authed, statuses)
|
||||
if err != nil {
|
||||
return nil, NewErrorInternalError(err)
|
||||
}
|
||||
|
||||
return s, nil
|
||||
}
|
||||
|
||||
func (p *processor) filterStatuses(authed *oauth.Auth, statuses []*gtsmodel.Status) ([]apimodel.Status, error) {
|
||||
l := p.log.WithField("func", "filterStatuses")
|
||||
|
||||
apiStatuses := []apimodel.Status{}
|
||||
for _, s := range statuses {
|
||||
targetAccount := >smodel.Account{}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue