From 736d70f5ebf720fccff2ac05066ba5a7454877b1 Mon Sep 17 00:00:00 2001 From: znek Date: Mon, 13 Dec 2004 18:50:07 +0000 Subject: [PATCH] cleanup, bugfixes git-svn-id: http://svn.opengroupware.org/SOGo/trunk@475 d1b88da0-ebda-0310-925b-ed51d893ca5b --- .../Appointments/SOGoAppointmentFolder.h | 5 +++ .../Appointments/SOGoAppointmentFolder.m | 38 ++++++++++++------- .../Appointments/SOGoAppointmentObject.m | 9 +---- SOGo/SoObjects/Appointments/Version | 3 +- SOGo/SoObjects/ChangeLog | 6 +++ SOGo/UI/Scheduler/ChangeLog | 7 ++++ SOGo/UI/Scheduler/UIxAppointmentProposal.m | 1 - SOGo/UI/Scheduler/Version | 3 +- SOGo/UI/Scheduler/iCalPerson+UIx.h | 1 - SOGo/UI/Scheduler/iCalPerson+UIx.m | 26 +------------ SOGoLogic/ChangeLog | 3 ++ SOGoLogic/SOGoAppointment.m | 4 -- SOGoLogic/Version | 3 +- 13 files changed, 55 insertions(+), 54 deletions(-) diff --git a/SOGo/SoObjects/Appointments/SOGoAppointmentFolder.h b/SOGo/SoObjects/Appointments/SOGoAppointmentFolder.h index 51949c80..882018c0 100644 --- a/SOGo/SoObjects/Appointments/SOGoAppointmentFolder.h +++ b/SOGo/SoObjects/Appointments/SOGoAppointmentFolder.h @@ -49,6 +49,11 @@ /* fetching */ +- (NSArray *)fetchFields:(NSArray *)_fields + fromFolder:(OCSFolder *)_folder + from:(NSCalendarDate *)_startDate + to:(NSCalendarDate *)_endDate; + - (NSArray *)fetchCoreInfosFromFolder:(OCSFolder *)_folder from:(NSCalendarDate *)_startDate to:(NSCalendarDate *)_endDate; diff --git a/SOGo/SoObjects/Appointments/SOGoAppointmentFolder.m b/SOGo/SoObjects/Appointments/SOGoAppointmentFolder.m index 0ab3d8bd..ee44b286 100644 --- a/SOGo/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SOGo/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -173,7 +173,8 @@ static NSTimeZone *MET = nil; return ma; } -- (NSArray *)fetchCoreInfosFromFolder:(OCSFolder *)_folder +- (NSArray *)fetchFields:(NSArray *)_fields + fromFolder:(OCSFolder *)_folder from:(NSCalendarDate *)_startDate to:(NSCalendarDate *)_endDate { @@ -194,15 +195,8 @@ static NSTimeZone *MET = nil; (unsigned int)[_endDate timeIntervalSince1970], (unsigned int)[_startDate timeIntervalSince1970]]; qualifier = [EOQualifier qualifierWithQualifierFormat:sql]; - - fields = [NSArray arrayWithObjects: - @"uid", @"startdate", @"enddate", - @"title", @"participants", @"location", @"isallday", - @"iscycle", @"partmails", @"sequence", @"ispublic", - @"isopaque", @"status", @"orgmail", - nil]; - - records = [_folder fetchFields:fields matchingQualifier:qualifier]; + + records = [_folder fetchFields:_fields matchingQualifier:qualifier]; if (records == nil) { [self errorWithFormat:@"(%s): fetch failed!", __PRETTY_FUNCTION__]; return nil; @@ -214,6 +208,26 @@ static NSTimeZone *MET = nil; return records; } +- (NSArray *)fetchCoreInfosFromFolder:(OCSFolder *)_folder + from:(NSCalendarDate *)_startDate + to:(NSCalendarDate *)_endDate +{ + static NSArray *coreInfos = nil; + if(!coreInfos) { + coreInfos = [[NSArray arrayWithObjects:@"uid", @"startdate", @"enddate", + @"title", @"participants", + @"location", @"isallday", + @"iscycle", @"partmails", + @"sequence", @"ispublic", + @"isopaque", @"status", @"orgmail", + nil] retain]; + } + return [self fetchInfos:coreInfos + fromFolder:_folder + from:_startDate + to:_endDate]; +} + - (NSArray *)fetchCoreInfosFrom:(NSCalendarDate *)_startDate to:(NSCalendarDate *)_endDate { @@ -327,10 +341,8 @@ static NSTimeZone *MET = nil; NSString *uid; person = [_persons objectAtIndex:i]; - email = [person email]; + email = [person rfc822Email]; if ([email isNotNull]) { - if ([email hasPrefix:@"mailto:"]) - email = [email substringFromIndex:7]; uid = [um getUIDForEmail:email]; } else diff --git a/SOGo/SoObjects/Appointments/SOGoAppointmentObject.m b/SOGo/SoObjects/Appointments/SOGoAppointmentObject.m index 9da84603..70250582 100644 --- a/SOGo/SoObjects/Appointments/SOGoAppointmentObject.m +++ b/SOGo/SoObjects/Appointments/SOGoAppointmentObject.m @@ -59,12 +59,10 @@ /* add organizer */ - email = [[_apt organizer] email]; + email = [[_apt organizer] rfc822Email]; if ([email isNotNull]) { uid = [um getUIDForEmail:email]; if ([uid isNotNull]) { - if ([uid hasPrefix:@"mailto:"]) - uid = [uid substringFromIndex:7]; [uids addObject:uid]; } else @@ -77,7 +75,7 @@ iCalPerson *person; person = [attendees objectAtIndex:i]; - email = [person email]; + email = [person rfc822Email]; if (![email isNotNull]) continue; uid = [um getUIDForEmail:email]; @@ -85,9 +83,6 @@ [self logWithFormat:@"Note: got no uid for email: '%@'", email]; continue; } - if ([uid hasPrefix:@"mailto:"]) - uid = [uid substringFromIndex:7]; - if (![uids containsObject:uid]) [uids addObject:uid]; } diff --git a/SOGo/SoObjects/Appointments/Version b/SOGo/SoObjects/Appointments/Version index faf0dee1..8d72819a 100644 --- a/SOGo/SoObjects/Appointments/Version +++ b/SOGo/SoObjects/Appointments/Version @@ -1,5 +1,6 @@ # Version file -SUBMINOR_VERSION:=17 +SUBMINOR_VERSION:=19 +# v0.9.19 requires NGiCal v4.5.36 # v0.9.13 requires libSOGo v0.9.26 diff --git a/SOGo/SoObjects/ChangeLog b/SOGo/SoObjects/ChangeLog index 0fccfece..35b5f5d4 100644 --- a/SOGo/SoObjects/ChangeLog +++ b/SOGo/SoObjects/ChangeLog @@ -1,5 +1,11 @@ 2004-12-13 Marcus Mueller + * v0.9.19 + + * Appointments/SOGoAppointmentFolder.[hm]: new method to fetch generic + fields (better suited for freebusy), fixed some "mailto:" prefix + madness + * Appointments/SOGoAppointmentFolder.m: fixed bug in -uidsFromICalPersons: (v0.9.18) diff --git a/SOGo/UI/Scheduler/ChangeLog b/SOGo/UI/Scheduler/ChangeLog index b507aef1..3c601aaa 100644 --- a/SOGo/UI/Scheduler/ChangeLog +++ b/SOGo/UI/Scheduler/ChangeLog @@ -1,5 +1,12 @@ 2004-12-13 Marcus Mueller + * v0.9.101 + + * UIxAppointmentProposal.m: removed inclusion of iCalPerson+UIx.h + + * iCalPerson+UIx.[hm]: removed -rfc822EMail (moved to NGiCal), changed + implementation of -cnForDisplay (just a cover for -cnWithoutQuotes) + * v0.9.100 * UIxAppointmentEditor.m: fixed incorrect redirect location diff --git a/SOGo/UI/Scheduler/UIxAppointmentProposal.m b/SOGo/UI/Scheduler/UIxAppointmentProposal.m index fdeee2a6..b3a3a315 100644 --- a/SOGo/UI/Scheduler/UIxAppointmentProposal.m +++ b/SOGo/UI/Scheduler/UIxAppointmentProposal.m @@ -56,7 +56,6 @@ #include #include -#include "iCalPerson+UIx.h" #include "common.h" @implementation UIxAppointmentProposal diff --git a/SOGo/UI/Scheduler/Version b/SOGo/UI/Scheduler/Version index d202ae61..ca26afff 100644 --- a/SOGo/UI/Scheduler/Version +++ b/SOGo/UI/Scheduler/Version @@ -1,7 +1,8 @@ # $Id$ -SUBMINOR_VERSION:=100 +SUBMINOR_VERSION:=101 +# v0.9.101 requires NGiCal v4.5.36 # v0.9.100 requires SOGoUI v0.9.21 # v0.9.99 requires SOGoUI v0.9.20 # v0.9.98 requires SOGoUI v0.9.19 diff --git a/SOGo/UI/Scheduler/iCalPerson+UIx.h b/SOGo/UI/Scheduler/iCalPerson+UIx.h index 7417aa62..02658aaf 100644 --- a/SOGo/UI/Scheduler/iCalPerson+UIx.h +++ b/SOGo/UI/Scheduler/iCalPerson+UIx.h @@ -28,7 +28,6 @@ @class NSString; @interface iCalPerson(Convenience) -- (NSString *)rfc822Email; - (NSString *)cnForDisplay; @end diff --git a/SOGo/UI/Scheduler/iCalPerson+UIx.m b/SOGo/UI/Scheduler/iCalPerson+UIx.m index acdd759b..b923475e 100644 --- a/SOGo/UI/Scheduler/iCalPerson+UIx.m +++ b/SOGo/UI/Scheduler/iCalPerson+UIx.m @@ -25,32 +25,8 @@ @implementation iCalPerson(Convenience) -- (NSString *)rfc822Email { - NSString *_email; - NSRange colon; - - _email = [self email]; - colon = [_email rangeOfString:@":"]; - - if (colon.length > 0) - return [_email substringFromIndex:(colon.location + colon.length)]; - - return _email; -} - - (NSString *)cnForDisplay { - /* remove quotes around a CN */ - NSString *_cn; - - _cn = [self cn]; - if ([_cn length] <= 2) - return _cn; - if ([_cn characterAtIndex:0] != '"') - return _cn; - if (![_cn hasSuffix:@"\""]) - return _cn; - - return [_cn substringWithRange:NSMakeRange(1, [_cn length] - 2)]; + return [self cnWithoutQuotes]; } @end /* iCalPerson(Convenience) */ diff --git a/SOGoLogic/ChangeLog b/SOGoLogic/ChangeLog index 9c9b89b2..fa432734 100644 --- a/SOGoLogic/ChangeLog +++ b/SOGoLogic/ChangeLog @@ -1,5 +1,8 @@ 2004-12-13 Marcus Mueller + * SOGoAppointment.m: removed UIx_Privates declaration (no longer + necessary) (v0.9.31) + * SOGoUserManager.m: added comment regarding mapping uid <->mail (v0.9.30) diff --git a/SOGoLogic/SOGoAppointment.m b/SOGoLogic/SOGoAppointment.m index 5d25963b..06c7c116 100644 --- a/SOGoLogic/SOGoAppointment.m +++ b/SOGoLogic/SOGoAppointment.m @@ -27,10 +27,6 @@ #include "SOGoAppointmentICalRenderer.h" #include "common.h" -@interface iCalPerson(UIx_Privates) -- (NSString *)rfc822Email; -@end - @interface SOGoAppointment (PrivateAPI) - (NSArray *)_filteredAttendeesThinkingOfPersons:(BOOL)_persons; @end diff --git a/SOGoLogic/Version b/SOGoLogic/Version index 3a959fbe..6a99300f 100644 --- a/SOGoLogic/Version +++ b/SOGoLogic/Version @@ -1,7 +1,8 @@ # Version file -SUBMINOR_VERSION:=30 +SUBMINOR_VERSION:=31 +# v0.9.31 requires NGiCal v4.5.36 # v0.9.26 requires NGExtensions v4.5.136 # v0.9.23 requires NGiCal v4.3.32 # v0.9.18 requires NGExtensions v4.3.123 -- 2.39.5