Skip to content

Commit

Permalink
Relaxed validation for Gmail compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
benfortuna committed Sep 19, 2019
1 parent 1ad1656 commit 7445880
Showing 1 changed file with 4 additions and 1 deletion.
@@ -1,6 +1,7 @@
package net.fortuna.ical4j.validate.component;

import net.fortuna.ical4j.model.component.VEvent;
import net.fortuna.ical4j.util.CompatibilityHints;
import net.fortuna.ical4j.validate.ComponentValidator;
import net.fortuna.ical4j.validate.PropertyValidator;
import net.fortuna.ical4j.validate.ValidationException;
Expand Down Expand Up @@ -82,6 +83,8 @@ public void validate(final VEvent target) throws ValidationException {
LAST_MODIFIED, LOCATION, PRIORITY, RESOURCES, STATUS, SUMMARY,
TRANSP, URL).forEach(property -> PropertyValidator.getInstance().assertOneOrLess(property, target.getProperties()));

ComponentValidator.assertNone(VALARM, target.getAlarms());
if (!CompatibilityHints.isHintEnabled(CompatibilityHints.KEY_RELAXED_VALIDATION)) {
ComponentValidator.assertNone(VALARM, target.getAlarms());
}
}
}

0 comments on commit 7445880

Please sign in to comment.