fix reprööted posts not being muted properly. fix muted posts making

desktop notifications
This commit is contained in:
Henry Jameson 2020-05-25 23:38:31 +03:00
parent cf3fbdd610
commit b5c1d074f8
5 changed files with 83 additions and 17 deletions

View file

@ -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.