mirror of
https://github.com/go-gitea/gitea
synced 2025-07-12 13:37:20 +00: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:
committed by
Lunny Xiao
parent
b496e3e1cc
commit
d766d0c4e0
@ -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})
|
||||
}
|
||||
|
Reference in New Issue
Block a user