diff --git a/ActiveSync/iCalEvent+ActiveSync.m b/ActiveSync/iCalEvent+ActiveSync.m
index 121f0b11b..1bb58bfd9 100644
--- a/ActiveSync/iCalEvent+ActiveSync.m
+++ b/ActiveSync/iCalEvent+ActiveSync.m
@@ -63,7 +63,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- (int) _attendeeStatus: (iCalPerson *) attendee
{
int attendee_status;
-
+
attendee_status = 5;
if ([[attendee partStat] caseInsensitiveCompare: @"ACCEPTED"] == NSOrderedSame)
attendee_status = 3;
@@ -75,6 +75,29 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
return attendee_status;
}
+//
+// Possible values are:
+// 0 Free
+// 1 Tentative
+// 2 Busy
+// 3 Out of Office
+// 4 Working elsewhere
+//
+- (int) _busyStatus: (iCalPerson *) attendee
+{
+ int attendee_status;
+
+ attendee_status = 2;
+
+ if ([[attendee partStat] caseInsensitiveCompare: @"DECLINED"] == NSOrderedSame)
+ attendee_status = 0;
+ else if ([[attendee partStat] caseInsensitiveCompare: @"TENTATIVE"] == NSOrderedSame)
+ attendee_status = 1;
+
+ return attendee_status;
+}
+
+
- (NSString *) activeSyncRepresentationInContext: (WOContext *) context
{
NSMutableString *s;
@@ -183,7 +206,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
}
else
{
- meetingStatus = 0; // appointment
+ meetingStatus = 0; // The event is an appointment, which has no attendees.
}
// This depends on the 'NEEDS-ACTION' parameter.
@@ -204,6 +227,12 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
[s appendFormat: @"%d", 1];
// BusyStatus -- http://msdn.microsoft.com/en-us/library/ee202290(v=exchg.80).aspx
+ [s appendFormat: @"%d", [self _busyStatus: attendee]];
+ }
+ else
+ {
+ // If it's a normal event (ie, with no organizer/attendee) or we are the organizer to an event
+ // invitation, we set the busy status to 2 (Busy)
[s appendFormat: @"%d", 2];
}