mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-09-24 22:50:31 +00:00
Removed tight coupling of group membership expansion and LDAPSource.
Any implementation of SOGoSource may now support group expansion by implementing the protocol MembershipAwareSource.
This commit is contained in:
@@ -46,7 +46,7 @@
|
||||
#import <SOGo/NSString+Utilities.h>
|
||||
#import <SOGo/SOGoBuild.h>
|
||||
#import <SOGo/SOGoMailer.h>
|
||||
#import <SOGo/SOGoGroup.h>
|
||||
#import <SOGo/SOGoSource.h>
|
||||
#import <SOGo/SOGoPermissions.h>
|
||||
#import <SOGo/SOGoUser.h>
|
||||
#import <SOGo/SOGoUserSettings.h>
|
||||
@@ -525,7 +525,7 @@
|
||||
iCalPerson *currentAttendee;
|
||||
NSEnumerator *enumerator;
|
||||
NSAutoreleasePool *pool;
|
||||
SOGoGroup *group;
|
||||
NSDictionary *dict;
|
||||
|
||||
BOOL eventWasModified;
|
||||
unsigned int i, j;
|
||||
@@ -549,37 +549,42 @@
|
||||
pool = [[NSAutoreleasePool alloc] init];
|
||||
}
|
||||
|
||||
group = [SOGoGroup groupWithEmail: [currentAttendee rfc822Email]
|
||||
inDomain: domain];
|
||||
if (group)
|
||||
{
|
||||
dict = [[SOGoUserManager sharedUserManager] contactInfosForUserWithUIDorEmail: [currentAttendee rfc822Email]];
|
||||
|
||||
if (dict && [[dict objectForKey: @"isGroup"] boolValue])
|
||||
{
|
||||
iCalPerson *person;
|
||||
NSArray *members;
|
||||
SOGoUser *user;
|
||||
id <SOGoSource> source;
|
||||
|
||||
// We did decompose a group...
|
||||
[allAttendees removeObject: currentAttendee];
|
||||
|
||||
members = [group members];
|
||||
for (i = 0; i < [members count]; i++)
|
||||
{
|
||||
user = [members objectAtIndex: i];
|
||||
eventWasModified = YES;
|
||||
source = [[SOGoUserManager sharedUserManager] sourceWithID: [dict objectForKey: @"SOGoSource"]];
|
||||
if ([source conformsToProtocol:@protocol(MembershipAwareSource)])
|
||||
{
|
||||
members = [(id<MembershipAwareSource>)(source) membersForGroupWithUID: [dict objectForKey: @"c_uid"]];
|
||||
for (i = 0; i < [members count]; i++)
|
||||
{
|
||||
user = [members objectAtIndex: i];
|
||||
eventWasModified = YES;
|
||||
|
||||
// If the organizer is part of the group, we skip it from
|
||||
// the addition to the attendees' list
|
||||
if ([user hasEmail: organizerEmail])
|
||||
continue;
|
||||
|
||||
person = [self iCalPersonWithUID: [user login]];
|
||||
[person setTag: @"ATTENDEE"];
|
||||
[person setParticipationStatus: [currentAttendee participationStatus]];
|
||||
[person setRsvp: [currentAttendee rsvp]];
|
||||
[person setRole: [currentAttendee role]];
|
||||
|
||||
if (![allAttendees containsObject: person])
|
||||
[allAttendees addObject: person];
|
||||
}
|
||||
// If the organizer is part of the group, we skip it from
|
||||
// the addition to the attendees' list
|
||||
if ([user hasEmail: organizerEmail])
|
||||
continue;
|
||||
|
||||
person = [self iCalPersonWithUID: [user login]];
|
||||
[person setTag: @"ATTENDEE"];
|
||||
[person setParticipationStatus: [currentAttendee participationStatus]];
|
||||
[person setRsvp: [currentAttendee rsvp]];
|
||||
[person setRole: [currentAttendee role]];
|
||||
|
||||
if (![allAttendees containsObject: person])
|
||||
[allAttendees addObject: person];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
j++;
|
||||
|
||||
Reference in New Issue
Block a user