mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2024-12-24 14:39:48 +00:00
Add direct timeline
This commit is contained in:
parent
a877c58ac3
commit
2c084dfd09
@ -329,3 +329,15 @@ func (c *Client) UploadMediaFromMultipartFileHeader(ctx context.Context, fh *mul
|
|||||||
}
|
}
|
||||||
return &attachment, nil
|
return &attachment, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetTimelineDirect return statuses from direct timeline.
|
||||||
|
func (c *Client) GetTimelineDirect(ctx context.Context, pg *Pagination) ([]*Status, error) {
|
||||||
|
params := url.Values{}
|
||||||
|
|
||||||
|
var statuses []*Status
|
||||||
|
err := c.doAPI(ctx, http.MethodGet, "/api/v1/timelines/direct", params, &statuses, pg)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return statuses, nil
|
||||||
|
}
|
||||||
|
@ -211,6 +211,9 @@ func (svc *service) ServeTimelinePage(ctx context.Context, c *model.Client,
|
|||||||
case "home":
|
case "home":
|
||||||
statuses, err = c.GetTimelineHome(ctx, &pg)
|
statuses, err = c.GetTimelineHome(ctx, &pg)
|
||||||
title = "Timeline"
|
title = "Timeline"
|
||||||
|
case "direct":
|
||||||
|
statuses, err = c.GetTimelineDirect(ctx, &pg)
|
||||||
|
title = "Local Timeline"
|
||||||
case "local":
|
case "local":
|
||||||
statuses, err = c.GetTimelinePublic(ctx, true, &pg)
|
statuses, err = c.GetTimelinePublic(ctx, true, &pg)
|
||||||
title = "Local Timeline"
|
title = "Local Timeline"
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<a class="nav-link" href="/timeline/home">home</a>
|
<a class="nav-link" href="/timeline/home">home</a>
|
||||||
<a class="nav-link" href="/notifications">notifications{{if gt .NotificationCount 0}}({{.NotificationCount}}){{end}}</a>
|
<a class="nav-link" href="/notifications">notifications{{if gt .NotificationCount 0}}({{.NotificationCount}}){{end}}</a>
|
||||||
|
<a class="nav-link" href="/timeline/direct">direct</a>
|
||||||
<a class="nav-link" href="/timeline/local">local</a>
|
<a class="nav-link" href="/timeline/local">local</a>
|
||||||
<a class="nav-link" href="/timeline/twkn">twkn</a>
|
<a class="nav-link" href="/timeline/twkn">twkn</a>
|
||||||
<a class="nav-link" href="/search">search</a>
|
<a class="nav-link" href="/search">search</a>
|
||||||
|
Loading…
Reference in New Issue
Block a user