Merge "Add config to remove emails for new patchsets"
This commit is contained in:
@@ -1387,6 +1387,7 @@ public abstract class AbstractDaemonTest {
|
||||
pwi.filter = filter;
|
||||
pwi.notifyAbandonedChanges = true;
|
||||
pwi.notifyNewChanges = true;
|
||||
pwi.notifyNewPatchSets = true;
|
||||
pwi.notifyAllComments = true;
|
||||
});
|
||||
}
|
||||
|
@@ -37,6 +37,7 @@ public class EmailSettings {
|
||||
public final String password;
|
||||
public final Encryption encryption;
|
||||
public final long fetchInterval; // in milliseconds
|
||||
public final boolean sendNewPatchsetEmails;
|
||||
|
||||
@Inject
|
||||
EmailSettings(@GerritServerConfig Config cfg) {
|
||||
@@ -58,5 +59,6 @@ public class EmailSettings {
|
||||
"fetchInterval",
|
||||
TimeUnit.MILLISECONDS.convert(60, TimeUnit.SECONDS),
|
||||
TimeUnit.MILLISECONDS);
|
||||
sendNewPatchsetEmails = cfg.getBoolean("change", null, "sendNewPatchsetEmails", true);
|
||||
}
|
||||
}
|
||||
|
@@ -61,12 +61,14 @@ public class ReplacePatchSetSender extends ReplyToChangeSender {
|
||||
//
|
||||
reviewers.remove(fromId);
|
||||
}
|
||||
if (notify.handling() == NotifyHandling.ALL
|
||||
|| notify.handling() == NotifyHandling.OWNER_REVIEWERS) {
|
||||
add(RecipientType.TO, reviewers);
|
||||
add(RecipientType.CC, extraCC);
|
||||
if (args.settings.sendNewPatchsetEmails) {
|
||||
if (notify.handling() == NotifyHandling.ALL
|
||||
|| notify.handling() == NotifyHandling.OWNER_REVIEWERS) {
|
||||
add(RecipientType.TO, reviewers);
|
||||
add(RecipientType.CC, extraCC);
|
||||
}
|
||||
rcptToAuthors(RecipientType.CC);
|
||||
}
|
||||
rcptToAuthors(RecipientType.CC);
|
||||
bccStarredBy();
|
||||
includeWatchers(NotifyType.NEW_PATCHSETS, !change.isWorkInProgress() && !change.isPrivate());
|
||||
removeUsersThatIgnoredTheChange();
|
||||
|
Reference in New Issue
Block a user