[asterisk-commits] twilson: trunk r223370 - /trunk/res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Oct 9 17:04:08 CDT 2009


Author: twilson
Date: Fri Oct  9 17:04:04 2009
New Revision: 223370

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=223370
Log:
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.

Modified:
    trunk/res/res_calendar_caldav.c
    trunk/res/res_calendar_icalendar.c

Modified: trunk/res/res_calendar_caldav.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_calendar_caldav.c?view=diff&rev=223370&r1=223369&r2=223370
==============================================================================
--- trunk/res/res_calendar_caldav.c (original)
+++ trunk/res/res_calendar_caldav.c Fri Oct  9 17:04:04 2009
@@ -322,18 +322,7 @@
 	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));

Modified: trunk/res/res_calendar_icalendar.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_calendar_icalendar.c?view=diff&rev=223370&r1=223369&r2=223370
==============================================================================
--- trunk/res/res_calendar_icalendar.c (original)
+++ trunk/res/res_calendar_icalendar.c Fri Oct  9 17:04:04 2009
@@ -185,18 +185,7 @@
 	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));




More information about the asterisk-commits mailing list