mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2025-05-05 03:18:44 +00:00
Add "mute (keep notifications)" button
This commit is contained in:
parent
7d389d2258
commit
4d68062f2d
4 changed files with 21 additions and 5 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue