From be780e3950290c7b800804ff837b2d698d61a37c Mon Sep 17 00:00:00 2001 From: helge Date: Wed, 6 Oct 2004 13:16:42 +0000 Subject: [PATCH] added 0530 git-svn-id: http://svn.opengroupware.org/SOPE/trunk@225 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- sope-mime/ChangeLog | 4 ++ sope-mime/NGMime/ChangeLog | 5 ++ .../NGMimeRFC822DateHeaderFieldParser.m | 68 +++++++++++-------- sope-mime/Version | 2 +- 4 files changed, 49 insertions(+), 30 deletions(-) diff --git a/sope-mime/ChangeLog b/sope-mime/ChangeLog index eb66ddc0..e1a7cc3b 100644 --- a/sope-mime/ChangeLog +++ b/sope-mime/ChangeLog @@ -1,3 +1,7 @@ +2004-10-06 Helge Hess + + * NGMime: added special case for +0530 timezone (v4.3.188) + 2004-10-02 Helge Hess * v4.3.187 diff --git a/sope-mime/NGMime/ChangeLog b/sope-mime/NGMime/ChangeLog index a3831bd1..5039b3d2 100644 --- a/sope-mime/NGMime/ChangeLog +++ b/sope-mime/NGMime/ChangeLog @@ -1,3 +1,8 @@ +2004-10-06 Helge Hess + + * NGMimeRFC822DateHeaderFieldParser.m: added special case for +0530 + timezone which seems to be common (v4.3.188) + 2004-10-04 Marcus Mueller * NGMime.xcode: added new files to Xcode build diff --git a/sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m b/sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m index 75bfccb8..f4523d03 100644 --- a/sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m +++ b/sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m @@ -40,6 +40,7 @@ static NSTimeZone *gmt09 = nil; static NSTimeZone *gmt10 = nil; static NSTimeZone *gmt11 = nil; static NSTimeZone *gmt12 = nil; +static NSTimeZone *gmt0530 = nil; static NSTimeZone *gmtM01 = nil; static NSTimeZone *gmtM02 = nil; static NSTimeZone *gmtM03 = nil; @@ -61,40 +62,44 @@ static NSTimeZone *met = nil; } + (void)initialize { static BOOL didInit = NO; + Class TzClass; if (didInit) return; didInit = YES; CalDateClass = [NSCalendarDate class]; - + /* timezones which were actually used in a maillist mailbox */ - gmt = [[NSTimeZone timeZoneWithName:@"GMT"] retain]; - met = [[NSTimeZone timeZoneWithName:@"MET"] retain]; - gmt01 = [[NSTimeZone timeZoneForSecondsFromGMT: 1 * (60 * 60)] retain]; - gmt02 = [[NSTimeZone timeZoneForSecondsFromGMT: 2 * (60 * 60)] retain]; - gmt03 = [[NSTimeZone timeZoneForSecondsFromGMT: 3 * (60 * 60)] retain]; - gmt04 = [[NSTimeZone timeZoneForSecondsFromGMT: 4 * (60 * 60)] retain]; - gmt05 = [[NSTimeZone timeZoneForSecondsFromGMT: 5 * (60 * 60)] retain]; - gmt06 = [[NSTimeZone timeZoneForSecondsFromGMT: 6 * (60 * 60)] retain]; - gmt07 = [[NSTimeZone timeZoneForSecondsFromGMT: 7 * (60 * 60)] retain]; - gmt08 = [[NSTimeZone timeZoneForSecondsFromGMT: 8 * (60 * 60)] retain]; - gmt09 = [[NSTimeZone timeZoneForSecondsFromGMT: 9 * (60 * 60)] retain]; - gmt10 = [[NSTimeZone timeZoneForSecondsFromGMT: 10 * (60 * 60)] retain]; - gmt11 = [[NSTimeZone timeZoneForSecondsFromGMT: 11 * (60 * 60)] retain]; - gmt12 = [[NSTimeZone timeZoneForSecondsFromGMT: 12 * (60 * 60)] retain]; - gmtM01 = [[NSTimeZone timeZoneForSecondsFromGMT: -1 * (60 * 60)] retain]; - gmtM02 = [[NSTimeZone timeZoneForSecondsFromGMT: -2 * (60 * 60)] retain]; - gmtM03 = [[NSTimeZone timeZoneForSecondsFromGMT: -3 * (60 * 60)] retain]; - gmtM04 = [[NSTimeZone timeZoneForSecondsFromGMT: -4 * (60 * 60)] retain]; - gmtM05 = [[NSTimeZone timeZoneForSecondsFromGMT: -5 * (60 * 60)] retain]; - gmtM06 = [[NSTimeZone timeZoneForSecondsFromGMT: -6 * (60 * 60)] retain]; - gmtM07 = [[NSTimeZone timeZoneForSecondsFromGMT: -7 * (60 * 60)] retain]; - gmtM08 = [[NSTimeZone timeZoneForSecondsFromGMT: -8 * (60 * 60)] retain]; - gmtM09 = [[NSTimeZone timeZoneForSecondsFromGMT: -9 * (60 * 60)] retain]; - gmtM10 = [[NSTimeZone timeZoneForSecondsFromGMT:-10 * (60 * 60)] retain]; - gmtM11 = [[NSTimeZone timeZoneForSecondsFromGMT:-11 * (60 * 60)] retain]; - gmtM12 = [[NSTimeZone timeZoneForSecondsFromGMT:-12 * (60 * 60)] retain]; - gmtM13 = [[NSTimeZone timeZoneForSecondsFromGMT:-13 * (60 * 60)] retain]; - gmtM14 = [[NSTimeZone timeZoneForSecondsFromGMT:-14 * (60 * 60)] retain]; + TzClass = [NSTimeZone class]; + gmt = [[TzClass timeZoneWithName:@"GMT"] retain]; + met = [[TzClass timeZoneWithName:@"MET"] retain]; + gmt01 = [[TzClass timeZoneForSecondsFromGMT: 1 * (60 * 60)] retain]; + gmt02 = [[TzClass timeZoneForSecondsFromGMT: 2 * (60 * 60)] retain]; + gmt03 = [[TzClass timeZoneForSecondsFromGMT: 3 * (60 * 60)] retain]; + gmt04 = [[TzClass timeZoneForSecondsFromGMT: 4 * (60 * 60)] retain]; + gmt05 = [[TzClass timeZoneForSecondsFromGMT: 5 * (60 * 60)] retain]; + gmt06 = [[TzClass timeZoneForSecondsFromGMT: 6 * (60 * 60)] retain]; + gmt07 = [[TzClass timeZoneForSecondsFromGMT: 7 * (60 * 60)] retain]; + gmt08 = [[TzClass timeZoneForSecondsFromGMT: 8 * (60 * 60)] retain]; + gmt09 = [[TzClass timeZoneForSecondsFromGMT: 9 * (60 * 60)] retain]; + gmt10 = [[TzClass timeZoneForSecondsFromGMT: 10 * (60 * 60)] retain]; + gmt11 = [[TzClass timeZoneForSecondsFromGMT: 11 * (60 * 60)] retain]; + gmt12 = [[TzClass timeZoneForSecondsFromGMT: 12 * (60 * 60)] retain]; + gmtM01 = [[TzClass timeZoneForSecondsFromGMT: -1 * (60 * 60)] retain]; + gmtM02 = [[TzClass timeZoneForSecondsFromGMT: -2 * (60 * 60)] retain]; + gmtM03 = [[TzClass timeZoneForSecondsFromGMT: -3 * (60 * 60)] retain]; + gmtM04 = [[TzClass timeZoneForSecondsFromGMT: -4 * (60 * 60)] retain]; + gmtM05 = [[TzClass timeZoneForSecondsFromGMT: -5 * (60 * 60)] retain]; + gmtM06 = [[TzClass timeZoneForSecondsFromGMT: -6 * (60 * 60)] retain]; + gmtM07 = [[TzClass timeZoneForSecondsFromGMT: -7 * (60 * 60)] retain]; + gmtM08 = [[TzClass timeZoneForSecondsFromGMT: -8 * (60 * 60)] retain]; + gmtM09 = [[TzClass timeZoneForSecondsFromGMT: -9 * (60 * 60)] retain]; + gmtM10 = [[TzClass timeZoneForSecondsFromGMT:-10 * (60 * 60)] retain]; + gmtM11 = [[TzClass timeZoneForSecondsFromGMT:-11 * (60 * 60)] retain]; + gmtM12 = [[TzClass timeZoneForSecondsFromGMT:-12 * (60 * 60)] retain]; + gmtM13 = [[TzClass timeZoneForSecondsFromGMT:-13 * (60 * 60)] retain]; + gmtM14 = [[TzClass timeZoneForSecondsFromGMT:-14 * (60 * 60)] retain]; + + gmt0530 = [[TzClass timeZoneForSecondsFromGMT:5 * (60*60) + (30*60)] retain]; } /* @@ -145,6 +150,7 @@ static NSTimeZone *parseTimeZone(unsigned char *s, unsigned int len) { /* WARNING: failed to parse RFC822 timezone: '+0530' \ (value='Tue, 13 Jul 2004 21:39:28 +0530') + TODO: this is because libFoundation doesn't accept 'GMT+0530' as input. */ unsigned char *p = s; NSTimeZone *tz; @@ -206,6 +212,10 @@ static NSTimeZone *parseTimeZone(unsigned char *s, unsigned int len) { if (p[2] == '4') return gmtM14; // '-1400' } } + + /* special case for GMT+0530 */ + if (strncmp(s, "+0530", 5) == 0) + return gmt0530; } else if (len == 7) { /* diff --git a/sope-mime/Version b/sope-mime/Version index b223b20b..b32a6bb3 100644 --- a/sope-mime/Version +++ b/sope-mime/Version @@ -2,6 +2,6 @@ MAJOR_VERSION:=4 MINOR_VERSION:=3 -SUBMINOR_VERSION:=187 +SUBMINOR_VERSION:=188 # v4.2.149 requires libNGStreams v4.2.34 -- 2.39.5