diff options
author | r <r@freesoftwareextremist.com> | 2022-01-27 12:05:15 +0000 |
---|---|---|
committer | r <r@freesoftwareextremist.com> | 2022-01-27 12:05:15 +0000 |
commit | b8c0133bcd5e7f1d4063ad992949cc19d18e7aad (patch) | |
tree | 5322b83d194c9ffcb498627bdd16175f9508d87d /service/transport.go | |
parent | 54c42455f393c5ae8ebdb19884d40ebd9a18f755 (diff) | |
parent | 4ef5e0daf285f41850c9ac53b0322d85fbf5eaec (diff) | |
download | bloat-b8c0133bcd5e7f1d4063ad992949cc19d18e7aad.tar.gz bloat-b8c0133bcd5e7f1d4063ad992949cc19d18e7aad.zip |
Merge branch 'master' into absolute_fluoride
Diffstat (limited to 'service/transport.go')
-rw-r--r-- | service/transport.go | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/service/transport.go b/service/transport.go index a022b02..02e6106 100644 --- a/service/transport.go +++ b/service/transport.go @@ -415,7 +415,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 } @@ -484,20 +490,22 @@ func NewHandler(s *service, logger *log.Logger, staticDir string) http.Handler { fluorideMode := c.r.FormValue("fluoride_mode") == "true" darkMode := c.r.FormValue("dark_mode") == "true" antiDopamineMode := c.r.FormValue("anti_dopamine_mode") == "true" + hideUnsupportedNotifs := c.r.FormValue("hide_unsupported_notifs") == "true" css := c.r.FormValue("css") settings := &model.Settings{ - DefaultVisibility: visibility, - DefaultFormat: format, - CopyScope: copyScope, - ThreadInNewTab: threadInNewTab, - HideAttachments: hideAttachments, - MaskNSFW: maskNSFW, - NotificationInterval: ni, - FluorideMode: fluorideMode, - DarkMode: darkMode, - AntiDopamineMode: antiDopamineMode, - CSS: css, + DefaultVisibility: visibility, + DefaultFormat: format, + CopyScope: copyScope, + ThreadInNewTab: threadInNewTab, + HideAttachments: hideAttachments, + MaskNSFW: maskNSFW, + NotificationInterval: ni, + FluorideMode: fluorideMode, + DarkMode: darkMode, + AntiDopamineMode: antiDopamineMode, + HideUnsupportedNotifs: hideUnsupportedNotifs, + CSS: css, } err := s.SaveSettings(c, settings) |