Skip to content

Commit

Permalink
(fix) remove attendees that have the same identity of the organizer (…
Browse files Browse the repository at this point in the history
…fixes #3905)
  • Loading branch information
extrafu committed Mar 7, 2017
1 parent 270ff1b commit 6a963bf
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions SoObjects/Appointments/SOGoAppointmentObject.m
Expand Up @@ -1817,7 +1817,7 @@ - (void) _adjustEventsInRequestCalendar: (iCalCalendar *) rqCalendar
{
NSArray *allEvents;
iCalEvent *event;
NSUInteger i;
NSUInteger i, j;

allEvents = [rqCalendar events];

Expand Down Expand Up @@ -1850,12 +1850,27 @@ - (void) _adjustEventsInRequestCalendar: (iCalCalendar *) rqCalendar
if (uid)
{
NSDictionary *defaultIdentity;
NSArray *allAttendees;
iCalPerson *attendee;
SOGoUser *organizer;


organizer = [SOGoUser userWithLogin: uid];
defaultIdentity = [organizer defaultIdentity];
[[event organizer] setCn: [defaultIdentity objectForKey: @"fullName"]];
[[event organizer] setEmail: [defaultIdentity objectForKey: @"email"]];

// We now check if one of the attendee is also the organizer. If so,
// we remove it. See bug #3905 (https://sogo.nu/bugs/view.php?id=3905)
// for more details. This is a Calendar app bug on Apple Yosemite.
allAttendees = [event attendees];

for (j = [allAttendees count]-1; j >= 0; j--)
{
attendee = [allAttendees objectAtIndex: j];
if ([organizer hasEmail: [attendee rfc822Email]])
[event removeFromAttendees: attendee];
}
}
}
}
Expand Down Expand Up @@ -2040,9 +2055,7 @@ - (NSException *) updateContentWithCalendar: (iCalCalendar *) calendar
[self _decomposeGroupsInRequestCalendar: calendar];

if ([[ownerUser domainDefaults] iPhoneForceAllDayTransparency] && [rq isIPhone])
{
[self _adjustTransparencyInRequestCalendar: calendar];
}
[self _adjustTransparencyInRequestCalendar: calendar];

[self _adjustEventsInRequestCalendar: calendar];
[self adjustClassificationInRequestCalendar: calendar];
Expand Down

0 comments on commit 6a963bf

Please sign in to comment.