我正在尝试通过ics文件创建约会,但工作正常,但是当我创建另一个ics文件取消约会并尝试导入时,它抛出了 错误“无法打开事件,日历文件可能已损坏”。
对于约会创建,APPOINTMENT.ics将按预期创建条目
APPOINTMENT.ics
BEGIN:VCALENDAR
PRODID:-//Lotus Development Corporation//NONSGML Notes 9.0.1//EN_C
VERSION:2.0
BEGIN:VTIMEZONE
TZID:W. Europe Standard Time
BEGIN:STANDARD
DTSTART:19501029T020000
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
RRULE:FREQ=YEARLY;BYMINUTE=0;BYHOUR=2;BYDAY=-1SU;BYMONTH=10
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:19500326T020000
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
RRULE:FREQ=YEARLY;BYMINUTE=0;BYHOUR=2;BYDAY=-1SU;BYMONTH=3
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
UID:123456
ORGANIZER;CN=Avi Kaushik/Show:mailto:CN=akaushik@xyz.de
DTSTART;TZID="W. Europe Standard Time":20190410T130000
DTEND;TZID="W. Europe Standard Time":20190410T140000
LOCATION:
SUMMARY;LANGUAGE=en-us:process ics file 555555
DESCRIPTION;LANGUAGE=en-us: \n
TZID:W. Europe Standard Time
TRANSP:OPAQUE
END:VEVENT
END:VCALENDAR
但是当尝试通过CANCELLATION.ics取消包含与APPOINTMENT.ics相同的UID的上述条目时,它不起作用
CANCELLATION.ics
BEGIN:VCALENDAR
PRODID:-//Lotus Development Corporation//NONSGML Notes 9.0.1//EN_C
VERSION:2.0
METHOD:CANCEL
BEGIN:VTIMEZONE
TZID:W. Europe Standard Time
BEGIN:STANDARD
DTSTART:19501029T020000
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
RRULE:FREQ=YEARLY;BYMINUTE=0;BYHOUR=2;BYDAY=-1SU;BYMONTH=10
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:19500326T020000
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
RRULE:FREQ=YEARLY;BYMINUTE=0;BYHOUR=2;BYDAY=-1SU;BYMONTH=3
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
UID:123456
ORGANIZER;CN=Avi Kaushik/Show:mailto:CN=akaushik@xyz.de
DTSTART;TZID="W. Europe Standard Time":20190410T130000
DTEND;TZID="W. Europe Standard Time":20190410T140000
SEQUENCE:1
STATUS:CANCELLED
LOCATION:
SUMMARY;LANGUAGE=en-us:process ics file 555555
DESCRIPTION;LANGUAGE=en-us: \n
TZID:W. Europe Standard Time
TRANSP:OPAQUE
END:VEVENT
END:VCALENDAR
答案 0 :(得分:0)
您的第一个ic流只是一个简单的事件,没有任何参与者。 您的第二个ic流是带有METHOD CANCEL的iTIP消息。 iTIP CANCEL消息应在邀请的上下文中使用(即具有ATTENDEE属性)。参见https://tools.ietf.org/html/rfc5546#section-3.2.5。对于您而言,原始活动既没有参加者,也没有取消。
您没有指定这些ic流如何在您的客户端中结束?如果您只是导入它们,我将尝试仅删除第二个流中的METHOD:CANCEL属性。 STATUS:CANCELLED应该足够。