mirror of
https://github.com/LibreSign/libresign.git
synced 2025-12-18 05:20:45 +01:00
fix: check Activity admin setting in notification listener
Add explicit check for Activity admin (global) setting before checking user preference for in-app notifications. This ensures consistency across all notification channels and prevents users from enabling notifications when disabled globally by the admin. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
This commit is contained in:
parent
31b097bdda
commit
a4d5a5f854
1 changed files with 5 additions and 2 deletions
|
|
@ -210,13 +210,16 @@ class NotificationListener implements IEventListener {
|
|||
}
|
||||
$activityUserSettings = \OCP\Server::get(\OCA\Activity\UserSettings::class);
|
||||
if ($activityUserSettings) {
|
||||
$adminSetting = $activityUserSettings->getAdminSetting('notification', $type);
|
||||
if (!$adminSetting) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$notificationSetting = $activityUserSettings->getUserSetting(
|
||||
$userId,
|
||||
'notification',
|
||||
$type
|
||||
);
|
||||
// If setting is explicitly false, notifications are disabled
|
||||
// If setting is null/not configured, notifications are enabled by default
|
||||
if ($notificationSetting === false) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue