}
if(!Watch.isWatching(user, project.asResource())) {
return badRequest(Messages.get("error.notfound.watch"));
}
UserProjectNotification upn = UserProjectNotification.findOne(user, project, notiType);
if(upn == null) { // make the EventType OFF, because default is ON.
UserProjectNotification.unwatchExplictly(user, project, notiType);
} else {
upn.toggle();
}
return ok();
}