diff options
| author | HJ <30-hj@users.noreply.git.pleroma.social> | 2020-06-06 20:31:43 +0000 |
|---|---|---|
| committer | HJ <30-hj@users.noreply.git.pleroma.social> | 2020-06-06 20:31:43 +0000 |
| commit | e47d0f210317c6e04e15fb89eb8f1d469137b779 (patch) | |
| tree | 690ea8df1bb58e08ae9ee0f0e87abd1d92c91a7f /src/modules/statuses.js | |
| parent | 0a3069aec0c6b664381d202bca5a8460a1d6d9fc (diff) | |
| parent | 7d695fc8f285357393a669d776a1fa1313b0b16d (diff) | |
Merge branch 'fix-reprooted-muted-posts' into 'develop'
Fixed some issues with muting
See merge request pleroma/pleroma-fe!1120
Diffstat (limited to 'src/modules/statuses.js')
| -rw-r--r-- | src/modules/statuses.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/modules/statuses.js b/src/modules/statuses.js index cd8c1dba..9a2e0df1 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,18 @@ const addNewNotifications = (state, { dispatch, notifications, older, visibleNot notifObj.image = status.attachments[0].url } - if (!notification.seen && !state.notifications.desktopNotificationSilence && visibleNotificationTypes.includes(notification.type)) { + const reasonsToMuteNotif = ( + notification.seen || + state.notifications.desktopNotificationSilence || + !visibleNotificationTypes.includes(notification.type) || + ( + notification.type === 'mention' && status && ( + status.muted || + muteWordHits(status, rootGetters.mergedConfig.muteWords).length === 0 + ) + ) + ) + if (!reasonsToMuteNotif) { let desktopNotification = new window.Notification(title, notifObj) // Chrome is known for not closing notifications automatically // according to MDN, anyway. |
