diff options
author | James Moger <james.moger@gitblit.com> | 2014-06-05 10:24:39 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2014-06-05 10:24:39 -0400 |
commit | afbaebde11093fae8b420aaaf71dcd56d8c0f9fd (patch) | |
tree | fe1d739b9e723ca0f95f12af2511e613412c8a2f /src/main/java/com/gitblit/tickets/TicketNotifier.java | |
parent | 74221eb302e782ef23777d5c3f0a649ceb321c1e (diff) | |
download | gitblit-afbaebde11093fae8b420aaaf71dcd56d8c0f9fd.tar.gz gitblit-afbaebde11093fae8b420aaaf71dcd56d8c0f9fd.zip |
Add "email me on my ticket changes" preference
Diffstat (limited to 'src/main/java/com/gitblit/tickets/TicketNotifier.java')
-rw-r--r-- | src/main/java/com/gitblit/tickets/TicketNotifier.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main/java/com/gitblit/tickets/TicketNotifier.java b/src/main/java/com/gitblit/tickets/TicketNotifier.java index 9a5e4e1d..07371b1b 100644 --- a/src/main/java/com/gitblit/tickets/TicketNotifier.java +++ b/src/main/java/com/gitblit/tickets/TicketNotifier.java @@ -545,7 +545,6 @@ public class TicketNotifier { } } } - mailing.setRecipients(toAddresses); // // CC recipients @@ -554,7 +553,7 @@ public class TicketNotifier { // repository owners if (!ArrayUtils.isEmpty(repository.owners)) { - tos.addAll(repository.owners); + ccs.addAll(repository.owners); } // cc users mentioned in last comment @@ -595,6 +594,14 @@ public class TicketNotifier { } ccAddresses.addAll(settings.getStrings(Keys.mail.mailingLists)); + // respect the author's email preference + UserModel lastAuthor = userManager.getUserModel(lastChange.author); + if (!lastAuthor.getPreferences().isEmailMeOnMyTicketChanges()) { + toAddresses.remove(lastAuthor.emailAddress); + ccAddresses.remove(lastAuthor.emailAddress); + } + + mailing.setRecipients(toAddresses); mailing.setCCs(ccAddresses); } |