aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorr <r@freesoftwareextremist.com>2020-09-27 09:44:52 +0000
committerr <r@freesoftwareextremist.com>2020-09-27 09:45:48 +0000
commit0df863ac4031e26e3cb64779618e0733d9686fc0 (patch)
tree9b02dcca549ea4adffaea6954efd69c69bff6759
parentda22d19fb45b5504f4191ad06d4e7637bfbc3916 (diff)
downloadbloat-0df863ac4031e26e3cb64779618e0733d9686fc0.tar.gz
bloat-0df863ac4031e26e3cb64779618e0733d9686fc0.zip
Add mutes list
-rw-r--r--service/service.go12
-rw-r--r--templates/user.tmpl7
2 files changed, 18 insertions, 1 deletions
diff --git a/service/service.go b/service/service.go
index de450b9..f268e30 100644
--- a/service/service.go
+++ b/service/service.go
@@ -517,6 +517,18 @@ func (svc *service) ServeUserPage(c *model.Client, id string, pageType string,
nextLink = fmt.Sprintf("/user/%s/bookmarks?max_id=%s",
id, pg.MaxID)
}
+ case "mutes":
+ if !isCurrent {
+ return errInvalidArgument
+ }
+ users, err = c.GetMutes(ctx, &pg)
+ if err != nil {
+ return
+ }
+ if len(users) == 20 && len(pg.MaxID) > 0 {
+ nextLink = fmt.Sprintf("/user/%s/mutes?max_id=%s",
+ id, pg.MaxID)
+ }
default:
return errInvalidArgument
}
diff --git a/templates/user.tmpl b/templates/user.tmpl
index 3bb7523..ce91091 100644
--- a/templates/user.tmpl
+++ b/templates/user.tmpl
@@ -99,7 +99,8 @@
</div>
{{if .IsCurrent}}
<div>
- <a href="/user/{{.User.ID}}/bookmarks"> bookmarks </a>
+ <a href="/user/{{.User.ID}}/bookmarks"> bookmarks </a> -
+ <a href="/user/{{.User.ID}}/mutes"> mutes </a>
</div>
{{end}}
<div>
@@ -143,6 +144,10 @@
{{else}}
<div class="no-data-found">No data found</div>
{{end}}
+
+{{else if eq .Type "mutes"}}
+<div class="page-title"> Mutes </div>
+{{template "userlist.tmpl" (WithContext .Users $.Ctx)}}
{{end}}
<div class="pagination">