From 7f51ea369eb4ae1252fcba9a82438fd00471e874 Mon Sep 17 00:00:00 2001
From: tusooa <tusooa@kazv.moe>
Date: Fri, 18 Aug 2023 20:34:27 -0400
Subject: Make extra notification display customizable

---
 .../settings_modal/tabs/notifications_tab.vue      | 41 ++++++++++++++++++++++
 1 file changed, 41 insertions(+)

(limited to 'src/components/settings_modal/tabs/notifications_tab.vue')

diff --git a/src/components/settings_modal/tabs/notifications_tab.vue b/src/components/settings_modal/tabs/notifications_tab.vue
index fcb92135..4dfba444 100644
--- a/src/components/settings_modal/tabs/notifications_tab.vue
+++ b/src/components/settings_modal/tabs/notifications_tab.vue
@@ -51,6 +51,47 @@
             </li>
           </ul>
         </li>
+        <li>
+          <BooleanSetting path="showExtraNotifications">
+            {{ $t('settings.notification_show_extra') }}
+          </BooleanSetting>
+        </li>
+        <li>
+          <ul class="setting-list suboptions">
+            <li>
+              <BooleanSetting
+                path="showChatsInExtraNotifications"
+                :disabled="!mergedConfig.showExtraNotifications"
+              >
+                {{ $t('settings.notification_extra_chats') }}
+              </BooleanSetting>
+            </li>
+            <li>
+              <BooleanSetting
+                path="showAnnouncementsInExtraNotifications"
+                :disabled="!mergedConfig.showExtraNotifications"
+              >
+                {{ $t('settings.notification_extra_announcements') }}
+              </BooleanSetting>
+            </li>
+            <li>
+              <BooleanSetting
+                path="showFollowRequestsInExtraNotifications"
+                :disabled="!mergedConfig.showExtraNotifications"
+              >
+                {{ $t('settings.notification_extra_follow_requests') }}
+              </BooleanSetting>
+            </li>
+            <li>
+              <BooleanSetting
+                path="showExtraNotificationsTip"
+                :disabled="!mergedConfig.showExtraNotifications"
+              >
+                {{ $t('settings.notification_extra_tip') }}
+              </BooleanSetting>
+            </li>
+          </ul>
+        </li>
       </ul>
     </div>
 
-- 
cgit v1.2.3-70-g09d2


From e3ee3eaccae6a9ece674d7d76db8e67da499d6c3 Mon Sep 17 00:00:00 2001
From: Henry Jameson <me@hjkos.com>
Date: Sun, 19 Nov 2023 15:24:34 +0200
Subject: added some settings for notifications

---
 src/components/mobile_nav/mobile_nav.js            |  9 ++++++--
 src/components/mobile_nav/mobile_nav.vue           | 11 ++++++++++
 src/components/notifications/notifications.js      | 25 +++++++++++++++++++---
 src/components/notifications/notifications.vue     |  2 +-
 .../settings_modal/tabs/notifications_tab.vue      | 23 ++++++++++++++++++++
 src/i18n/en.json                                   |  5 +++++
 src/modules/config.js                              |  5 ++++-
 src/modules/instance.js                            |  3 +++
 8 files changed, 76 insertions(+), 7 deletions(-)

(limited to 'src/components/settings_modal/tabs/notifications_tab.vue')

