enable to parse ver2.0 rrule in ver1.0 vcs 87/47787/4
authorJeesun Kim <iamjs.kim@samsung.com>
Tue, 8 Sep 2015 14:38:47 +0000 (23:38 +0900)
committerjeesun kim <iamjs.kim@samsung.com>
Wed, 9 Sep 2015 03:10:08 +0000 (20:10 -0700)
Change-Id: I9fee0a30cde1742d6571dcc2337376642bc0ea50

common/cal_vcalendar_parse.c

index 7ca3919..39969cf 100644 (file)
@@ -1734,9 +1734,16 @@ static void __work_component_property_rrule(char *value, calendar_record_h recor
        RET_IF(NULL == record);
        RET_IF(NULL == ud);
 
+       int version = ud->version;
+       /* check if this field has different version content */
+       if (CAL_STRING_EQUAL == strncmp(value, ":FREQ=", strlen(":FREQ=")))
+               version = VCAL_VER_2;
+       else
+               version = VCAL_VER_1;
+
        switch (ud->type) {
        case CALENDAR_BOOK_TYPE_EVENT:
-               switch (ud->version) {
+               switch (version) {
                case VCAL_VER_1:
                        __work_component_property_rrule_ver_1(value, record, ud);
                        break;