diff --git a/ChangeLog b/ChangeLog index 883aa3377..f3a0e7f04 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2007-11-22 Wolfgang Sourdeau + + * UI/MailPartViewers/UIxMailRenderingContext.m + ([UIxMailRenderingContext -viewerForBodyInfo:_info]): same as below. + + * SoObjects/Mailer/SOGoMailObject.m ([SOGoMailObject + -plainTextContentFetchKeys]): same as below. + + * SoObjects/Mailer/SOGoMailBodyPart.m ([SOGoMailBodyPart + +bodyPartClassForMimeType:mimeTypeinContext:_ctx]): accept the + application/ics type from Google Calendar. + + * SoObjects/SOGo/NSCalendarDate+SOGo.m ([NSCalendarDate + +distantFuture]): rewrote method to return an object that is + compatible with NSCalendarDate, unlike the implementation in + GNUstep. + ([NSCalendarDate +distantPast]): same as above. + 2007-11-21 Wolfgang Sourdeau * UI/MailPartViewers/UIxMailPartHTMLViewer.m: fixed infinite loop diff --git a/SOPE/NGCards/ChangeLog b/SOPE/NGCards/ChangeLog index 55ec998f4..75c6d547e 100644 --- a/SOPE/NGCards/ChangeLog +++ b/SOPE/NGCards/ChangeLog @@ -1,3 +1,8 @@ +2007-11-22 Wolfgang Sourdeau + + * iCalEntityObject.m ([iCalEntityObject -compare:otherObject]): + safely compare between objects which may be nil. + 2007-11-18 Wolfgang Sourdeau * iCalPerson.m ([-rsvp]): return lowercase string. diff --git a/SOPE/NGCards/iCalEntityObject.m b/SOPE/NGCards/iCalEntityObject.m index 53a51c1f6..45ac1f90c 100644 --- a/SOPE/NGCards/iCalEntityObject.m +++ b/SOPE/NGCards/iCalEntityObject.m @@ -425,13 +425,38 @@ return nil; /* not found */ } +- (NSComparisonResult) _compareValue: (id) selfValue + withValue: (id) otherValue +{ + NSComparisonResult result; + + if (selfValue) + { + if (otherValue) + result = [selfValue compare: otherValue]; + else + result = NSOrderedDescending; + } + else + { + if (otherValue) + result = NSOrderedAscending; + else + result = NSOrderedSame; + } + + return result; +} + - (NSComparisonResult) _compareVersions: (iCalEntityObject *) otherObject { NSComparisonResult result; - result = [[self sequence] compare: [otherObject sequence]]; + result = [self _compareValue: [self sequence] + withValue: [otherObject sequence]]; if (result == NSOrderedSame) - result = [[self lastModified] compare: [otherObject lastModified]]; + result = [self _compareValue: [self lastModified] + withValue: [otherObject lastModified]]; return result; } diff --git a/SoObjects/Mailer/SOGoMailBodyPart.m b/SoObjects/Mailer/SOGoMailBodyPart.m index fd4ebf41d..c3bcf78db 100644 --- a/SoObjects/Mailer/SOGoMailBodyPart.m +++ b/SoObjects/Mailer/SOGoMailBodyPart.m @@ -360,7 +360,8 @@ static BOOL debugOn = NO; || [mimeType isEqualToString: @"image/jpg"] || [mimeType isEqualToString: @"image/jpeg"]) classString = @"SOGoImageMailBodyPart"; - else if ([mimeType isEqualToString: @"text/calendar"]) + else if ([mimeType isEqualToString: @"text/calendar"] + || [mimeType isEqualToString: @"application/ics"]) classString = @"SOGoCalendarMailBodyPart"; else if ([mimeType isEqualToString: @"text/x-vcard"]) classString = @"SOGoVCardMailBodyPart"; diff --git a/SoObjects/Mailer/SOGoMailObject.m b/SoObjects/Mailer/SOGoMailObject.m index 086bdfb44..f59ab0f0f 100644 --- a/SoObjects/Mailer/SOGoMailObject.m +++ b/SoObjects/Mailer/SOGoMailObject.m @@ -585,7 +585,8 @@ static BOOL debugSoParts = NO; NSArray *types; types = [NSArray arrayWithObjects: @"text/plain", @"text/html", - @"text/calendar", @"application/pgp-signature", nil]; + @"text/calendar", @"application/ics", + @"application/pgp-signature", nil]; ma = [NSMutableArray arrayWithCapacity: 4]; [self addRequiredKeysOfStructure: [self bodyStructure] path: @"" toArray: ma acceptedTypes: types]; diff --git a/SoObjects/SOGo/NSCalendarDate+SOGo.h b/SoObjects/SOGo/NSCalendarDate+SOGo.h index ca6d710d3..61ad14f1d 100644 --- a/SoObjects/SOGo/NSCalendarDate+SOGo.h +++ b/SoObjects/SOGo/NSCalendarDate+SOGo.h @@ -41,6 +41,9 @@ - (NSString *) rfc822DateString; ++ (id) distantFuture; ++ (id) distantPast; + @end #endif /* NSCALENDARDATE_SCHEDULER_H */ diff --git a/SoObjects/SOGo/NSCalendarDate+SOGo.m b/SoObjects/SOGo/NSCalendarDate+SOGo.m index c3cd24921..1084f066a 100644 --- a/SoObjects/SOGo/NSCalendarDate+SOGo.m +++ b/SoObjects/SOGo/NSCalendarDate+SOGo.m @@ -136,4 +136,29 @@ static NSString *rfc822Months[] = {@"", @"Jan", @"Feb", @"Mar", @"Apr", timeZoneShift]; } +#define secondsOfDistantFuture 63113990400.0 +#define secondsOfDistantPast -63113817600.0 + ++ (id) distantFuture +{ + static NSCalendarDate *date = nil; + + if (!date) + date + = [[self alloc] initWithTimeIntervalSinceReferenceDate: secondsOfDistantFuture]; + + return date; +} + ++ (id) distantPast +{ + static NSCalendarDate *date = nil; + + if (!date) + date + = [[self alloc] initWithTimeIntervalSinceReferenceDate: secondsOfDistantPast]; + + return date; +} + @end diff --git a/UI/MailPartViewers/English.lproj/Localizable.strings b/UI/MailPartViewers/English.lproj/Localizable.strings index 78f7a101c..c87e44c60 100644 --- a/UI/MailPartViewers/English.lproj/Localizable.strings +++ b/UI/MailPartViewers/English.lproj/Localizable.strings @@ -13,7 +13,7 @@ cancel_info_text = "Your invitation or the whole event was canceled."; request_info_no_attendee = "is proposing a meeting to the attendees. You receive this mail as a notification, you are not scheduled as a participant."; Appointment = "Appointment"; -Organizer = "Organisateur"; +Organizer = "Organizer"; Time = "Time"; Attendees = "Attendees"; request_info = "invites you to participate in a meeting."; diff --git a/UI/MailPartViewers/UIxMailRenderingContext.m b/UI/MailPartViewers/UIxMailRenderingContext.m index 74494f4d2..a82097f65 100644 --- a/UI/MailPartViewers/UIxMailRenderingContext.m +++ b/UI/MailPartViewers/UIxMailRenderingContext.m @@ -265,22 +265,22 @@ static BOOL showNamedTextAttachmentsInline = NO; else if ([st isEqualToString:@"alternative"]) return [self alternativeViewer]; - if ([st isEqualToString:@"report"]) - /* this is used by mail-delivery reports */ - return [self mixedViewer]; + if ([st isEqualToString:@"report"]) + /* this is used by mail-delivery reports */ + return [self mixedViewer]; } else if ([mt isEqualToString:@"text"]) { - if ([st isEqualToString:@"plain"] || [st isEqualToString:@"html"]) { - if (!showNamedTextAttachmentsInline && [self _shouldDisplayAsAttachment: _info]) - return [self linkViewer]; + if ([st isEqualToString:@"plain"] || [st isEqualToString:@"html"]) { + if (!showNamedTextAttachmentsInline && [self _shouldDisplayAsAttachment: _info]) + return [self linkViewer]; - return [st isEqualToString:@"html"] - ? [self htmlViewer] : [self textViewer]; - } + return [st isEqualToString:@"html"] + ? [self htmlViewer] : [self textViewer]; + } - if ([st isEqualToString:@"calendar"]) - return [self iCalViewer]; + if ([st isEqualToString:@"calendar"]) + return [self iCalViewer]; } if ([mt isEqualToString:@"image"]) @@ -307,7 +307,7 @@ static BOOL showNamedTextAttachmentsInline = NO; Action: failed Status: 5.0.0 Diagnostic-Code: X-Postfix; host plop.com[64.39.31.55] said: 550 5.7.1 - ... Relaying denied + ... Relaying denied */ // Note: we cannot use the text viewer because the body is not pre-fetched return [self linkViewer]; @@ -317,28 +317,30 @@ static BOOL showNamedTextAttachmentsInline = NO; { // octet-stream (generate download link?, autodetect type?) - if ([st hasPrefix:@"x-vnd.kolab."]) - { - if ([st isEqualToString:@"x-vnd.kolab.contact"]) - return [self kolabContactViewer]; - if ([st isEqualToString:@"x-vnd.kolab.event"]) - return [self kolabEventViewer]; - if ([st isEqualToString:@"x-vnd.kolab.task"]) - return [self kolabTodoViewer]; - if ([st isEqualToString:@"x-vnd.kolab.note"]) - return [self kolabNoteViewer]; - if ([st isEqualToString:@"x-vnd.kolab.journal"]) - return [self kolabJournalViewer]; - if ([st isEqualToString:@"x-vnd.kolab.contact.distlist"]) - return [self kolabDistributionListViewer]; + if ([st hasPrefix:@"x-vnd.kolab."]) + { + if ([st isEqualToString:@"x-vnd.kolab.contact"]) + return [self kolabContactViewer]; + if ([st isEqualToString:@"x-vnd.kolab.event"]) + return [self kolabEventViewer]; + if ([st isEqualToString:@"x-vnd.kolab.task"]) + return [self kolabTodoViewer]; + if ([st isEqualToString:@"x-vnd.kolab.note"]) + return [self kolabNoteViewer]; + if ([st isEqualToString:@"x-vnd.kolab.journal"]) + return [self kolabJournalViewer]; + if ([st isEqualToString:@"x-vnd.kolab.contact.distlist"]) + return [self kolabDistributionListViewer]; - [self errorWithFormat:@"found no viewer for Kolab type: %@/%@", mt, st]; - return [self linkViewer]; - } - + [self errorWithFormat:@"found no viewer for Kolab type: %@/%@", mt, st]; + return [self linkViewer]; + } + else if ([st isEqualToString:@"ics"]) /* Cooqle K4lendahr - Google Calendar */ + return [self iCalViewer]; + #if 0 /* the link viewer looks better than plain text ;-) */ - if ([st isEqualToString:@"pgp-signature"]) // TODO: real PGP viewer - return [self textViewer]; + if ([st isEqualToString:@"pgp-signature"]) // TODO: real PGP viewer + return [self textViewer]; #endif }