Enable watching of all projects

Some users want to get e-mail notifications for all projects hosted
in Gerrit. So far it was only possible to watch all projects
by explicitly adding each project to the watch list. With this
change adding the wild card project to the watch list allows you
to configure e-mail notification for all projects.

Bug: issue 535
Signed-off-by: Edwin Kempin <edwin.kempin@gmail.com>
Change-Id: I15da036fc7aa1c90a72cf0c6935f0df45640c3ec
This commit is contained in:
Edwin Kempin
2010-06-28 11:35:47 +02:00
committed by Shawn O. Pearce
parent 55661b1ca1
commit e7d485ccc4
8 changed files with 94 additions and 48 deletions

View File

@@ -63,12 +63,13 @@ public class CreateChangeSender extends NewChangeSender {
// BCC anyone who has interest in this project's changes
//
for (AccountProjectWatch w : db.accountProjectWatches()
.notifyNewChanges(ps.getProject().getNameKey())) {
if (owners.contains(w.getAccountId())) {
add(RecipientType.TO, w.getAccountId());
} else {
add(RecipientType.BCC, w.getAccountId());
for (final AccountProjectWatch w : getProjectWatches()) {
if (w.isNotifyNewChanges()) {
if (owners.contains(w.getAccountId())) {
add(RecipientType.TO, w.getAccountId());
} else {
add(RecipientType.BCC, w.getAccountId());
}
}
}
}