]> err.no Git - scalable-opengroupware.org/commitdiff
git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1063 d1b88da0-ebda-0310...
authorwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Fri, 11 May 2007 18:03:52 +0000 (18:03 +0000)
committerwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Fri, 11 May 2007 18:03:52 +0000 (18:03 +0000)
ChangeLog
SoObjects/Mailer/SOGoDraftObject.m
UI/Scheduler/English.lproj/Localizable.strings
UI/Scheduler/French.lproj/Localizable.strings

index 4f005d52262ab02501f0476f8167deba3e17d79a..6d86d528ae4788e968f7fb7b8b86b054ef1066e4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-05-11  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
+
+       * SoObjects/Mailer/SOGoDraftObject.m ([SOGoDraftObject -bodyPartForText]) 
+       ([SOGoDraftObject -mimeMessageForContentWithHeaderMap:]): use the
+       constant string "contentTypeValue".
+       contentTypeValue is now set back to iso-8859-1 since NGMime
+       converts extracts the data in that encoding.
+
 2007-05-10  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
 
        * SoObjects/SOGo/LDAPSource.m ([LDAPSource
index 2e913702799d47ae619354821c22f9b0c1acc8d9..c8791ed5b342b33c0f211db788414e9c406d1270 100644 (file)
 #include <NGExtensions/NSFileManager+Extensions.h>
 #include "common.h"
 
+static NSString *contentTypeValue = @"text/plain; charset=iso-8859-1";
+
 @interface NSString (NGMimeHelpers)
 
-- (NSString *) asQPSubjectString;
+- (NSString *) asQPSubjectString: (NSString *) encoding;
 
 @end
 
 @implementation NSString (NGMimeHelpers)
 
-- (NSString *) asQPSubjectString
+- (NSString *) asQPSubjectString: (NSString *) encoding;
 {
   NSString *qpString;
   unsigned char *data, *dest;
@@ -57,7 +59,7 @@
   dest = calloc(dataLen * 3, sizeof (unsigned char*));
   NGEncodeQuotedPrintableMime (data, dataLen, dest, destLen);
 
-  qpString = [NSString stringWithFormat: @"=?utf-8?Q?%s?=", dest];
+  qpString = [NSString stringWithFormat: @"=?%@?Q?%s?=", encoding, dest];
 
   free (data);
   free (dest);
@@ -107,9 +109,9 @@ static NSString    *fromInternetSuffixPattern = nil;
 }
 
 - (void)dealloc {
-  [self->envelope release];
-  [self->info release];
-  [self->path release];
+  [envelope release];
+  [info release];
+  [path release];
   [super dealloc];
 }
 
@@ -128,12 +130,12 @@ static NSString    *fromInternetSuffixPattern = nil;
 /* draft object functionality */
 
 - (NSString *)draftFolderPath {
-  if (self->path != nil)
-    return self->path;
+  if (path != nil)
+    return path;
   
-  self->path = [[[self userSpoolFolderPath] stringByAppendingPathComponent:
+  path = [[[self userSpoolFolderPath] stringByAppendingPathComponent:
                                              [self nameInContainer]] copy];
-  return self->path;
+  return path;
 }
 - (BOOL)_ensureDraftFolderPath {
   NSFileManager *fm;
@@ -173,15 +175,15 @@ static NSString    *fromInternetSuffixPattern = nil;
   }
   
   /* reset info cache */
-  [self->info release]; self->info = nil;
+  [info release]; info = nil;
   
   return nil /* everything is excellent */;
 }
 - (NSDictionary *)fetchInfo {
   NSString *p;
 
-  if (self->info != nil)
-    return self->info;
+  if (info != nil)
+    return info;
   
   p = [self infoPath];
   if (![[self spoolFileManager] fileExistsAtPath:p]) {
@@ -189,11 +191,11 @@ static NSString    *fromInternetSuffixPattern = nil;
     return nil;
   }
   
-  self->info = [[NSDictionary alloc] initWithContentsOfFile:p];
-  if (self->info == nil)
+  info = [[NSDictionary alloc] initWithContentsOfFile:p];
+  if (info == nil)
     [self errorWithFormat:@"draft info dictionary broken at path: %@", p];
   
-  return self->info;
+  return info;
 }
 
 /* accessors */
@@ -328,8 +330,9 @@ static NSString    *fromInternetSuffixPattern = nil;
   // TODO: set charset in header!
   [map setObject:@"text/plain" forKey:@"content-type"];
   if ((body = [lInfo objectForKey:@"text"]) != nil) {
-    if ([body isKindOfClass:[NSString class]]) {
-      [map setObject:@"text/plain; charset=utf-8" forKey:@"content-type"];
+    if ([body isKindOfClass: [NSString class]]) {
+      [map setObject: contentTypeValue
+          forKey: @"content-type"];
 //       body = [body dataUsingEncoding:NSUTF8StringEncoding];
     }
   }
@@ -369,7 +372,8 @@ static NSString    *fromInternetSuffixPattern = nil;
        body = [body stringByAppendingString:fromInternetSuffix];
       
       /* Note: just 'utf8' is displayed wrong in Mail.app */
-      [map setObject:@"text/plain; charset=utf-8" forKey:@"content-type"];
+      [map setObject: contentTypeValue
+          forKey: @"content-type"];
 //       body = [body dataUsingEncoding:NSUTF8StringEncoding];
     }
     else if ([body isKindOfClass:[NSData class]] && addSuffix) {
@@ -655,7 +659,9 @@ static NSString    *fromInternetSuffixPattern = nil;
   /* add subject */
   
   if ([(s = [lInfo objectForKey:@"subject"]) length] > 0)
-    [map setObject: [s asQPSubjectString] forKey:@"subject"];
+    [map setObject: [s asQPSubjectString: @"iso-8859-1"]
+        forKey:@"subject"];
+//     [map setObject: [s asQPSubjectString: @"utf-8"] forKey:@"subject"];
   
   /* add standard headers */
 
@@ -786,7 +792,8 @@ static NSString    *fromInternetSuffixPattern = nil;
     {
       rawSender = [startEmail substringFromIndex: NSMaxRange (delimiter)];
       delimiter = [rawSender rangeOfString: @">"];
-      rawSender = [rawSender substringToIndex: delimiter.location];
+      if (delimiter.location != NSNotFound)
+       rawSender = [rawSender substringToIndex: delimiter.location];
     }
 
   return rawSender;
@@ -1004,8 +1011,8 @@ static NSString    *fromInternetSuffixPattern = nil;
   NSDictionary *lInfo;
   id from, replyTo;
   
-  if (self->envelope != nil)
-    return self->envelope;
+  if (envelope != nil)
+    return envelope;
   if ((lInfo = [self fetchInfo]) == nil)
     return nil;
   
@@ -1017,14 +1024,14 @@ static NSString    *fromInternetSuffixPattern = nil;
       replyTo = [NSArray arrayWithObjects:&replyTo count:1];
   }
   
-  self->envelope = 
+  envelope = 
     [[NGImap4Envelope alloc] initWithMessageID:[self nameInContainer]
                             subject:[lInfo objectForKey:@"subject"]
                             from:from replyTo:replyTo
                             to:[lInfo objectForKey:@"to"]
                             cc:[lInfo objectForKey:@"cc"]
                             bcc:[lInfo objectForKey:@"bcc"]];
-  return self->envelope;
+  return envelope;
 }
 
 /* debugging */
index 62d233bf5c453b50bf2e93b92ffca1e47f672dcf..1a370a3f012c49d6c2a3a90363b2aa3b8d39ed88 100644 (file)
 "Appointment proposal" = "Appointment Proposal";
 "Appointment on" = "Appointment on";
 "Start:" = "Start:";
+"End:" = "End:";
 "Due Date:" = "Due Date:";
 "Title:" = "Title:";
 "Calendar:" = "Calendar:";
 "Organizer:" = "Organizer:";
 "Description:" = "Description:";
 "Document:" = "Document:";
-"Start:" = "Start:";
-"End:" = "End:";
 "Category:" = "Category:";
 "Repeat:" = "Repeat:";
 "Reminder:" = "Reminder:";
index 49515c1241e371f6bad2a1b3e938d6d47dc83041..266d9dfec0da2814091b6d51410db168d819fc05 100644 (file)
 "Appointment proposal" = "Proposition de rendez-vous";
 "Appointment on" = "Rendez-vous le";
 "Start:" = "Début :";
+"End:" = "Fin :";
 "Due Date:" = "Échéance :";
 "Title:" = "Titre :";
 "Calendar:" = "Agenda :";
 "Organizer:" = "Organisateur :";
 "Description:" = "Description :";
 "Document:" = "Document :";
-"Start:" = "Début :";
-"End:" = "Fin :";
 "Category:" = "Catégorie :";
 "Repeat:" = "Répéter :";
 "Reminder:" = "Rappel :";