diff --git a/src/components/mobile_nav/mobile_nav.js b/src/components/mobile_nav/mobile_nav.js
index b5325116..6f4e35e5 100644
--- a/src/components/mobile_nav/mobile_nav.js
+++ b/src/components/mobile_nav/mobile_nav.js
@@ -14,7 +14,8 @@ import {
   faBell,
   faBars,
   faArrowUp,
-  faMinus
+  faMinus,
+  faCheckDouble
 } from '@fortawesome/free-solid-svg-icons'
 
 library.add(
@@ -22,7 +23,8 @@ library.add(
   faBell,
   faBars,
   faArrowUp,
-  faMinus
+  faMinus,
+  faCheckDouble
 )
 
 const MobileNav = {
@@ -67,6 +69,9 @@ const MobileNav = {
     shouldConfirmLogout () {
       return this.$store.getters.mergedConfig.modalOnLogout
     },
+    closingDrawerMarksAsSeen () {
+      return this.$store.getters.mergedConfig.closingDrawerMarksAsSeen
+    },
     ...mapGetters(['unreadChatCount'])
   },
   methods: {
diff --git a/src/components/mobile_nav/mobile_nav.vue b/src/components/mobile_nav/mobile_nav.vue
index c2746abe..ecd8290a 100644
--- a/src/components/mobile_nav/mobile_nav.vue
+++ b/src/components/mobile_nav/mobile_nav.vue
@@ -66,6 +66,17 @@
             />
           </FALayers>
         </button>
+        <button
+          v-if="!closingDrawerMarksAsSeen"
+          class="button-unstyled mobile-nav-button"
+          :title="$t('nav.mobile_notifications_close')"
+          @click.stop.prevent="markNotificationsAsSeen()"
+        >
+          <FAIcon
+            class="fa-scale-110 fa-old-padding"
+            icon="check-double"
+          />
+        </button>
         <button
           class="button-unstyled mobile-nav-button"
           :title="$t('nav.mobile_notifications_close')"
diff --git a/src/components/notifications/notifications.js b/src/components/notifications/notifications.js
index a210e19d..00d3a511 100644
--- a/src/components/notifications/notifications.js
+++ b/src/components/notifications/notifications.js
@@ -21,6 +21,7 @@ library.add(
 )
 
 const DEFAULT_SEEN_TO_DISPLAY_COUNT = 30
+const ACTIONABLE_NOTIFICATION_TYPES = new Set(['mention', 'pleroma:report', 'follow_request'])
 
 const Notifications = {
   components: {
@@ -71,14 +72,26 @@ const Notifications = {
       return unseenNotificationsFromStore(this.$store)
     },
     filteredNotifications () {
-      return filteredNotificationsFromStore(this.$store, this.filterMode)
+      if (this.unseenAtTop) {
+        return [
+          ...filteredNotificationsFromStore(this.$store).filter(n => this.shouldShowUnseen(n)),
+          ...filteredNotificationsFromStore(this.$store).filter(n => !this.shouldShowUnseen(n))
+        ]
+      } else {
+        return filteredNotificationsFromStore(this.$store, this.filterMode)
+      }
     },
     unseenCountBadgeText () {
       return `${this.unseenCount ? this.unseenCount : ''}${this.extraNotificationsCount ? '*' : ''}`
     },
     unseenCount () {
-      return this.unseenNotifications.length
+      if (this.ignoreInactionableSeen) {
+        return this.unseenNotifications.filter(n => ACTIONABLE_NOTIFICATION_TYPES.has(n.type)).length
+      } else {
+        return this.unseenNotifications.length
+      }
     },
+    ignoreInactionableSeen () { return this.$store.getters.mergedConfig.ignoreInactionableSeen },
     extraNotificationsCount () {
       return countExtraNotifications(this.$store)
     },
@@ -108,6 +121,7 @@ const Notifications = {
       return this.filteredNotifications.slice(0, this.unseenCount + this.seenToDisplayCount)
     },
     noSticky () { return this.$store.getters.mergedConfig.disableStickyHeaders },
+    unseenAtTop () { return this.$store.getters.mergedConfig.unseenAtTop },
     showExtraNotifications () {
       return !this.noExtra
     },
@@ -154,11 +168,16 @@ const Notifications = {
     scrollToTop () {
       const scrollable = this.scrollerRef
       scrollable.scrollTo({ top: this.$refs.root.offsetTop })
-      // this.$refs.root.scrollIntoView({ behavior: 'smooth', block: 'start' })
     },
     updateScrollPosition () {
       this.showScrollTop = this.$refs.root.offsetTop < this.scrollerRef.scrollTop
     },
+    shouldShowUnseen (notification) {
+      if (notification.seen) return false
+
+      const actionable = ACTIONABLE_NOTIFICATION_TYPES.has(notification.type)
+      return this.ignoreInactionableSeen ? actionable : true
+    },
     /* "Interacted" really refers to "actionable" notifications that require user input,
      * everything else (likes/repeats/reacts) cannot be acted and therefore we just clear
      * the "seen" status upon any clicks on them
diff --git a/src/components/notifications/notifications.vue b/src/components/notifications/notifications.vue
index 27ae23cf..a0025182 100644
--- a/src/components/notifications/notifications.vue
+++ b/src/components/notifications/notifications.vue
@@ -66,7 +66,7 @@
             :key="notification.id"
             role="listitem"
             class="notification"
-            :class="{unseen: !minimalMode && !notification.seen}"
+            :class="{unseen: !minimalMode && shouldShowUnseen(notification)}"
             @click="e => notificationClicked(notification)"
           >
             <div class="notification-overlay" />
diff --git a/src/components/settings_modal/tabs/notifications_tab.vue b/src/components/settings_modal/tabs/notifications_tab.vue
index 4dfba444..fcee85a0 100644
--- a/src/components/settings_modal/tabs/notifications_tab.vue
+++ b/src/components/settings_modal/tabs/notifications_tab.vue
@@ -1,5 +1,28 @@
 <template>
   <div :label="$t('settings.notifications')">
+    <div class="setting-item">
+      <h2>{{ $t('settings.notification_setting_annoyance') }}</h2>
+      <ul class="setting-list">
+        <li>
+          <BooleanSetting path="closingDrawerMarksAsSeen">
+            {{ $t('settings.notification_setting_drawer_marks_as_seen') }}
+          </BooleanSetting>
+        </li>
+        <li>
+          <BooleanSetting path="ignoreInactionableSeen">
+            {{ $t('settings.notification_setting_ignore_inactionable_seen') }}
+          </BooleanSetting>
+          <p>
+            {{ $t('settings.notification_setting_ignore_inactionable_seen_tip') }}
+          </p>
+        </li>
+        <li>
+          <BooleanSetting path="unseenAtTop">
+            {{ $t('settings.notification_setting_unseen_at_top') }}
+          </BooleanSetting>
+        </li>
+      </ul>
+    </div>
     <div class="setting-item">
       <h2>{{ $t('settings.notification_setting_filters') }}</h2>
       <ul class="setting-list">
diff --git a/src/i18n/en.json b/src/i18n/en.json
index 034022cb..b31793cb 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -688,6 +688,11 @@
     "greentext": "Meme arrows",
     "show_yous": "Show (You)s",
     "notifications": "Notifications",
+    "notification_setting_annoyance": "Annoyance",
+    "notification_setting_drawer_marks_as_seen": "Closing drawer (mobile) marks all notifications as read",
+    "notification_setting_ignore_inactionable_seen": "Ignore read state of inactionable notifications (likes, repeats etc)",
+    "notification_setting_ignore_inactionable_seen_tip": "This will not actually mark those notifications as read, and you'll still get desktop notifications about them if you chose so",
+    "notification_setting_unseen_at_top": "Show unread notifications above others",
     "notification_setting_filters": "Filters",
     "notification_setting_block_from_strangers": "Block notifications from users who you do not follow",
     "notification_setting_privacy": "Privacy",
diff --git a/src/modules/config.js b/src/modules/config.js
index 05c15998..a3f7bcaf 100644
--- a/src/modules/config.js
+++ b/src/modules/config.js
@@ -127,7 +127,10 @@ export const defaultState = {
   showAnnouncementsInExtraNotifications: undefined, // instance default
   showFollowRequestsInExtraNotifications: undefined, // instance default
   maxDepthInThread: undefined, // instance default
-  autocompleteSelect: undefined // instance default
+  autocompleteSelect: undefined, // instance default
+  closingDrawerMarksAsSeen: undefined, // instance default
+  unseenAtTop: undefined, // instance default
+  ignoreInactionableSeen: undefined // instance default
 }
 
 // caching the instance default properties
diff --git a/src/modules/instance.js b/src/modules/instance.js
index 034348ff..3022a41a 100644
--- a/src/modules/instance.js
+++ b/src/modules/instance.js
@@ -110,6 +110,9 @@ const defaultState = {
   showFollowRequestsInExtraNotifications: true,
   maxDepthInThread: 6,
   autocompleteSelect: false,
+  closingDrawerMarksAsSeen: true,
+  unseenAtTop: false,
+  ignoreInactionableSeen: false,
 
   // Nasty stuff
   customEmoji: [],
-- 
cgit v1.2.3-70-g09d2


From fd3ad106bed2a5f790556bae200de5c352c5c0ea Mon Sep 17 00:00:00 2001
From: Henry Jameson <me@hjkos.com>
Date: Sun, 19 Nov 2023 16:12:43 +0200
Subject: rearrange notification visibility page a bit.

---
 src/components/settings_modal/settings_modal.scss  |  12 ++
 .../settings_modal/tabs/notifications_tab.js       |   4 +
 .../settings_modal/tabs/notifications_tab.vue      | 133 +++++++++++++++++----
 src/i18n/en.json                                   |   3 +
 src/modules/config.js                              |  13 +-
 5 files changed, 139 insertions(+), 26 deletions(-)

(limited to 'src/components/settings_modal/tabs/notifications_tab.vue')

diff --git a/src/components/settings_modal/settings_modal.scss b/src/components/settings_modal/settings_modal.scss
index 49ef83e0..6bc9459b 100644
--- a/src/components/settings_modal/settings_modal.scss
+++ b/src/components/settings_modal/settings_modal.scss
@@ -3,6 +3,10 @@
 .settings-modal {
   overflow: hidden;
 
+  h4 {
+    margin-bottom: 0.5em;
+  }
+
   .setting-list,
   .option-list {
     list-style-type: none;
@@ -15,6 +19,14 @@
     .suboptions {
       margin-top: 0.3em;
     }
+
+    &.two-column {
+      column-count: 2;
+
+      > li {
+        break-inside: avoid;
+      }
+    }
   }
 
   .setting-description {
diff --git a/src/components/settings_modal/tabs/notifications_tab.js b/src/components/settings_modal/tabs/notifications_tab.js
index 3c6ab87f..c53b5889 100644
--- a/src/components/settings_modal/tabs/notifications_tab.js
+++ b/src/components/settings_modal/tabs/notifications_tab.js
@@ -16,6 +16,10 @@ const NotificationsTab = {
     user () {
       return this.$store.state.users.currentUser
     },
+    canReceiveReports () {
+      if (!this.user) { return false }
+      return this.user.privileges.includes('reports_manage_reports')
+    },
     ...SharedComputedObject()
   },
   methods: {
diff --git a/src/components/settings_modal/tabs/notifications_tab.vue b/src/components/settings_modal/tabs/notifications_tab.vue
index fcee85a0..00d0f921 100644
--- a/src/components/settings_modal/tabs/notifications_tab.vue
+++ b/src/components/settings_modal/tabs/notifications_tab.vue
@@ -34,43 +34,128 @@
             {{ $t('settings.notification_setting_block_from_strangers') }}
           </BooleanSetting>
         </li>
-        <li class="select-multiple">
-          <span class="label">{{ $t('settings.notification_visibility') }}</span>
-          <ul class="option-list">
+        <li>
+          <h3> {{ $t('settings.notification_visibility') }}</h3>
+          <ul class="setting-list two-column">
             <li>
-              <BooleanSetting path="notificationVisibility.likes">
-                {{ $t('settings.notification_visibility_likes') }}
-              </BooleanSetting>
+              <h4> {{ $t('settings.notification_visibility_mentions') }}</h4>
+              <ul class="setting-list">
+                <li>
+                  <BooleanSetting path="notificationVisibility.mentions">
+                    {{ $t('settings.notification_visibility_in_column') }}
+                  </BooleanSetting>
+                </li>
+                <li>
+                  <BooleanSetting path="notificationNative.mentions" >
+                    {{ $t('settings.notification_visibility_native_notifications') }}
+                  </BooleanSetting>
+                </li>
+              </ul>
             </li>
             <li>
-              <BooleanSetting path="notificationVisibility.repeats">
-                {{ $t('settings.notification_visibility_repeats') }}
-              </BooleanSetting>
+              <h4> {{ $t('settings.notification_visibility_likes') }}</h4>
+              <ul class="setting-list">
+                <li>
+                  <BooleanSetting path="notificationVisibility.likes">
+                    {{ $t('settings.notification_visibility_in_column') }}
+                  </BooleanSetting>
+                </li>
+                <li>
+                  <BooleanSetting path="notificationNative.likes" >
+                    {{ $t('settings.notification_visibility_native_notifications') }}
+                  </BooleanSetting>
+                </li>
+              </ul>
             </li>
             <li>
-              <BooleanSetting path="notificationVisibility.follows">
-                {{ $t('settings.notification_visibility_follows') }}
-              </BooleanSetting>
+              <h4> {{ $t('settings.notification_visibility_repeats') }}</h4>
+              <ul class="setting-list">
+                <li>
+                  <BooleanSetting path="notificationVisibility.repeats">
+                    {{ $t('settings.notification_visibility_in_column') }}
+                  </BooleanSetting>
+                </li>
+                <li>
+                  <BooleanSetting path="notificationNative.repeats" >
+                    {{ $t('settings.notification_visibility_native_notifications') }}
+                  </BooleanSetting>
+                </li>
+              </ul>
             </li>
             <li>
-              <BooleanSetting path="notificationVisibility.mentions">
-                {{ $t('settings.notification_visibility_mentions') }}
-              </BooleanSetting>
+              <h4> {{ $t('settings.notification_visibility_emoji_reactions') }}</h4>
+              <ul class="setting-list">
+                <li>
+                  <BooleanSetting path="notificationVisibility.emojiReactions">
+                    {{ $t('settings.notification_visibility_in_column') }}
+                  </BooleanSetting>
+                </li>
+                <li>
+                  <BooleanSetting path="notificationNative.emojiReactions" >
+                    {{ $t('settings.notification_visibility_native_notifications') }}
+                  </BooleanSetting>
+                </li>
+              </ul>
             </li>
             <li>
-              <BooleanSetting path="notificationVisibility.moves">
-                {{ $t('settings.notification_visibility_moves') }}
-              </BooleanSetting>
+              <h4> {{ $t('settings.notification_visibility_follows') }}</h4>
+              <ul class="setting-list">
+                <li>
+                  <BooleanSetting path="notificationVisibility.follows">
+                    {{ $t('settings.notification_visibility_in_column') }}
+                  </BooleanSetting>
+                </li>
+                <li>
+                  <BooleanSetting path="notificationNative.follows" >
+                    {{ $t('settings.notification_visibility_native_notifications') }}
+                  </BooleanSetting>
+                </li>
+              </ul>
             </li>
             <li>
-              <BooleanSetting path="notificationVisibility.emojiReactions">
-                {{ $t('settings.notification_visibility_emoji_reactions') }}
-              </BooleanSetting>
+              <h4> {{ $t('settings.notification_visibility_moves') }}</h4>
+              <ul class="setting-list">
+                <li>
+                  <BooleanSetting path="notificationVisibility.moves">
+                    {{ $t('settings.notification_visibility_in_column') }}
+                  </BooleanSetting>
+                </li>
+                <li>
+                  <BooleanSetting path="notificationNative.moves" >
+                    {{ $t('settings.notification_visibility_native_notifications') }}
+                  </BooleanSetting>
+                </li>
+              </ul>
             </li>
             <li>
-              <BooleanSetting path="notificationVisibility.polls">
-                {{ $t('settings.notification_visibility_polls') }}
-              </BooleanSetting>
+              <h4> {{ $t('settings.notification_visibility_polls') }}</h4>
+              <ul class="setting-list">
+                <li>
+                  <BooleanSetting path="notificationVisibility.polls">
+                    {{ $t('settings.notification_visibility_in_column') }}
+                  </BooleanSetting>
+                </li>
+                <li>
+                  <BooleanSetting path="notificationNative.polls" >
+                    {{ $t('settings.notification_visibility_native_notifications') }}
+                  </BooleanSetting>
+                </li>
+              </ul>
+            </li>
+            <li v-if="canReceiveReports">
+              <h4> {{ $t('settings.notification_visibility_reports') }}</h4>
+              <ul class="setting-list">
+                <li>
+                  <BooleanSetting path="notificationVisibility.reports">
+                    {{ $t('settings.notification_visibility_in_column') }}
+                  </BooleanSetting>
+                </li>
+                <li>
+                  <BooleanSetting path="notificationNative.reports" >
+                    {{ $t('settings.notification_visibility_native_notifications') }}
+                  </BooleanSetting>
+                </li>
+              </ul>
             </li>
           </ul>
         </li>
diff --git a/src/i18n/en.json b/src/i18n/en.json
index b31793cb..658e3b8e 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -561,10 +561,13 @@
     "posts": "Posts",
     "user_profiles": "User Profiles",
     "notification_visibility": "Types of notifications to show",
+    "notification_visibility_in_column": "Show in notifications column/drawer",
+    "notification_visibility_native_notifications": "Show a native notification",
     "notification_visibility_follows": "Follows",
     "notification_visibility_likes": "Favorites",
     "notification_visibility_mentions": "Mentions",
     "notification_visibility_repeats": "Repeats",
+    "notification_visibility_reports": "Reports",
     "notification_visibility_moves": "User Migrates",
     "notification_visibility_emoji_reactions": "Reactions",
     "notification_visibility_polls": "Ends of polls you voted in",
diff --git a/src/modules/config.js b/src/modules/config.js
index a3f7bcaf..db1d564e 100644
--- a/src/modules/config.js
+++ b/src/modules/config.js
@@ -66,8 +66,17 @@ export const defaultState = {
     chatMention: true,
     polls: true
   },
-  notificationSettings: {
-    nativeNotifications: ['follows', 'mentions', 'followRequest', 'reports', 'chatMention', 'polls']
+  notificationNative: {
+    follows: true,
+    mentions: true,
+    likes: false,
+    repeats: false,
+    moves: false,
+    emojiReactions: false,
+    followRequest: true,
+    reports: true,
+    chatMention: true,
+    polls: true
   },
   webPushNotifications: false,
   muteWords: [],
-- 
cgit v1.2.3-70-g09d2


From d178a56924dfd3dec180270fa197493b3a505780 Mon Sep 17 00:00:00 2001
From: Henry Jameson <me@hjkos.com>
Date: Sun, 19 Nov 2023 16:14:24 +0200
Subject: improve visual for the description bit

---
 src/components/settings_modal/tabs/notifications_tab.vue | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

(limited to 'src/components/settings_modal/tabs/notifications_tab.vue')

diff --git a/src/components/settings_modal/tabs/notifications_tab.vue b/src/components/settings_modal/tabs/notifications_tab.vue
index 00d0f921..ffaa5723 100644
--- a/src/components/settings_modal/tabs/notifications_tab.vue
+++ b/src/components/settings_modal/tabs/notifications_tab.vue
@@ -12,9 +12,11 @@
           <BooleanSetting path="ignoreInactionableSeen">
             {{ $t('settings.notification_setting_ignore_inactionable_seen') }}
           </BooleanSetting>
-          <p>
-            {{ $t('settings.notification_setting_ignore_inactionable_seen_tip') }}
-          </p>
+          <div>
+            <small>
+              {{ $t('settings.notification_setting_ignore_inactionable_seen_tip') }}
+            </small>
+          </div>
         </li>
         <li>
           <BooleanSetting path="unseenAtTop">
-- 
cgit v1.2.3-70-g09d2


From 072a06fc89844a5ed2f557634b7e04c1ef63041d Mon Sep 17 00:00:00 2001
From: Henry Jameson <me@hjkos.com>
Date: Sun, 19 Nov 2023 16:40:30 +0200
Subject: reports visibility setting + actual filtering for desktop notifs

---
 .../settings_modal/tabs/notifications_tab.vue      | 15 +++++++
 src/i18n/en.json                                   |  1 +
 .../notification_utils/notification_utils.js       |  1 +
 src/sw.js                                          | 51 ++++++++++++++++++----
 4 files changed, 59 insertions(+), 9 deletions(-)

(limited to 'src/components/settings_modal/tabs/notifications_tab.vue')

diff --git a/src/components/settings_modal/tabs/notifications_tab.vue b/src/components/settings_modal/tabs/notifications_tab.vue
index ffaa5723..a6f0cba2 100644
--- a/src/components/settings_modal/tabs/notifications_tab.vue
+++ b/src/components/settings_modal/tabs/notifications_tab.vue
@@ -114,6 +114,21 @@
                 </li>
               </ul>
             </li>
+            <li>
+              <h4> {{ $t('settings.notification_visibility_follow_requests') }}</h4>
+              <ul class="setting-list">
+                <li>
+                  <BooleanSetting path="notificationVisibility.follow_request">
+                    {{ $t('settings.notification_visibility_in_column') }}
+                  </BooleanSetting>
+                </li>
+                <li>
+                  <BooleanSetting path="notificationNative.follow_request" >
+                    {{ $t('settings.notification_visibility_native_notifications') }}
+                  </BooleanSetting>
+                </li>
+              </ul>
+            </li>
             <li>
               <h4> {{ $t('settings.notification_visibility_moves') }}</h4>
               <ul class="setting-list">
diff --git a/src/i18n/en.json b/src/i18n/en.json
index 658e3b8e..40da7155 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -564,6 +564,7 @@
     "notification_visibility_in_column": "Show in notifications column/drawer",
     "notification_visibility_native_notifications": "Show a native notification",
     "notification_visibility_follows": "Follows",
+    "notification_visibility_follow_requests": "Follow requests",
     "notification_visibility_likes": "Favorites",
     "notification_visibility_mentions": "Mentions",
     "notification_visibility_repeats": "Repeats",
diff --git a/src/services/notification_utils/notification_utils.js b/src/services/notification_utils/notification_utils.js
index 342fe6ef..cc7e6817 100644
--- a/src/services/notification_utils/notification_utils.js
+++ b/src/services/notification_utils/notification_utils.js
@@ -91,6 +91,7 @@ export const prepareNotificationObject = (notification, i18n) => {
 
   const notifObj = {
     tag: notification.id,
+    type: notification.type,
     badge: cachedBadgeUrl
   }
   const status = notification.status
diff --git a/src/sw.js b/src/sw.js
index f5fccc6a..469291b9 100644
--- a/src/sw.js
+++ b/src/sw.js
@@ -15,7 +15,8 @@ const i18n = createI18n({
 
 const state = {
   lastFocused: null,
-  notificationIds: new Set()
+  notificationIds: new Set(),
+  allowedNotificationTypes: null
 }
 
 function getWindowClients () {
@@ -23,15 +24,43 @@ function getWindowClients () {
     .then((clientList) => clientList.filter(({ type }) => type === 'window'))
 }
 
-const setLocale = async () => {
-  const state = await localForage.getItem('vuex-lz')
-  const locale = state.config.interfaceLanguage || 'en'
+const setSettings = async () => {
+  const vuexState = await localForage.getItem('vuex-lz')
+  const locale = vuexState.config.interfaceLanguage || 'en'
   i18n.locale = locale
+  const notificationsNativeArray = Object.entries(vuexState.config.notificationNative)
+
+  state.allowedNotificationTypes = new Set(
+    notificationsNativeArray
+      .filter(([k, v]) => v)
+      .map(([k]) => {
+        switch (k) {
+          case 'mentions':
+            return 'mention'
+          case 'likes':
+            return 'like'
+          case 'repeats':
+            return 'repeat'
+          case 'emojiReactions':
+            return 'pleroma:emoji_reaction'
+          case 'reports':
+            return 'pleroma:report'
+          case 'followRequest':
+            return 'follow_request'
+          case 'follows':
+            return 'follow'
+          case 'polls':
+            return 'poll'
+          default:
+            return k
+        }
+      })
+  )
 }
 
 const showPushNotification = async (event) => {
   const activeClients = await getWindowClients()
-  await setLocale()
+  await setSettings()
   // Only show push notifications if all tabs/windows are closed
   if (activeClients.length === 0) {
     const data = event.data.json()
@@ -43,27 +72,31 @@ const showPushNotification = async (event) => {
 
     const res = prepareNotificationObject(parsedNotification, i18n)
 
-    self.registration.showNotification(res.title, res)
+    if (state.allowedNotificationTypes.has(parsedNotification.type)) {
+      self.registration.showNotification(res.title, res)
+    }
   }
 }
 
 self.addEventListener('push', async (event) => {
-  console.log(event)
   if (event.data) {
     event.waitUntil(showPushNotification(event))
   }
 })
 
 self.addEventListener('message', async (event) => {
+  await setSettings()
   const { type, content } = event.data
 
   if (type === 'desktopNotification') {
     const { title, ...rest } = content
-    const { tag } = rest
+    const { tag, type } = rest
     if (state.notificationIds.has(tag)) return
     state.notificationIds.add(tag)
     setTimeout(() => state.notificationIds.delete(tag), 10000)
-    self.registration.showNotification(title, rest)
+    if (state.allowedNotificationTypes.has(type)) {
+      self.registration.showNotification(title, rest)
+    }
   }
 
   if (type === 'desktopNotificationClose') {
-- 
cgit v1.2.3-70-g09d2


From febc2aa5690e9658970da69ea58fce40682ee0a2 Mon Sep 17 00:00:00 2001
From: Henry Jameson <me@hjkos.com>
Date: Wed, 13 Dec 2023 20:56:27 +0200
Subject: lint

---
 .../settings_modal/tabs/notifications_tab.vue          | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

(limited to 'src/components/settings_modal/tabs/notifications_tab.vue')

diff --git a/src/components/settings_modal/tabs/notifications_tab.vue b/src/components/settings_modal/tabs/notifications_tab.vue
index a6f0cba2..020666ff 100644
--- a/src/components/settings_modal/tabs/notifications_tab.vue
+++ b/src/components/settings_modal/tabs/notifications_tab.vue
@@ -48,7 +48,7 @@
                   </BooleanSetting>
                 </li>
                 <li>
-                  <BooleanSetting path="notificationNative.mentions" >
+                  <BooleanSetting path="notificationNative.mentions">
                     {{ $t('settings.notification_visibility_native_notifications') }}
                   </BooleanSetting>
                 </li>
@@ -63,7 +63,7 @@
                   </BooleanSetting>
                 </li>
                 <li>
-                  <BooleanSetting path="notificationNative.likes" >
+                  <BooleanSetting path="notificationNative.likes">
                     {{ $t('settings.notification_visibility_native_notifications') }}
                   </BooleanSetting>
                 </li>
@@ -78,7 +78,7 @@
                   </BooleanSetting>
                 </li>
                 <li>
-                  <BooleanSetting path="notificationNative.repeats" >
+                  <BooleanSetting path="notificationNative.repeats">
                     {{ $t('settings.notification_visibility_native_notifications') }}
                   </BooleanSetting>
                 </li>
@@ -93,7 +93,7 @@
                   </BooleanSetting>
                 </li>
                 <li>
-                  <BooleanSetting path="notificationNative.emojiReactions" >
+                  <BooleanSetting path="notificationNative.emojiReactions">
                     {{ $t('settings.notification_visibility_native_notifications') }}
                   </BooleanSetting>
                 </li>
@@ -108,7 +108,7 @@
                   </BooleanSetting>
                 </li>
                 <li>
-                  <BooleanSetting path="notificationNative.follows" >
+                  <BooleanSetting path="notificationNative.follows">
                     {{ $t('settings.notification_visibility_native_notifications') }}
                   </BooleanSetting>
                 </li>
@@ -123,7 +123,7 @@
                   </BooleanSetting>
                 </li>
                 <li>
-                  <BooleanSetting path="notificationNative.follow_request" >
+                  <BooleanSetting path="notificationNative.follow_request">
                     {{ $t('settings.notification_visibility_native_notifications') }}
                   </BooleanSetting>
                 </li>
@@ -138,7 +138,7 @@
                   </BooleanSetting>
                 </li>
                 <li>
-                  <BooleanSetting path="notificationNative.moves" >
+                  <BooleanSetting path="notificationNative.moves">
                     {{ $t('settings.notification_visibility_native_notifications') }}
                   </BooleanSetting>
                 </li>
@@ -153,7 +153,7 @@
                   </BooleanSetting>
                 </li>
                 <li>
-                  <BooleanSetting path="notificationNative.polls" >
+                  <BooleanSetting path="notificationNative.polls">
                     {{ $t('settings.notification_visibility_native_notifications') }}
                   </BooleanSetting>
                 </li>
@@ -168,7 +168,7 @@
                   </BooleanSetting>
                 </li>
                 <li>
-                  <BooleanSetting path="notificationNative.reports" >
+                  <BooleanSetting path="notificationNative.reports">
                     {{ $t('settings.notification_visibility_native_notifications') }}
                   </BooleanSetting>
                 </li>
-- 
cgit v1.2.3-70-g09d2


From b394392d0d6d73dacb878a25dd0b25676ef72635 Mon Sep 17 00:00:00 2001
From: Henry Jameson <me@hjkos.com>
Date: Wed, 13 Dec 2023 21:07:23 +0200
Subject: fix incorrect path for follow request notifications settings

---
 src/components/settings_modal/tabs/notifications_tab.vue | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'src/components/settings_modal/tabs/notifications_tab.vue')

diff --git a/src/components/settings_modal/tabs/notifications_tab.vue b/src/components/settings_modal/tabs/notifications_tab.vue
index 020666ff..3083abe0 100644
--- a/src/components/settings_modal/tabs/notifications_tab.vue
+++ b/src/components/settings_modal/tabs/notifications_tab.vue
@@ -118,12 +118,12 @@
               <h4> {{ $t('settings.notification_visibility_follow_requests') }}</h4>
               <ul class="setting-list">
                 <li>
-                  <BooleanSetting path="notificationVisibility.follow_request">
+                  <BooleanSetting path="notificationVisibility.followRequest">
                     {{ $t('settings.notification_visibility_in_column') }}
                   </BooleanSetting>
                 </li>
                 <li>
-                  <BooleanSetting path="notificationNative.follow_request">
+                  <BooleanSetting path="notificationNative.followRequest">
                     {{ $t('settings.notification_visibility_native_notifications') }}
                   </BooleanSetting>
                 </li>
-- 
cgit v1.2.3-70-g09d2


From 5ee8fc0aeadb59c6f78d0c8c8e725072ad9cdc54 Mon Sep 17 00:00:00 2001
From: Henry Jameson <me@hjkos.com>
Date: Wed, 13 Dec 2023 23:54:12 +0200
Subject: add setting to always show push notifications

---
 .../settings_modal/tabs/notifications_tab.vue          | 18 +++++++++++++++++-
 src/i18n/en.json                                       |  3 +++
 src/modules/config.js                                  |  1 +
 src/sw.js                                              |  5 +++--
 4 files changed, 24 insertions(+), 3 deletions(-)

(limited to 'src/components/settings_modal/tabs/notifications_tab.vue')

diff --git a/src/components/settings_modal/tabs/notifications_tab.vue b/src/components/settings_modal/tabs/notifications_tab.vue
index 3083abe0..9ace4c36 100644
--- a/src/components/settings_modal/tabs/notifications_tab.vue
+++ b/src/components/settings_modal/tabs/notifications_tab.vue
@@ -19,7 +19,7 @@
           </div>
         </li>
         <li>
-          <BooleanSetting path="unseenAtTop">
+          <BooleanSetting path="unseenAtTop" expert="1">
             {{ $t('settings.notification_setting_unseen_at_top') }}
           </BooleanSetting>
         </li>
@@ -38,6 +38,7 @@
         </li>
         <li>
           <h3> {{ $t('settings.notification_visibility') }}</h3>
+          <p v-if="expertLevel > 0">{{ $t('settings.notification_setting_filters_chrome_push') }}</p>
           <ul class="setting-list two-column">
             <li>
               <h4> {{ $t('settings.notification_visibility_mentions') }}</h4>
@@ -233,6 +234,21 @@
           >
             {{ $t('settings.enable_web_push_notifications') }}
           </BooleanSetting>
+          <ul class="setting-list suboptions">
+            <li>
+              <BooleanSetting
+                path="webPushAlwaysShowNotifications"
+                :disabled="!mergedConfig.webPushNotifications"
+              >
+                {{ $t('settings.enable_web_push_always_show') }}
+              </BooleanSetting>
+              <div :class="{ faint: !mergedConfig.webPushNotifications }">
+                <small>
+                  {{ $t('settings.enable_web_push_always_show_tip') }}
+                </small>
+              </div>
+            </li>
+          </ul>
         </li>
         <li>
           <BooleanSetting
diff --git a/src/i18n/en.json b/src/i18n/en.json
index 195b5e07..ed828a62 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -699,12 +699,15 @@
     "notification_setting_ignore_inactionable_seen_tip": "This will not actually mark those notifications as read, and you'll still get desktop notifications about them if you chose so",
     "notification_setting_unseen_at_top": "Show unread notifications above others",
     "notification_setting_filters": "Filters",
+    "notification_setting_filters_chrome_push": "On some browsers (chrome) it might be impossible to completely filter out notifications by type when they arrive by Push",
     "notification_setting_block_from_strangers": "Block notifications from users who you do not follow",
     "notification_setting_privacy": "Privacy",
     "notification_setting_hide_notification_contents": "Hide the sender and contents of push notifications",
     "notification_mutes": "To stop receiving notifications from a specific user, use a mute.",
     "notification_blocks": "Blocking a user stops all notifications as well as unsubscribes them.",
     "enable_web_push_notifications": "Enable web push notifications",
+    "enable_web_push_always_show": "Always show web push notifications",
+    "enable_web_push_always_show_tip": "Some browsers (Chromium, Chrome) require that push messages always result in a notification, otherwise generic 'Website was updated in background' is shown, enable this to prevent this notification from showing. Can result in showing duplicate notifications on other browsers.",
     "more_settings": "More settings",
     "style": {
       "switcher": {
diff --git a/src/modules/config.js b/src/modules/config.js
index db1d564e..abb57272 100644
--- a/src/modules/config.js
+++ b/src/modules/config.js
@@ -79,6 +79,7 @@ export const defaultState = {
     polls: true
   },
   webPushNotifications: false,
+  webPushAlwaysShowNotifications: false,
   muteWords: [],
   highlight: {},
   interfaceLanguage: browserLocale,
diff --git a/src/sw.js b/src/sw.js
index 86f6e694..4ee7b9ff 100644
--- a/src/sw.js
+++ b/src/sw.js
@@ -29,6 +29,7 @@ const setSettings = async () => {
   const locale = vuexState.config.interfaceLanguage || 'en'
   i18n.locale = locale
   const notificationsNativeArray = Object.entries(vuexState.config.notificationNative)
+  state.webPushAlwaysShowNotifications = vuexState.config.webPushAlwaysShowNotifications
 
   state.allowedNotificationTypes = new Set(
     notificationsNativeArray
@@ -62,7 +63,7 @@ const showPushNotification = async (event) => {
   const activeClients = await getWindowClients()
   await setSettings()
   // Only show push notifications if all tabs/windows are closed
-  if (activeClients.length === 0) {
+  if (state.webPushAlwaysShowNotifications || activeClients.length === 0) {
     const data = event.data.json()
 
     const url = `${self.registration.scope}api/v1/notifications/${data.notification_id}`
@@ -72,7 +73,7 @@ const showPushNotification = async (event) => {
 
     const res = prepareNotificationObject(parsedNotification, i18n)
 
-    if (state.allowedNotificationTypes.has(parsedNotification.type)) {
+    if (state.webPushAlwaysShowNotifications || state.allowedNotificationTypes.has(parsedNotification.type)) {
       return self.registration.showNotification(res.title, res)
     }
   }
-- 
cgit v1.2.3-70-g09d2


From 9bbf2e70c2abf2fe88badbab88e446c487752c77 Mon Sep 17 00:00:00 2001
From: Henry Jameson <me@hjkos.com>
Date: Thu, 22 Feb 2024 18:39:52 +0200
Subject: lint

---
 src/components/announcement_editor/announcement_editor.vue |  4 ++--
 src/components/chat_new/chat_new.vue                       |  2 +-
 src/components/extra_buttons/extra_buttons.vue             |  2 +-
 src/components/importer/importer.vue                       |  2 +-
 src/components/lists_edit/lists_edit.vue                   |  2 +-
 src/components/lists_user_search/lists_user_search.vue     |  2 +-
 src/components/navigation/navigation_pins.vue              |  2 +-
 src/components/settings_modal/admin_tabs/frontends_tab.vue |  5 ++++-
 src/components/settings_modal/admin_tabs/instance_tab.vue  | 10 ++++++++--
 src/components/settings_modal/tabs/notifications_tab.vue   |  9 +++++++--
 src/components/settings_modal/tabs/profile_tab.vue         |  4 ++--
 11 files changed, 29 insertions(+), 15 deletions(-)

(limited to 'src/components/settings_modal/tabs/notifications_tab.vue')

diff --git a/src/components/announcement_editor/announcement_editor.vue b/src/components/announcement_editor/announcement_editor.vue
index 017b6f5f..c0a3c30a 100644
--- a/src/components/announcement_editor/announcement_editor.vue
+++ b/src/components/announcement_editor/announcement_editor.vue
@@ -13,8 +13,8 @@
       <label for="announcement-start-time">{{ $t('announcements.start_time_prompt') }}</label>
       <input
         id="announcement-start-time"
-        class="input"
         v-model="announcement.startsAt"
+        class="input"
         :type="announcement.allDay ? 'date' : 'datetime-local'"
         :disabled="disabled"
       >
@@ -23,8 +23,8 @@
       <label for="announcement-end-time">{{ $t('announcements.end_time_prompt') }}</label>
       <input
         id="announcement-end-time"
-        class="input"
         v-model="announcement.endsAt"
+        class="input"
         :type="announcement.allDay ? 'date' : 'datetime-local'"
         :disabled="disabled"
       >
diff --git a/src/components/chat_new/chat_new.vue b/src/components/chat_new/chat_new.vue
index e2476268..34c85a27 100644
--- a/src/components/chat_new/chat_new.vue
+++ b/src/components/chat_new/chat_new.vue
@@ -24,9 +24,9 @@
         />
       </div>
       <input
-        class="input"
         ref="search"
         v-model="query"
+        class="input"
         placeholder="Search people"
         @input="onInput"
       >
diff --git a/src/components/extra_buttons/extra_buttons.vue b/src/components/extra_buttons/extra_buttons.vue
index 6b43da4d..48f45eb5 100644
--- a/src/components/extra_buttons/extra_buttons.vue
+++ b/src/components/extra_buttons/extra_buttons.vue
@@ -12,9 +12,9 @@
   >
     <template #content="{close}">
       <div
+        :id="`popup-menu-${randomSeed}`"
         class="dropdown-menu"
         role="menu"
-        :id="`popup-menu-${randomSeed}`"
       >
         <button
           v-if="canMute && !status.thread_muted"
diff --git a/src/components/importer/importer.vue b/src/components/importer/importer.vue
index 88b3f4fe..12779b45 100644
--- a/src/components/importer/importer.vue
+++ b/src/components/importer/importer.vue
@@ -2,8 +2,8 @@
   <div class="importer">
     <form>
       <input
-        class="input"
         ref="input"
+        class="input"
         type="file"
         @change="change"
       >
diff --git a/src/components/lists_edit/lists_edit.vue b/src/components/lists_edit/lists_edit.vue
index 1e3b61af..3c44579a 100644
--- a/src/components/lists_edit/lists_edit.vue
+++ b/src/components/lists_edit/lists_edit.vue
@@ -33,10 +33,10 @@
         <label for="list-edit-title">{{ $t('lists.title') }}</label>
         {{ ' ' }}
         <input
-          class="input"
           id="list-edit-title"
           ref="title"
           v-model="titleDraft"
+          class="input"
         >
         <button
           v-if="id"
diff --git a/src/components/lists_user_search/lists_user_search.vue b/src/components/lists_user_search/lists_user_search.vue
index 3b684229..3302c83a 100644
--- a/src/components/lists_user_search/lists_user_search.vue
+++ b/src/components/lists_user_search/lists_user_search.vue
@@ -8,9 +8,9 @@
         />
       </div>
       <input
-        class="input"
         ref="search"
         v-model="query"
+        class="input"
         :placeholder="$t('lists.search')"
         @input="onInput"
       >
diff --git a/src/components/navigation/navigation_pins.vue b/src/components/navigation/navigation_pins.vue
index 931d5325..44b27c20 100644
--- a/src/components/navigation/navigation_pins.vue
+++ b/src/components/navigation/navigation_pins.vue
@@ -4,7 +4,7 @@
       v-for="item in pinnedList"
       :key="item.name"
       class="button-unstyled pinned-item"
-      activeClass="toggled"
+      active-class="toggled"
       :to="getRouteTo(item)"
       :title="item.labelRaw || $t(item.label)"
     >
diff --git a/src/components/settings_modal/admin_tabs/frontends_tab.vue b/src/components/settings_modal/admin_tabs/frontends_tab.vue
index fa91afc1..4b36bd76 100644
--- a/src/components/settings_modal/admin_tabs/frontends_tab.vue
+++ b/src/components/settings_modal/admin_tabs/frontends_tab.vue
@@ -24,7 +24,10 @@
         </li>
       </ul>
       <div class="setting-list relative">
-        <PanelLoading class="overlay" v-if="working"/>
+        <PanelLoading
+          v-if="working"
+          class="overlay"
+        />
         <h3>{{ $t('admin_dash.frontend.available_frontends') }}</h3>
         <ul class="cards-list">
           <li
diff --git a/src/components/settings_modal/admin_tabs/instance_tab.vue b/src/components/settings_modal/admin_tabs/instance_tab.vue
index a0e3351e..32e8df25 100644
--- a/src/components/settings_modal/admin_tabs/instance_tab.vue
+++ b/src/components/settings_modal/admin_tabs/instance_tab.vue
@@ -8,7 +8,10 @@
         </li>
         <!-- See https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3963 -->
         <li v-if="adminDraft[':pleroma'][':instance'][':favicon'] !== undefined">
-          <AttachmentSetting compact path=":pleroma.:instance.:favicon" />
+          <AttachmentSetting
+            compact
+            path=":pleroma.:instance.:favicon"
+          />
         </li>
         <li>
           <StringSetting path=":pleroma.:instance.:email" />
@@ -20,7 +23,10 @@
           <StringSetting path=":pleroma.:instance.:short_description" />
         </li>
         <li>
-          <AttachmentSetting compact path=":pleroma.:instance.:instance_thumbnail" />
+          <AttachmentSetting
+            compact
+            path=":pleroma.:instance.:instance_thumbnail"
+          />
         </li>
         <li>
           <AttachmentSetting path=":pleroma.:instance.:background_image" />
diff --git a/src/components/settings_modal/tabs/notifications_tab.vue b/src/components/settings_modal/tabs/notifications_tab.vue
index 9ace4c36..ca2cf8ad 100644
--- a/src/components/settings_modal/tabs/notifications_tab.vue
+++ b/src/components/settings_modal/tabs/notifications_tab.vue
@@ -19,7 +19,10 @@
           </div>
         </li>
         <li>
-          <BooleanSetting path="unseenAtTop" expert="1">
+          <BooleanSetting
+            path="unseenAtTop"
+            expert="1"
+          >
             {{ $t('settings.notification_setting_unseen_at_top') }}
           </BooleanSetting>
         </li>
@@ -38,7 +41,9 @@
         </li>
         <li>
           <h3> {{ $t('settings.notification_visibility') }}</h3>
-          <p v-if="expertLevel > 0">{{ $t('settings.notification_setting_filters_chrome_push') }}</p>
+          <p v-if="expertLevel > 0">
+            {{ $t('settings.notification_setting_filters_chrome_push') }}
+          </p>
           <ul class="setting-list two-column">
             <li>
               <h4> {{ $t('settings.notification_visibility_mentions') }}</h4>
diff --git a/src/components/settings_modal/tabs/profile_tab.vue b/src/components/settings_modal/tabs/profile_tab.vue
index e9e061ac..65df89ca 100644
--- a/src/components/settings_modal/tabs/profile_tab.vue
+++ b/src/components/settings_modal/tabs/profile_tab.vue
@@ -193,8 +193,8 @@
       <div>
         <input
           type="file"
-          @change="uploadFile('banner', $event)"
           class="input"
+          @change="uploadFile('banner', $event)"
         >
       </div>
       <FAIcon
@@ -236,8 +236,8 @@
       <div>
         <input
           type="file"
-          @change="uploadFile('background', $event)"
           class="input"
+          @change="uploadFile('background', $event)"
         >
       </div>
       <FAIcon
-- 
cgit v1.2.3-70-g09d2


From 5c48ea2f1abb21f88990c000e0f158dfa19fa4d7 Mon Sep 17 00:00:00 2001
From: marcin mikołajczak <git@mkljczk.pl>
Date: Sat, 25 May 2024 08:42:32 +0200
Subject: Support `status` notification type
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
---
 changelog.d/status-notification-type.add                  |  1 +
 src/components/interactions/interactions.js               |  1 +
 src/components/notification/notification.vue              |  2 +-
 src/components/notifications/notification_filters.vue     |  9 +++++++++
 src/components/notifications/notifications.js             |  2 +-
 src/components/settings_modal/tabs/notifications_tab.vue  | 15 +++++++++++++++
 src/i18n/en.json                                          |  4 +++-
 src/modules/config.js                                     |  2 ++
 src/services/notification_utils/notification_utils.js     |  6 +++++-
 .../notifications_fetcher.service.js                      |  1 +
 src/sw.js                                                 |  2 ++
 11 files changed, 41 insertions(+), 4 deletions(-)
 create mode 100644 changelog.d/status-notification-type.add

(limited to 'src/components/settings_modal/tabs/notifications_tab.vue')

diff --git a/changelog.d/status-notification-type.add b/changelog.d/status-notification-type.add
new file mode 100644
index 00000000..0917dad4
--- /dev/null
+++ b/changelog.d/status-notification-type.add
@@ -0,0 +1 @@
+Support `status` notification type
\ No newline at end of file
diff --git a/src/components/interactions/interactions.js b/src/components/interactions/interactions.js
index 1ae1d01c..fc441b90 100644
--- a/src/components/interactions/interactions.js
+++ b/src/components/interactions/interactions.js
@@ -3,6 +3,7 @@ import TabSwitcher from 'src/components/tab_switcher/tab_switcher.jsx'
 
 const tabModeDict = {
   mentions: ['mention'],
+  statuses: ['status'],
   'likes+repeats': ['repeat', 'like'],
   follows: ['follow'],
   reactions: ['pleroma:emoji_reaction'],
diff --git a/src/components/notification/notification.vue b/src/components/notification/notification.vue
index 632ae6e9..f84b75de 100644
--- a/src/components/notification/notification.vue
+++ b/src/components/notification/notification.vue
@@ -1,6 +1,6 @@
 <template>
   <article
-    v-if="notification.type === 'mention'"
+    v-if="notification.type === 'mention' || notification.type === 'status'"
   >
     <Status
       class="Notification"
diff --git a/src/components/notifications/notification_filters.vue b/src/components/notifications/notification_filters.vue
index cc506e78..497a5156 100644
--- a/src/components/notifications/notification_filters.vue
+++ b/src/components/notifications/notification_filters.vue
@@ -43,6 +43,15 @@
             :class="{ 'menu-checkbox-checked': filters.mentions }"
           />{{ $t('settings.notification_visibility_mentions') }}
         </button>
+        <button
+          class="menu-item dropdown-item"
+          @click="toggleNotificationFilter('statuses')"
+        >
+          <span
+            class="input menu-checkbox"
+            :class="{ 'menu-checkbox-checked': filters.statuses }"
+          />{{ $t('settings.notification_visibility_statuses') }}
+        </button>
         <button
           class="menu-item dropdown-item"
           @click="toggleNotificationFilter('emojiReactions')"
diff --git a/src/components/notifications/notifications.js b/src/components/notifications/notifications.js
index a9fa8455..85d3662e 100644
--- a/src/components/notifications/notifications.js
+++ b/src/components/notifications/notifications.js
@@ -33,7 +33,7 @@ const Notifications = {
     // Disables panel styles, unread mark, potentially other notification-related actions
     // meant for "Interactions" timeline
     minimalMode: Boolean,
-    // Custom filter mode, an array of strings, possible values 'mention', 'repeat', 'like', 'follow', used to override global filter for use in "Interactions" timeline
+    // Custom filter mode, an array of strings, possible values 'mention', 'status', 'repeat', 'like', 'follow', used to override global filter for use in "Interactions" timeline
     filterMode: Array,
     // Do not show extra notifications
     noExtra: {
diff --git a/src/components/settings_modal/tabs/notifications_tab.vue b/src/components/settings_modal/tabs/notifications_tab.vue
index ca2cf8ad..10228888 100644
--- a/src/components/settings_modal/tabs/notifications_tab.vue
+++ b/src/components/settings_modal/tabs/notifications_tab.vue
@@ -60,6 +60,21 @@
                 </li>
               </ul>
             </li>
+            <li>
+              <h4> {{ $t('settings.notification_visibility_statuses') }}</h4>
+              <ul class="setting-list">
+                <li>
+                  <BooleanSetting path="notificationVisibility.statuses">
+                    {{ $t('settings.notification_visibility_in_column') }}
+                  </BooleanSetting>
+                </li>
+                <li>
+                  <BooleanSetting path="notificationNative.statuses">
+                    {{ $t('settings.notification_visibility_native_notifications') }}
+                  </BooleanSetting>
+                </li>
+              </ul>
+            </li>
             <li>
               <h4> {{ $t('settings.notification_visibility_likes') }}</h4>
               <ul class="setting-list">
diff --git a/src/i18n/en.json b/src/i18n/en.json
index f626e933..c07f5943 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -212,7 +212,8 @@
     "unread_follow_requests": "{num} new follow request | {num} new follow requests",
     "configuration_tip": "You can customize what to display here in {theSettings}. {dismiss}",
     "configuration_tip_settings": "the settings",
-    "configuration_tip_dismiss": "Do not show again"
+    "configuration_tip_dismiss": "Do not show again",
+    "subscribed_status": "posted"
   },
   "polls": {
     "add_poll": "Add poll",
@@ -588,6 +589,7 @@
     "notification_visibility_moves": "User Migrates",
     "notification_visibility_emoji_reactions": "Reactions",
     "notification_visibility_polls": "Ends of polls you voted in",
+    "notification_visibility_statuses": "Subscriptions",
     "notification_show_extra": "Show extra notifications in the notifications column",
     "notification_extra_chats": "Show unread chats",
     "notification_extra_announcements": "Show unread announcements",
diff --git a/src/modules/config.js b/src/modules/config.js
index 8001b854..aa400f77 100644
--- a/src/modules/config.js
+++ b/src/modules/config.js
@@ -60,6 +60,7 @@ export const defaultState = {
   notificationVisibility: {
     follows: true,
     mentions: true,
+    statuses: true,
     likes: true,
     repeats: true,
     moves: true,
@@ -72,6 +73,7 @@ export const defaultState = {
   notificationNative: {
     follows: true,
     mentions: true,
+    statuses: true,
     likes: false,
     repeats: false,
     moves: false,
diff --git a/src/services/notification_utils/notification_utils.js b/src/services/notification_utils/notification_utils.js
index 7b705e65..831b27f6 100644
--- a/src/services/notification_utils/notification_utils.js
+++ b/src/services/notification_utils/notification_utils.js
@@ -18,6 +18,7 @@ export const visibleTypes = store => {
   return ([
     notificationVisibility.likes && 'like',
     notificationVisibility.mentions && 'mention',
+    notificationVisibility.statuses && 'status',
     notificationVisibility.repeats && 'repeat',
     notificationVisibility.follows && 'follow',
     notificationVisibility.followRequest && 'follow_request',
@@ -28,7 +29,7 @@ export const visibleTypes = store => {
   ].filter(_ => _))
 }
 
-const statusNotifications = new Set(['like', 'mention', 'repeat', 'pleroma:emoji_reaction', 'poll'])
+const statusNotifications = new Set(['like', 'mention', 'status', 'repeat', 'pleroma:emoji_reaction', 'poll'])
 
 export const isStatusNotification = (type) => statusNotifications.has(type)
 
@@ -118,6 +119,9 @@ export const prepareNotificationObject = (notification, i18n) => {
     case 'like':
       i18nString = 'favorited_you'
       break
+    case 'status':
+      i18nString = 'subscribed_status'
+      break
     case 'repeat':
       i18nString = 'repeated_you'
       break
diff --git a/src/services/notifications_fetcher/notifications_fetcher.service.js b/src/services/notifications_fetcher/notifications_fetcher.service.js
index 6403693c..32854fed 100644
--- a/src/services/notifications_fetcher/notifications_fetcher.service.js
+++ b/src/services/notifications_fetcher/notifications_fetcher.service.js
@@ -5,6 +5,7 @@ import { promiseInterval } from '../promise_interval/promise_interval.js'
 // Note: chat_mention excluded as pleroma-fe polls them separately
 const mastoApiNotificationTypes = [
   'mention',
+  'status',
   'favourite',
   'reblog',
   'follow',
diff --git a/src/sw.js b/src/sw.js
index 4ee7b9ff..8d790446 100644
--- a/src/sw.js
+++ b/src/sw.js
@@ -38,6 +38,8 @@ const setSettings = async () => {
         switch (k) {
           case 'mentions':
             return 'mention'
+          case 'statuses':
+            return 'status'
           case 'likes':
             return 'like'
           case 'repeats':
-- 
cgit v1.2.3-70-g09d2

