From 4261c190ab9f9483a00d1769e3916ec608ec5391 Mon Sep 17 00:00:00 2001 From: James Moger Date: Mon, 10 Mar 2014 09:22:04 -0400 Subject: [PATCH] Repository owners were not CCd on ticket emails --- .../java/com/gitblit/tickets/TicketNotifier.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gitblit/tickets/TicketNotifier.java b/src/main/java/com/gitblit/tickets/TicketNotifier.java index 6ff76def..48fe051f 100644 --- a/src/main/java/com/gitblit/tickets/TicketNotifier.java +++ b/src/main/java/com/gitblit/tickets/TicketNotifier.java @@ -520,9 +520,16 @@ public class TicketNotifier { // // Direct TO recipients + // reporter & responsible // + Set tos = new TreeSet(); + tos.add(ticket.createdBy); + if (!StringUtils.isEmpty(ticket.responsible)) { + tos.add(ticket.responsible); + } + Set toAddresses = new TreeSet(); - 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 ccs = new TreeSet(); + // 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()) { -- 2.39.5