mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-05-16 20:00:03 +02:00
Prevent sending emails and notifications to inactive users (#2384)
* Filter inactive users before sending emails or creating browser notifications Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com> * fix formatting issues Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com> * included requested changes Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com> * optimized database queries * rebasing new master and add tablenames for clarification in xorm queries * remove escaped quotationmarks using backticks Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>
This commit is contained in:
parent
b496e3e1cc
commit
d766d0c4e0
13 changed files with 89 additions and 25 deletions
|
@ -16,9 +16,8 @@ func TestCreateOrUpdateIssueNotifications(t *testing.T) {
|
|||
|
||||
assert.NoError(t, CreateOrUpdateIssueNotifications(issue, 2))
|
||||
|
||||
notf := AssertExistsAndLoadBean(t, &Notification{UserID: 1, IssueID: issue.ID}).(*Notification)
|
||||
assert.Equal(t, NotificationStatusUnread, notf.Status)
|
||||
notf = AssertExistsAndLoadBean(t, &Notification{UserID: 4, IssueID: issue.ID}).(*Notification)
|
||||
// Two watchers are inactive, thus only notification for user 10 is created
|
||||
notf := AssertExistsAndLoadBean(t, &Notification{UserID: 10, IssueID: issue.ID}).(*Notification)
|
||||
assert.Equal(t, NotificationStatusUnread, notf.Status)
|
||||
CheckConsistencyFor(t, &Issue{ID: issue.ID})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue