Commit 6102bf6
committed
fix(bulkReceive): honour admin email toggle and ISetting notification defaults
bulkReceive() bypassed UserSettings::getUserSetting() in favour of raw
IUserConfig::getValuesByUsers() calls, losing two guards that exist in the
single-user receive() path:
1. The admin enable_email toggle was never checked, so activity emails were
queued for all users even when an admin had globally disabled them.
2. When canChangeNotification() is false the per-user push settings map was
never populated, leaving $notificationSetting as null. Because
null !== false evaluates to true, push notifications fired unconditionally
for every affected user regardless of ISetting::isDefaultEnabledNotification().
Fix: add the enable_email guard before querying per-user email prefs, and
derive a $defaultPushEnabled from ISetting so the fallback mirrors what
getUserSetting() returns when canModifySetting() is false.
AI-Assisted-By: claude-sonnet-4-6
Signed-off-by: Anna Larch <anna@nextcloud.com>1 parent b008de6 commit 6102bf6
1 file changed
Lines changed: 14 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| 29 | + | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
| |||
78 | 80 | | |
79 | 81 | | |
80 | 82 | | |
| 83 | + | |
81 | 84 | | |
82 | | - | |
| 85 | + | |
83 | 86 | | |
84 | 87 | | |
85 | 88 | | |
86 | 89 | | |
87 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
88 | 93 | | |
89 | 94 | | |
90 | 95 | | |
| |||
95 | 100 | | |
96 | 101 | | |
97 | 102 | | |
98 | | - | |
99 | | - | |
100 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
101 | 108 | | |
| 109 | + | |
102 | 110 | | |
103 | 111 | | |
104 | 112 | | |
105 | | - | |
| 113 | + | |
106 | 114 | | |
107 | 115 | | |
108 | 116 | | |
| |||
0 commit comments