aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortwilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b>2009-10-09 22:04:04 +0000
committertwilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b>2009-10-09 22:04:04 +0000
commitb802d5df4975ebeaf42a516f46979ed5738ca404 (patch)
tree96bfbb492cedb7b8e0d6ff870fb75ae85e693925
parenta5d47ad2dd44fd5e379d41c776ae589808813a8e (diff)
Properly return "free" on confirmed events that are free
CONFIRMED status doesn't imply busy or free, that is handled with the TRANSP field. Luckily, libical already sets the is_busy status on the span for us. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@223370 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--res/res_calendar_caldav.c13
-rw-r--r--res/res_calendar_icalendar.c13
2 files changed, 2 insertions, 24 deletions
diff --git a/res/res_calendar_caldav.c b/res/res_calendar_caldav.c
index 2b3f5a334..f575dbf05 100644
--- a/res/res_calendar_caldav.c
+++ b/res/res_calendar_caldav.c
@@ -322,18 +322,7 @@ static void caldav_add_event(icalcomponent *comp, struct icaltime_span *span, vo
event->start = span->start;
event->end = span->end;
- switch(icalcomponent_get_status(comp)) {
- case ICAL_STATUS_CONFIRMED:
- event->busy_state = AST_CALENDAR_BS_BUSY;
- break;
-
- case ICAL_STATUS_TENTATIVE:
- event->busy_state = AST_CALENDAR_BS_BUSY_TENTATIVE;
- break;
-
- default:
- event->busy_state = AST_CALENDAR_BS_FREE;
- }
+ event->busy_state = span->is_busy ? AST_CALENDAR_BS_BUSY : AST_CALENDAR_BS_FREE;
if ((prop = icalcomponent_get_first_property(comp, ICAL_SUMMARY_PROPERTY))) {
ast_string_field_set(event, summary, icalproperty_get_value_as_string(prop));
diff --git a/res/res_calendar_icalendar.c b/res/res_calendar_icalendar.c
index 97c3253ab..f235fa532 100644
--- a/res/res_calendar_icalendar.c
+++ b/res/res_calendar_icalendar.c
@@ -185,18 +185,7 @@ static void icalendar_add_event(icalcomponent *comp, struct icaltime_span *span,
event->start = span->start;
event->end = span->end;
- switch(icalcomponent_get_status(comp)) {
- case ICAL_STATUS_CONFIRMED:
- event->busy_state = AST_CALENDAR_BS_BUSY;
- break;
-
- case ICAL_STATUS_TENTATIVE:
- event->busy_state = AST_CALENDAR_BS_BUSY_TENTATIVE;
- break;
-
- default:
- event->busy_state = AST_CALENDAR_BS_FREE;
- }
+ event->busy_state = span->is_busy ? AST_CALENDAR_BS_BUSY : AST_CALENDAR_BS_FREE;
if ((prop = icalcomponent_get_first_property(comp, ICAL_SUMMARY_PROPERTY))) {
ast_string_field_set(event, summary, icalproperty_get_value_as_string(prop));