1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-07-22 14:52:25 +02:00

Ensure we automatically convert unrenderable chars the title/description of calendar events

This commit is contained in:
Gordon Williams 2022-11-23 20:33:06 +00:00 committed by Gitea
parent e003e0b672
commit bb1323dd61

View File

@ -846,6 +846,7 @@ public class BangleJSDeviceSupport extends AbstractBTLEDeviceSupport {
}
public String renderUnicodeAsImage(String txt) {
// FIXME: it looks like we could implement this as customStringFilter now so it happens automatically
if (txt==null) return null;
// Simple conversions
txt = txt.replaceAll("", "...");
@ -1158,9 +1159,9 @@ public class BangleJSDeviceSupport extends AbstractBTLEDeviceSupport {
o.put("type", calendarEventSpec.type); //implement this too? (sunrise and set)
o.put("timestamp", calendarEventSpec.timestamp);
o.put("durationInSeconds", calendarEventSpec.durationInSeconds);
o.put("title", calendarEventSpec.title);
o.put("description", calendarEventSpec.description);
o.put("location", calendarEventSpec.location);
o.put("title", renderUnicodeAsImage(calendarEventSpec.title));
o.put("description", renderUnicodeAsImage(calendarEventSpec.description));
o.put("location", renderUnicodeAsImage(calendarEventSpec.location));
o.put("calName", calendarEventSpec.calName);
o.put("color", calendarEventSpec.color);
o.put("allDay", calendarEventSpec.allDay);