From 41ebf967316bb6f5dd1746be853b120493baf44a Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Fri, 29 Sep 2006 18:08:34 +0000 Subject: [PATCH] Monotone-Parent: 549cdd23ad59a0b412d59c2943fac5263a0f83af Monotone-Revision: fca9715aa0632958f50527cf33ba977fc0c06e85 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-09-29T18:08:34 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 6 ++++ SoObjects/SOGo/AgenorUserManager.h | 4 ++- SoObjects/SOGo/AgenorUserManager.m | 27 ++++++++++++---- UI/Scheduler/iCalPerson+UIx.h | 37 --------------------- UI/Scheduler/iCalPerson+UIx.m | 52 ------------------------------ 5 files changed, 29 insertions(+), 97 deletions(-) delete mode 100644 UI/Scheduler/iCalPerson+UIx.h delete mode 100644 UI/Scheduler/iCalPerson+UIx.m diff --git a/ChangeLog b/ChangeLog index fa1828353..5f26aa4a0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-09-29 Wolfgang Sourdeau + + * SoObjects/SOGo/AgenorUserManager.m ([AgenorUserManager + -iCalPersonWithUid:uid]): new method taken from removed module + 'iCalPerson+UIx'; + 2006-09-28 Wolfgang Sourdeau * UI/Scheduler/UIxAppointmentView.m ([UIxAppointmentView diff --git a/SoObjects/SOGo/AgenorUserManager.h b/SoObjects/SOGo/AgenorUserManager.h index 957349b00..c23fd460a 100644 --- a/SoObjects/SOGo/AgenorUserManager.h +++ b/SoObjects/SOGo/AgenorUserManager.h @@ -53,7 +53,9 @@ - (NSString *)getUIDForEmail:(NSString *)_email; - (NSString *)getEmailForUID:(NSString *)_uid; -- (NSString *)getUIDForICalPerson:(iCalPerson *)_person; +- (iCalPerson *) iCalPersonWithUid: (NSString *) uid; + +- (NSString *) getUIDForICalPerson: (iCalPerson *) _person; /* may insert NSNulls into returned array if _mapStrictly -> YES */ - (NSArray *)getUIDsForICalPersons:(NSArray *)_persons applyStrictMapping:(BOOL)_mapStrictly; diff --git a/SoObjects/SOGo/AgenorUserManager.m b/SoObjects/SOGo/AgenorUserManager.m index 1961e8656..99617edce 100644 --- a/SoObjects/SOGo/AgenorUserManager.m +++ b/SoObjects/SOGo/AgenorUserManager.m @@ -930,8 +930,8 @@ static unsigned PoolScanInterval = 5 * 60 /* every five minutes */; attributes:[self mailServerDiscoveryAttributes]]; while ((entry = [resultEnum nextObject]) != nil) { - NSString *server, *shareLogin, *emitterAddress; - id shareUid; + NSString *server, *shareLogin; + id shareUid, emitterAddress; /* calculate server connect string */ @@ -959,14 +959,15 @@ static unsigned PoolScanInterval = 5 * 60 /* every five minutes */; /* calculate emitter address (check for proper access right) */ - emitterAddress = ([self hasUser:_uid partageAccess:"GC" inEntry:entry] - ? [self emissionEMailFromEntry:entry] - : nil); + if ([self hasUser:_uid partageAccess:"GC" inEntry:entry]) + emitterAddress = [self emissionEMailFromEntry:entry]; + else + emitterAddress = [NSNull null]; /* set value */ - [shares setObject:(emitterAddress ? emitterAddress : (id)[NSNull null]) - forKey:shareLogin]; + [shares setObject: emitterAddress + forKey: shareLogin]; } /* cache */ @@ -1150,6 +1151,18 @@ static unsigned PoolScanInterval = 5 * 60 /* every five minutes */; return attr; } +- (iCalPerson *) iCalPersonWithUid: (NSString *) uid +{ + iCalPerson *person; + + person = [iCalPerson new]; + [person autorelease]; + [person setCn: [self getCNForUID: uid]]; + [person setEmail: [self getEmailForUID: uid]]; + + return person; +} + /* debugging */ - (BOOL)isDebuggingEnabled { diff --git a/UI/Scheduler/iCalPerson+UIx.h b/UI/Scheduler/iCalPerson+UIx.h deleted file mode 100644 index 10667cd70..000000000 --- a/UI/Scheduler/iCalPerson+UIx.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - Copyright (C) 2004 SKYRIX Software AG - - This file is part of OpenGroupware.org. - - OGo is free software; you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. - - OGo is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with OGo; see the file COPYING. If not, write to the - Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. -*/ -// $Id: UIxAppointmentEditor.m 181 2004-08-11 15:13:25Z helge $ - -#ifndef __iCalPerson_UIx_H__ -#define __iCalPerson_UIx_H__ - -#include - -@class NSString; - -@interface iCalPerson(Convenience) - -+ (iCalPerson *) personWithUid: (NSString *) uid; - -- (NSString *)cnForDisplay; -@end - -#endif /* __iCalPerson_UIx_H__ */ diff --git a/UI/Scheduler/iCalPerson+UIx.m b/UI/Scheduler/iCalPerson+UIx.m deleted file mode 100644 index e6cec5f22..000000000 --- a/UI/Scheduler/iCalPerson+UIx.m +++ /dev/null @@ -1,52 +0,0 @@ -/* - Copyright (C) 2004 SKYRIX Software AG - - This file is part of OpenGroupware.org. - - OGo is free software; you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. - - OGo is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with OGo; see the file COPYING. If not, write to the - Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. -*/ -// $Id: UIxAppointmentEditor.m 181 2004-08-11 15:13:25Z helge $ - -#import -#import "iCalPerson+UIx.h" -#import "common.h" - -@implementation iCalPerson (Convenience) - -+ (iCalPerson *) personWithUid: (NSString *) uid -{ - iCalPerson *person; - AgenorUserManager *um; - NSString *email, *cn; - - person = [self new]; - [person autorelease]; - - um = [AgenorUserManager sharedUserManager]; - email = [um getEmailForUID: uid]; - cn = [um getCNForUID: uid]; - [person setCn: cn]; - [person setEmail: email]; - - return person; -} - -- (NSString *) cnForDisplay -{ - return [self cnWithoutQuotes]; -} - -@end /* iCalPerson(Convenience) */