diff --git a/service/service.go b/service/service.go index 0b23d47..9190ca4 100644 --- a/service/service.go +++ b/service/service.go @@ -541,6 +541,18 @@ func (svc *service) ServeUserPage(c *model.Client, id string, pageType string, nextLink = fmt.Sprintf("/user/%s/blocks?max_id=%s", id, pg.MaxID) } + case "likes": + if !isCurrent { + return errInvalidArgument + } + statuses, err = c.GetFavourites(ctx, &pg) + if err != nil { + return + } + if len(statuses) == 20 && len(pg.MaxID) > 0 { + nextLink = fmt.Sprintf("/user/%s/likes?max_id=%s", + id, pg.MaxID) + } default: return errInvalidArgument } diff --git a/templates/user.tmpl b/templates/user.tmpl index d260848..b7a12b9 100644 --- a/templates/user.tmpl +++ b/templates/user.tmpl @@ -100,6 +100,7 @@ {{if .IsCurrent}}
bookmarks - + likes - mutes - blocks
@@ -146,6 +147,14 @@
No data found
{{end}} +{{else if eq .Type "likes"}} +
Likes
+{{range .Statuses}} +{{template "status.tmpl" (WithContext . $.Ctx)}} +{{else}} +
No data found
+{{end}} + {{else if eq .Type "mutes"}}
Mutes
{{template "userlist.tmpl" (WithContext .Users $.Ctx)}}