From 4fecd68d4c40b6f55ae9cadfd5c4ebefb4ccfe78 Mon Sep 17 00:00:00 2001 From: noellabo Date: Wed, 19 May 2021 21:50:44 +0900 Subject: [PATCH] Fix hiding notifications for incompatible clients --- app/controllers/api/v1/notifications_controller.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/controllers/api/v1/notifications_controller.rb b/app/controllers/api/v1/notifications_controller.rb index f9d780839..3fe84c2a1 100644 --- a/app/controllers/api/v1/notifications_controller.rb +++ b/app/controllers/api/v1/notifications_controller.rb @@ -75,7 +75,16 @@ class Api::V1::NotificationsController < Api::BaseController def exclude_types val = params.permit(exclude_types: [])[:exclude_types] || [] val = [val] unless val.is_a?(Enumerable) - val + val = val << 'emoji_reaction' << 'status' unless new_notification_type_compatible? + val.uniq + end + + def new_notification_type_compatible? + application = doorkeeper_token&.application + + return false if application&.name == 'Tootle for Mastodon' + + true end def from_account