From b5c1d074f83d08473a19a3885f6ff5eeb95274e5 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 25 May 2020 23:38:31 +0300 Subject: fix reprööted posts not being muted properly. fix muted posts making desktop notifications MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/statuses.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/modules/statuses.js') diff --git a/src/modules/statuses.js b/src/modules/statuses.js index cd8c1dba..f73fde25 100644 --- a/src/modules/statuses.js +++ b/src/modules/statuses.js @@ -15,7 +15,7 @@ import { import { set } from 'vue' import { isStatusNotification } from '../services/notification_utils/notification_utils.js' import apiService from '../services/api/api.service.js' -// import parse from '../services/status_parser/status_parser.js' +import { muteWordHits } from '../services/status_parser/status_parser.js' const emptyTl = (userId = 0) => ({ statuses: [], @@ -381,7 +381,13 @@ const addNewNotifications = (state, { dispatch, notifications, older, visibleNot notifObj.image = status.attachments[0].url } - if (!notification.seen && !state.notifications.desktopNotificationSilence && visibleNotificationTypes.includes(notification.type)) { + if ( + !notification.seen && + !state.notifications.desktopNotificationSilence && + visibleNotificationTypes.includes(notification.type) && + !status.muted && + muteWordHits(status, rootGetters.mergedConfig.muteWords).length === 0 + ) { let desktopNotification = new window.Notification(title, notifObj) // Chrome is known for not closing notifications automatically // according to MDN, anyway. -- cgit v1.2.3-70-g09d2