(fix) avoid duplicating attendees when accepting event using a different identity over CalDAV

Conflicts:

	SoObjects/Appointments/iCalEntityObject+SOGo.h
This commit is contained in:
Ludovic Marcotte
2015-12-15 11:12:59 -05:00
parent 544cb85e4d
commit cfb741fc9f
4 changed files with 60 additions and 4 deletions
+29 -1
View File
@@ -422,8 +422,8 @@ NSNumber *iCalDistantFutureNumber = nil;
- (iCalPerson *) userAsAttendee: (SOGoUser *) user
{
NSEnumerator *attendees;
iCalPerson *currentAttendee, *userAttendee;
NSEnumerator *attendees;
userAttendee = nil;
@@ -436,6 +436,34 @@ NSNumber *iCalDistantFutureNumber = nil;
return userAttendee;
}
- (NSString *) participationStatusForUser: (SOGoUser *) theUser
attendee: (iCalPerson *) theAttendee
{
iCalPerson *currentAttendee;
NSEnumerator *attendees;
NSMutableArray *a;
a = [NSMutableArray array];
attendees = [[self attendees] objectEnumerator];
while ((currentAttendee = [attendees nextObject]))
if ([theUser hasEmail: [currentAttendee rfc822Email]])
{
// If the attendee is the same but the partStat is
// different, we prioritize this one.
if ([[currentAttendee rfc822Email] caseInsensitiveCompare: [theAttendee rfc822Email]] == NSOrderedSame &&
[[currentAttendee partStat] caseInsensitiveCompare: [theAttendee partStat]] != NSOrderedSame)
[a insertObject: currentAttendee atIndex: 0];
else if ([[currentAttendee rfc822Email] caseInsensitiveCompare: [theAttendee rfc822Email]] != NSOrderedSame)
[a addObject: currentAttendee];
}
if ([a count] > 0)
return [[a objectAtIndex: 0] partStat];
return [theAttendee partStat];
}
- (BOOL) userIsOrganizer: (SOGoUser *) user
{
NSString *mail;