FEATURE: Add chat message notifications for personal chats (#23307)

This feature adds notifications for chat messages that are sent within personal chats (1:1 and personal group chats).

To prevent notification spam we make use of consolidated notifications to combine updated message information in a meaningful way that allows the receiver to quickly jump into the chat to see what they missed.

This update respects muted channels, muted and blocked users. It will only create a new notification when the user has not muted the channel and the notified user is not muting or ignoring the message sender.
This commit is contained in:
David Battersby
2023-09-13 17:15:11 +08:00
committed by GitHub
parent 6e2b484f12
commit 0a1a07fff8
6 changed files with 244 additions and 0 deletions

View File

@ -59,6 +59,7 @@ after_initialize do
Guardian.prepend Chat::GuardianExtensions
UserNotifications.prepend Chat::UserNotificationsExtension
Notifications::ConsolidationPlan.prepend Chat::NotificationConsolidationExtension
UserOption.prepend Chat::UserOptionExtension
Category.prepend Chat::CategoryExtension
Reviewable.prepend Chat::ReviewableExtension
@ -472,6 +473,10 @@ after_initialize do
)
register_bookmarkable(Chat::MessageBookmarkable)
register_notification_consolidation_plan(
Chat::NotificationConsolidationExtension.chat_message_plan,
)
end
if Rails.env == "test"