From db29c3d87404677c9c02f62097d8a0307cd8d5da Mon Sep 17 00:00:00 2001 From: r Date: Mon, 13 Dec 2021 13:58:15 +0000 Subject: Add an option to hide unsupported notifications --- service/service.go | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'service/service.go') diff --git a/service/service.go b/service/service.go index 7122666..9cad731 100644 --- a/service/service.go +++ b/service/service.go @@ -410,18 +410,29 @@ func (s *service) NotificationPage(c *client, maxID string, var nextLink string var unreadCount int var readID string - var excludes []string + var includes, excludes []string var pg = mastodon.Pagination{ MaxID: maxID, MinID: minID, Limit: 20, } + if c.s.Settings.HideUnsupportedNotifs { + // Explicitly include the supported types. + // For now, only Pleroma supports this option, Mastadon + // will simply ignore the unknown params. + includes = []string{"follow", "follow_request", "mention", "reblog", "favourite"} + + // Explicitly exclude the unsupported types. + // Pleroma prioritizes includes over excludes, but we + // still specify excludes to make it work with Mastadon. + excludes = []string{"poll"} + } if c.s.Settings.AntiDopamineMode { - excludes = []string{"follow", "favourite", "reblog"} + excludes = append(excludes, "follow", "favourite", "reblog") } - notifications, err := c.GetNotifications(c.ctx, &pg, excludes) + notifications, err := c.GetNotifications(c.ctx, &pg, includes, excludes) if err != nil { return } -- cgit v1.2.3