Add "mute (keep notifications)" button

This commit is contained in:
r 2021-10-29 14:20:15 +00:00
parent 7d389d2258
commit 4d68062f2d
4 changed files with 21 additions and 5 deletions

View file

@ -907,8 +907,8 @@ func (s *service) Reject(c *client, id string) (err error) {
return c.FollowRequestReject(c.ctx, id)
}
func (s *service) Mute(c *client, id string) (err error) {
_, err = c.AccountMute(c.ctx, id)
func (s *service) Mute(c *client, id string, notifications *bool) (err error) {
_, err = c.AccountMute(c.ctx, id, notifications)
return
}

View file

@ -406,7 +406,13 @@ func NewHandler(s *service, logger *log.Logger, staticDir string) http.Handler {
mute := handle(func(c *client) error {
id, _ := mux.Vars(c.r)["id"]
err := s.Mute(c, id)
q := c.r.URL.Query()
var notifications *bool
if r, ok := q["notifications"]; ok && len(r) > 0 {
notifications = new(bool)
*notifications = r[0] == "true"
}
err := s.Mute(c, id, notifications)
if err != nil {
return err
}