From: <li...@us...> - 2002-09-26 22:03:07
|
Update of /cvsroot/freeassociation/libical/src/libical In directory usw-pr-cvs1:/tmp/cvs-serv12087 Modified Files: icalcomponent.c Log Message: better function for calculating the busy status of a component, check the STATUS property as well as the TRANSP property Index: icalcomponent.c =================================================================== RCS file: /cvsroot/freeassociation/libical/src/libical/icalcomponent.c,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- icalcomponent.c 9 Aug 2002 14:45:12 -0000 1.41 +++ icalcomponent.c 26 Sep 2002 22:03:02 -0000 1.42 @@ -908,6 +908,8 @@ static int icalcomponent_is_busy(icalcomponent *comp) { icalproperty *transp; + enum icalproperty_status status; + int ret = 1; /** @todo check access control here, converting busy->free if the permissions do not allow access... */ @@ -922,15 +924,25 @@ case ICAL_TRANSP_OPAQUE: case ICAL_TRANSP_OPAQUENOCONFLICT: case ICAL_TRANSP_NONE: - return (1); + ret = 1; case ICAL_TRANSP_TRANSPARENT: case ICAL_TRANSP_TRANSPARENTNOCONFLICT: - return(0); + ret = 0; default: - return(0); + /** shouldn't need this... **/ + ret = 0; } } - return(1); + status = icalcomponent_get_status(comp); + if (ret && status) { + switch (status) { + case ICAL_STATUS_CANCELLED: + case ICAL_STATUS_TENTATIVE: + ret = 0; + default: + } + } + return(0); } |