mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-18 14:44:53 +00:00
(fix) avoid duplicating attendees when accepting event using a different identity over CalDAV
Conflicts: SoObjects/Appointments/iCalEntityObject+SOGo.h
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user