safwanrahman / django-webpush

Web Push Notification Package for Django
GNU General Public License v3.0
362 stars 103 forks source link

Add exclude_user_id Parameter to Prevent Self-Notifications in Group Messages #125

Closed DartLazer closed 10 months ago

DartLazer commented 10 months ago

Summary

This pull request adds an optional exclude_user_id parameter to the send_notification_to_group and send_group_notification functions. The main objective is to allow the exclusion of a user from receiving notifications that they themselves have triggered within a group they are part of.

Changes

Motivation

Before this change, if a user sent a notification to a group they belong to, they would receive the notification themselves. In scenarios where a user triggers an event that results in a group notification, this behavior leads to redundant and potentially confusing notifications for the user who initiated the action. This update provides a way to prevent such situations.

Backward Compatibility

The changes introduced in this PR are backward-compatible. The new exclude_user_id parameter is optional, and omitting it will not affect the existing functionality.

safwanrahman commented 10 months ago

That looks really good. r+