do not use the notification description at event description

This commit is contained in:
tibbi
2017-02-19 19:10:23 +01:00
parent 48de60188f
commit 2a69232ce5

View File

@@ -34,6 +34,7 @@ class IcsParser {
var curFlags = 0 var curFlags = 0
var curReminderMinutes = -1 var curReminderMinutes = -1
var curShouldHaveNotification = false var curShouldHaveNotification = false
var isNotificationDescription = false
var eventsImported = 0 var eventsImported = 0
var eventsFailed = 0 var eventsFailed = 0
@@ -67,11 +68,12 @@ class IcsParser {
} else if (line.startsWith(SUMMARY)) { } else if (line.startsWith(SUMMARY)) {
curTitle = line.substring(SUMMARY.length) curTitle = line.substring(SUMMARY.length)
curTitle = curTitle.substring(0, Math.min(curTitle.length, 50)) curTitle = curTitle.substring(0, Math.min(curTitle.length, 50))
} else if (line.startsWith(DESCRIPTION)) { } else if (line.startsWith(DESCRIPTION) && !isNotificationDescription) {
curDescription = line.substring(DESCRIPTION.length) curDescription = line.substring(DESCRIPTION.length)
} else if (line.startsWith(UID)) { } else if (line.startsWith(UID)) {
curImportId = line.substring(UID.length) curImportId = line.substring(UID.length)
} else if (line.startsWith(ACTION)) { } else if (line.startsWith(ACTION)) {
isNotificationDescription = true
if (line.substring(ACTION.length) == DISPLAY) if (line.substring(ACTION.length) == DISPLAY)
curShouldHaveNotification = true curShouldHaveNotification = true
} else if (line.startsWith(TRIGGER)) { } else if (line.startsWith(TRIGGER)) {
@@ -156,5 +158,6 @@ class IcsParser {
curFlags = 0 curFlags = 0
curReminderMinutes = -1 curReminderMinutes = -1
curShouldHaveNotification = false curShouldHaveNotification = false
isNotificationDescription = false
} }
} }