summaryrefslogtreecommitdiff
path: root/res/res_calendar_caldav.c
diff options
context:
space:
mode:
authorJan Kalab <pitlicek@gmail.com>2010-09-03 12:58:52 +0000
committerJan Kalab <pitlicek@gmail.com>2010-09-03 12:58:52 +0000
commita7505c0b91c9333c8968e98e57c8cb1142378190 (patch)
tree5c7bcfe2b2c8238f51d3f9f60f2207fa8eb5a245 /res/res_calendar_caldav.c
parent3403dbf3741bb3d5f057289a204ea2d11d41b9df (diff)
Support for calendar events priorities and categories (with ISO C90 fix)
See RFC 5545 ch. 3.8.1.2 and 9. (closes issue #17837) Review: https://reviewboard.asterisk.org/r/880/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@284851 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_calendar_caldav.c')
-rw-r--r--res/res_calendar_caldav.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/res/res_calendar_caldav.c b/res/res_calendar_caldav.c
index 664f25b87..e0d8c483e 100644
--- a/res/res_calendar_caldav.c
+++ b/res/res_calendar_caldav.c
@@ -216,6 +216,12 @@ static int caldav_write_event(struct ast_calendar_event *event)
if (!ast_strlen_zero(event->location)) {
icalcomponent_add_property(icalevent, icalproperty_new_location(event->location));
}
+ if (!ast_strlen_zero(event->categories)) {
+ icalcomponent_add_property(icalevent, icalproperty_new_categories(event->categories));
+ }
+ if (event->priority > 0) {
+ icalcomponent_add_property(icalevent, icalproperty_new_priority(event->priority));
+ }
switch (event->busy_state) {
case AST_CALENDAR_BS_BUSY:
@@ -365,6 +371,14 @@ static void caldav_add_event(icalcomponent *comp, struct icaltime_span *span, vo
ast_string_field_set(event, location, icalproperty_get_value_as_string(prop));
}
+ if ((prop = icalcomponent_get_first_property(comp, ICAL_CATEGORIES_PROPERTY))) {
+ ast_string_field_set(event, categories, icalproperty_get_value_as_string(prop));
+ }
+
+ if ((prop = icalcomponent_get_first_property(comp, ICAL_PRIORITY_PROPERTY))) {
+ event->priority = icalvalue_get_integer(icalproperty_get_value(prop));
+ }
+
if ((prop = icalcomponent_get_first_property(comp, ICAL_UID_PROPERTY))) {
ast_string_field_set(event, uid, icalproperty_get_value_as_string(prop));
} else {