DEV: group all collapsed notifications

DEV: group all collapsed notifications
diff --git a/app/services/post_alerter.rb b/app/services/post_alerter.rb
index a702efd..1ee5a83 100644
--- a/app/services/post_alerter.rb
+++ b/app/services/post_alerter.rb
@@ -271,6 +271,7 @@ class PostAlerter
     Notification.types[:replied],
     Notification.types[:quoted],
     Notification.types[:posted],
+    Notification.types[:private_message],
   ]
 
   def create_notification(user, type, post, opts = {})
@@ -341,13 +342,8 @@ class PostAlerter
       collapsed = true
     end
 
-    if type == Notification.types[:private_message]
-      destroy_notifications(user, type, post.topic)
-      collapsed = true
-    end
-
     original_post = post
-    original_username = opts[:display_username] || post.username # xxxxx need something here too
+    original_username = opts[:display_username].presence || post.username
 
     if collapsed
       post = first_unread_post(user, post.topic) || post

GitHub
sha: 2988d281

This sure is confusing.

Technically this is a behaviour change cause now we nuke @mention/quotes and so on inside PMs where in the past we did not. It increases the scope of collapsing.

That said, I am not sure it will cause any issues as people are usually watching PMs anyway… anything lower than watching on a PM is kind of rare.

1 Like