Skip to content

Commit

Permalink
fix for alfio-event#168: switch to v2 of ical, replace new line with …
Browse files Browse the repository at this point in the history
…space for location
  • Loading branch information
syjer committed Aug 28, 2016
1 parent c8ed624 commit f33dcb7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ dependencies {
compile "com.squareup.okhttp:okhttp:2.4.0"
compile "com.opencsv:opencsv:3.4"
compile 'commons-codec:commons-codec:1.10'
compile 'net.sf.biweekly:biweekly:0.4.5'
compile 'net.sf.biweekly:biweekly:0.5.0'
compile 'com.atlassian.commonmark:commonmark:0.5.1'

testCompile "org.springframework:spring-test:$springVersion"
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/alfio/model/Event.java
Original file line number Diff line number Diff line change
Expand Up @@ -251,14 +251,14 @@ public Optional<byte[]> getIcal(String description, String organizerName, String
VEvent vEvent = new VEvent();
vEvent.setSummary(getDisplayName());
vEvent.setDescription(description);
vEvent.setLocation(getLocation());
vEvent.setLocation(StringUtils.replacePattern(getLocation(), "[\n\r\t]+", " "));
vEvent.setDateStart(Date.from(getBegin().toInstant()));
vEvent.setDateEnd(Date.from(getEnd().toInstant()));
vEvent.setUrl(getWebsiteUrl());
vEvent.setOrganizer(new Organizer(organizerName, organizerEmail));
ical.addEvent(vEvent);
StringWriter strWriter = new StringWriter();
try (ICalWriter writer = new ICalWriter(strWriter, ICalVersion.V1_0)) {
try (ICalWriter writer = new ICalWriter(strWriter, ICalVersion.V2_0)) {
writer.write(ical);
return Optional.of(strWriter.toString().getBytes(StandardCharsets.UTF_8));
} catch (IOException e) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/alfio/plugin/mailchimp/MailChimpPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
import alfio.plugin.TicketAssignmentPlugin;
import alfio.plugin.WaitingQueueSubscriptionPlugin;
import alfio.util.Json;
import biweekly.util.org.apache.commons.codec.binary.Hex;
import com.squareup.okhttp.*;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.codec.binary.Hex;

import java.io.IOException;
import java.io.UnsupportedEncodingException;
Expand Down

0 comments on commit f33dcb7

Please sign in to comment.