aboutsummaryrefslogtreecommitdiff
path: root/src/modules/statuses.js
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2020-06-07 00:10:21 +0300
committerHenry Jameson <me@hjkos.com>2020-06-07 00:10:21 +0300
commit9e3e6b0c6986896db5c484bc5910961ee5585a78 (patch)
tree5fbb1a28fdcb4a072806c417a9caa5a057d3e9b8 /src/modules/statuses.js
parent4fae2f8ea878bedfce89402f19adffaedec65baf (diff)
parente47d0f210317c6e04e15fb89eb8f1d469137b779 (diff)
Merge remote-tracking branch 'origin/develop' into settings-modal
* origin/develop: (22 commits) changelog alignment fixes Update CHANGELOG.md StillImage: Make it work properly in both firefox and chrome. ReactButton: Change the combined emoji (heart) to a simple one. Linting fixes. Settings: Keep a local version of the mutedWordsString MediaModal: Close on browser navigation events. StatusContent: Try to get hashtag from dataset first. Docs: Change wrong documentation. EntityNormalizerSpec: More fixes. EntityNormalizerSpec: Test new behavior. EntityNormalizer: Add colons to emoji alt text. fixed case in class name The sidebarRight option wasn't being read Use consistent naming for Pleroma-FE in README Remove mention of GNU Social lint multiple fixes fix non-mention notifs ...
Diffstat (limited to 'src/modules/statuses.js')
-rw-r--r--src/modules/statuses.js15
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.