TemplateNotification templateNotification = soneInsertNotifications.get(sone);
if (templateNotification == null) {
templateNotification = new TemplateNotification(TemplateParser.parse(createReader("/templates/notify/soneInsertNotification.html")));
- templateNotification.set("sone", sone);
+ templateNotification.set("insertSone", sone);
soneInsertNotifications.put(sone, templateNotification);
}
return templateNotification;
public void soneInserting(Sone sone) {
TemplateNotification soneInsertNotification = getSoneInsertNotification(sone);
soneInsertNotification.set("soneStatus", "inserting");
- notificationManager.addNotification(soneInsertNotification);
+ if (sone.getOptions().getBooleanOption("EnableSoneInsertNotifications").get()) {
+ notificationManager.addNotification(soneInsertNotification);
+ }
}
/**
TemplateNotification soneInsertNotification = getSoneInsertNotification(sone);
soneInsertNotification.set("soneStatus", "inserted");
soneInsertNotification.set("insertDuration", insertDuration / 1000);
- notificationManager.addNotification(soneInsertNotification);
+ if (sone.getOptions().getBooleanOption("EnableSoneInsertNotifications").get()) {
+ notificationManager.addNotification(soneInsertNotification);
+ }
}
/**
*/
@Override
public void soneInsertAborted(Sone sone, Throwable cause) {
- notificationManager.addNotification(getSoneInsertNotification(sone).set("soneStatus", "insert-aborted").set("insert-error", cause));
+ TemplateNotification soneInsertNotification = getSoneInsertNotification(sone);
+ soneInsertNotification.set("soneStatus", "insert-aborted");
+ soneInsertNotification.set("insert-error", cause);
+ if (sone.getOptions().getBooleanOption("EnableSoneInsertNotifications").get()) {
+ notificationManager.addNotification(soneInsertNotification);
+ }
}
/**