]> source.dussan.org Git - gitblit.git/commitdiff
Repository owners were not CCd on ticket emails
authorJames Moger <james.moger@gitblit.com>
Mon, 10 Mar 2014 13:22:04 +0000 (09:22 -0400)
committerJames Moger <james.moger@gitblit.com>
Mon, 10 Mar 2014 13:22:04 +0000 (09:22 -0400)
src/main/java/com/gitblit/tickets/TicketNotifier.java

index 6ff76def4dd210e191bef3de6a5c2772f36c9dd4..48fe051fe2413592f8f519d2dee571457c82ef38 100644 (file)
@@ -520,9 +520,16 @@ public class TicketNotifier {
 
                //
                // Direct TO recipients
+               // reporter & responsible
                //
+               Set<String> tos = new TreeSet<String>();
+               tos.add(ticket.createdBy);
+               if (!StringUtils.isEmpty(ticket.responsible)) {
+                       tos.add(ticket.responsible);
+               }
+
                Set<String> toAddresses = new TreeSet<String>();
-               for (String name : ticket.getParticipants()) {
+               for (String name : tos) {
                        UserModel user = userManager.getUserModel(name);
                        if (user != null && !user.disabled) {
                                if (!StringUtils.isEmpty(user.emailAddress)) {
@@ -543,6 +550,11 @@ public class TicketNotifier {
                //
                Set<String> ccs = new TreeSet<String>();
 
+               // repository owners
+               if (!ArrayUtils.isEmpty(repository.owners)) {
+                       tos.addAll(repository.owners);
+               }
+
                // cc users mentioned in last comment
                Change lastChange = ticket.changes.get(ticket.changes.size() - 1);
                if (lastChange.hasComment()) {