Properly select raw notification handler by default

This commit is contained in:
Maxime Dor
2017-11-26 16:30:42 +01:00
parent e2b3920840
commit a1adca72e8

View File

@@ -47,15 +47,14 @@ public class NotificationManager {
handlers.forEach(h -> {
log.info("Found handler {} for medium {}", h.getId(), h.getMedium());
String handlerId = cfg.getHandler().get(h.getMedium());
if (StringUtils.isBlank(handlerId) || StringUtils.equals(handlerId, h.getId())) {
if (StringUtils.isBlank(handlerId) && StringUtils.equals("raw", h.getId()) ||
StringUtils.equals(handlerId, h.getId())) {
this.handlers.put(h.getMedium(), h);
}
});
log.info("--- Notification handler ---");
this.handlers.forEach((k, v) -> {
log.info("\tHandler for {}: {}", k, v.getId());
});
this.handlers.forEach((k, v) -> log.info("\tHandler for {}: {}", k, v.getId()));
}
private INotificationHandler ensureMedium(String medium) {