From 26e2ab38de3573c4fe52f7c26de4a5395e0bfead Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Sun, 28 Sep 2008 14:02:40 +0000 Subject: [PATCH] See ChangeLog Monotone-Parent: e0268121f41f4a9ac6226ffcf9e54efb36a9d2d3 Monotone-Revision: 5ca46341daec14901e918e991004a22b7ada9f49 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2008-09-28T14:02:40 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 20 + SOPE/sope-patchset-r1626.diff | 761 ++++++++++-------- SoObjects/Mailer/SOGoDraftObject.m | 31 +- UI/MailerUI/Dutch.lproj/Localizable.strings | 6 + UI/MailerUI/English.lproj/Localizable.strings | 7 +- UI/MailerUI/French.lproj/Localizable.strings | 6 + UI/MailerUI/German.lproj/Localizable.strings | 6 + UI/MailerUI/Italian.lproj/Localizable.strings | 6 + UI/MailerUI/Spanish.lproj/Localizable.strings | 6 + UI/MailerUI/Toolbars/SOGoDraftObject.toolbar | 5 + UI/MailerUI/UIxMailEditor.m | 58 +- UI/MailerUI/UIxMailListView.m | 55 +- UI/Templates/MailerUI/UIxMailEditor.wox | 12 + UI/Templates/MailerUI/UIxMailListView.wox | 10 +- UI/WebServerResources/UIxMailEditor.js | 51 ++ 15 files changed, 700 insertions(+), 340 deletions(-) diff --git a/ChangeLog b/ChangeLog index bad1e6e9f..1fff3ae3f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +2008-09-28 Ludovic Marcotte + + * Modified the following files: + SoObjects/Mailer/SOGoDraftObject.m + UI/MailerUI/Dutch.lproj/Localizable.strings + UI/MailerUI/English.lproj/Localizable.strings + UI/MailerUI/French.lproj/Localizable.strings + UI/MailerUI/German.lproj/Localizable.strings + UI/MailerUI/Italian.lproj/Localizable.strings + UI/MailerUI/Spanish.lproj/Localizable.strings + UI/MailerUI/Toolbars/SOGoDraftObject.toolbar + UI/MailerUI/UIxMailEditor.m + UI/MailerUI/UIxMailListView.m + UI/Templates/MailerUI/UIxMailEditor.wox + UI/Templates/MailerUI/UIxMailListView.wox + UI/WebServerResources/UIxMailEditor.js + in order to add support for X-Priority in emails. + * Regenerated the sope-patchset in order to add + capabilities to parse BODY[HEADER.FIELDS ...] responses. + 2008-09-26 Wolfgang Sourdeau * SoObjects/SOGo/SOGoLDAPUserDefaults.m ([SOGoLDAPUserDefaults diff --git a/SOPE/sope-patchset-r1626.diff b/SOPE/sope-patchset-r1626.diff index 7ec2213b6..69b3d9065 100644 --- a/SOPE/sope-patchset-r1626.diff +++ b/SOPE/sope-patchset-r1626.diff @@ -1,194 +1,7 @@ -Index: sope-gdl1/PostgreSQL/PostgreSQL72Channel.m -=================================================================== ---- sope-gdl1/PostgreSQL/PostgreSQL72Channel.m (révision 1626) -+++ sope-gdl1/PostgreSQL/PostgreSQL72Channel.m (copie de travail) -@@ -713,6 +713,39 @@ - return ms; - } - -+/* GCSEOAdaptorChannel protocol */ -+static NSString *sqlFolderFormat = (@"CREATE TABLE %@ (\n" \ -+ @" c_name VARCHAR (256) NOT NULL PRIMARY KEY,\n" -+ @" c_content VARCHAR (100000) NOT NULL,\n" -+ @" c_creationdate INT4 NOT NULL,\n" -+ @" c_lastmodified INT4 NOT NULL,\n" -+ @" c_version INT4 NOT NULL,\n" -+ @" c_deleted INT4 NULL\n" -+ @")"); -+static NSString *sqlFolderACLFormat = (@"CREATE TABLE %@ (\n" \ -+ @" c_uid VARCHAR (256) NOT NULL,\n" -+ @" c_object VARCHAR (256) NOT NULL,\n" -+ @" c_role VARCHAR (80) NOT NULL\n" -+ @")"); -+ -+- (NSException *) createGCSFolderTableWithName: (NSString *) tableName -+{ -+ NSString *sql; -+ -+ sql = [NSString stringWithFormat: sqlFolderFormat, tableName]; -+ -+ return [self evaluateExpressionX: sql]; -+} -+ -+- (NSException *) createGCSFolderACLTableWithName: (NSString *) tableName -+{ -+ NSString *sql; -+ -+ sql = [NSString stringWithFormat: sqlFolderACLFormat, tableName]; -+ -+ return [self evaluateExpressionX: sql]; -+} -+ - @end /* PostgreSQL72Channel */ - - @implementation PostgreSQL72Channel(PrimaryKeyGeneration) -Index: sope-gdl1/Oracle8/OracleAdaptorChannel.m -=================================================================== ---- sope-gdl1/Oracle8/OracleAdaptorChannel.m (révision 1626) -+++ sope-gdl1/Oracle8/OracleAdaptorChannel.m (copie de travail) -@@ -30,6 +30,7 @@ - - #import - -+static BOOL debugOn = NO; - // - // - // -@@ -41,10 +42,19 @@ - - @implementation OracleAdaptorChannel (Private) - --- (void) _cleanup -++ (void) initialize - { -+ NSUserDefaults *ud; -+ -+ ud = [NSUserDefaults standardUserDefaults]; -+ debugOn = [ud boolForKey: @"OracleAdaptorDebug"]; -+} -+ -+- (void) _cleanup -+{ - column_info *info; - int c; -+ sword result; - - [_resultSetProperties removeAllObjects]; - -@@ -58,11 +68,29 @@ - // so we just free the value instead. - if (info->value) - { -- if (OCIDescriptorFree((dvoid *)info->value, (ub4)OCI_DTYPE_LOB) != OCI_SUCCESS) -+ if (info->type == SQLT_CLOB -+ || info->type == SQLT_BLOB -+ || info->type == SQLT_BFILEE -+ || info->type == SQLT_CFILEE) -+ { -+ result = OCIDescriptorFree((dvoid *)info->value, (ub4) OCI_DTYPE_LOB); -+ if (result != OCI_SUCCESS) -+ { -+ NSLog (@"value was not a LOB descriptor"); -+ abort(); -+ } -+ } -+ else - free(info->value); - info->value = NULL; - } -- free(info); -+ else -+ { -+ NSLog (@"trying to free an already freed value!"); -+ abort(); -+ } -+ free(info); -+ - [_row_buffer removeObjectAtIndex: c]; - } - -@@ -231,6 +259,9 @@ - - [self _cleanup]; - -+ if (debugOn) -+ [self logWithFormat: @"expression: %@", theExpression]; -+ - if (!theExpression || ![theExpression length]) - { - [NSException raise: @"OracleInvalidExpressionException" -@@ -302,7 +333,9 @@ - // We read the maximum width of a column - info->max_width = 0; - status = OCIAttrGet((dvoid*)param, (ub4)OCI_DTYPE_PARAM, (dvoid*)&(info->max_width), (ub4 *)0, (ub4)OCI_ATTR_DATA_SIZE, (OCIError *)_oci_err); -- -+ -+ if (debugOn) -+ NSLog(@"name: %s, type: %d", cname, info->type); - attribute = [EOAttribute attributeWithOracleType: info->type name: cname length: clen width: info->max_width]; - [_resultSetProperties addObject: attribute]; - -@@ -609,7 +642,7 @@ - - /* GCSEOAdaptorChannel protocol */ - static NSString *sqlFolderFormat = (@"CREATE TABLE %@ (\n" \ -- @" c_name VARCHAR2 (256) NOT NULL,\n" -+ @" c_name VARCHAR2 (256) NOT NULL PRIMARY KEY,\n" - @" c_content CLOB NOT NULL,\n" - @" c_creationdate INTEGER NOT NULL,\n" - @" c_lastmodified INTEGER NOT NULL,\n" -Index: sope-gdl1/Oracle8/OracleAdaptorChannelController.m -=================================================================== ---- sope-gdl1/Oracle8/OracleAdaptorChannelController.m (révision 1626) -+++ sope-gdl1/Oracle8/OracleAdaptorChannelController.m (copie de travail) -@@ -31,6 +31,8 @@ - #import - #import - -+static BOOL debugOn = NO; -+ - // - // - // -@@ -48,6 +50,14 @@ - // - @implementation OracleAdaptorChannelController - -++ (void) initialize -+{ -+ NSUserDefaults *ud; -+ -+ ud = [NSUserDefaults standardUserDefaults]; -+ debugOn = [ud boolForKey: @"OracleAdaptorDebug"]; -+} -+ - - (EODelegateResponse) adaptorChannel: (id) theChannel - willInsertRow: (NSMutableDictionary *) theRow - forEntity: (EOEntity *) theEntity -@@ -56,7 +66,8 @@ - NSArray *keys; - int i, c; - -- NSLog(@"willInsertRow: %@ %@", [theRow description], [theEntity description]); -+ if (debugOn) -+ NSLog(@"willInsertRow: %@ %@", [theRow description], [theEntity description]); - - s = AUTORELEASE([[NSMutableString alloc] init]); - -@@ -101,7 +112,8 @@ - NSArray *keys; - int i, c; - -- NSLog(@"willUpdatetRow: %@ %@", [theRow description], [theQualifier description]); -+ if (debugOn) -+ NSLog(@"willUpdateRow: %@ %@", [theRow description], [theQualifier description]); - - s = AUTORELEASE([[NSMutableString alloc] init]); - Index: sope-mime/NGImap4/NGImap4Client.h =================================================================== ---- sope-mime/NGImap4/NGImap4Client.h (révision 1626) -+++ sope-mime/NGImap4/NGImap4Client.h (copie de travail) +--- sope-mime/NGImap4/NGImap4Client.h (revision 1626) ++++ sope-mime/NGImap4/NGImap4Client.h (working copy) @@ -62,6 +62,8 @@ NGImap4ResponseNormalizer *normer; NSMutableArray *responseReceiver; @@ -217,8 +30,8 @@ Index: sope-mime/NGImap4/NGImap4Client.h - (NSDictionary *)copyUid:(unsigned)_uid toFolder:(NSString *)_folder; Index: sope-mime/NGImap4/NGImap4Client.m =================================================================== ---- sope-mime/NGImap4/NGImap4Client.m (révision 1626) -+++ sope-mime/NGImap4/NGImap4Client.m (copie de travail) +--- sope-mime/NGImap4/NGImap4Client.m (revision 1626) ++++ sope-mime/NGImap4/NGImap4Client.m (working copy) @@ -24,6 +24,8 @@ #include "NGImap4Client.h" #include "NGImap4Context.h" @@ -520,8 +333,8 @@ Index: sope-mime/NGImap4/NGImap4Client.m __PRETTY_FUNCTION__, [_exception name], [_exception reason]]; Index: sope-mime/NGImap4/NGSieveClient.m =================================================================== ---- sope-mime/NGImap4/NGSieveClient.m (révision 1626) -+++ sope-mime/NGImap4/NGSieveClient.m (copie de travail) +--- sope-mime/NGImap4/NGSieveClient.m (revision 1626) ++++ sope-mime/NGImap4/NGSieveClient.m (working copy) @@ -294,8 +294,8 @@ return con; } @@ -556,8 +369,8 @@ Index: sope-mime/NGImap4/NGSieveClient.m /* write */ Index: sope-mime/NGImap4/NGImap4Connection.h =================================================================== ---- sope-mime/NGImap4/NGImap4Connection.h (révision 1626) -+++ sope-mime/NGImap4/NGImap4Connection.h (copie de travail) +--- sope-mime/NGImap4/NGImap4Connection.h (revision 1626) ++++ sope-mime/NGImap4/NGImap4Connection.h (working copy) @@ -89,6 +89,7 @@ - (NSArray *)subfoldersForURL:(NSURL *)_url; @@ -568,8 +381,8 @@ Index: sope-mime/NGImap4/NGImap4Connection.h Index: sope-mime/NGImap4/NGImap4Connection.m =================================================================== ---- sope-mime/NGImap4/NGImap4Connection.m (révision 1626) -+++ sope-mime/NGImap4/NGImap4Connection.m (copie de travail) +--- sope-mime/NGImap4/NGImap4Connection.m (revision 1626) ++++ sope-mime/NGImap4/NGImap4Connection.m (working copy) @@ -381,7 +381,7 @@ if (debugCache) [self logWithFormat:@" no folders cached yet .."]; @@ -619,9 +432,32 @@ Index: sope-mime/NGImap4/NGImap4Connection.m } Index: sope-mime/NGImap4/NGImap4ResponseNormalizer.m =================================================================== ---- sope-mime/NGImap4/NGImap4ResponseNormalizer.m (révision 1626) -+++ sope-mime/NGImap4/NGImap4ResponseNormalizer.m (copie de travail) -@@ -648,14 +648,13 @@ +--- sope-mime/NGImap4/NGImap4ResponseNormalizer.m (revision 1626) ++++ sope-mime/NGImap4/NGImap4ResponseNormalizer.m (working copy) +@@ -292,7 +292,7 @@ + /* + filter for fetch response + fetch : NSArray (fetch responses) +- 'header' - RFC822.HEADER ++ 'header' - RFC822.HEADER and BODY[HEADER.FIELDS (...)] + 'text' - RFC822.TEXT + 'size' - SIZE + 'flags' - FLAGS +@@ -336,7 +336,12 @@ + switch (c) { + case 'b': + /* Note: we check for _prefix_! eg body[1] is valid too */ +- if (klen > 3 && [key hasPrefix:@"body"]) { ++ if (klen > 17 && [key hasPrefix:@"body[header.fields"]) { ++ keys[count] = @"header"; ++ values[count] = objForKey(obj, @selector(objectForKey:), key); ++ count++; ++ } ++ else if (klen > 3 && [key hasPrefix:@"body"]) { + keys[count] = @"body"; + values[count] = objForKey(obj, @selector(objectForKey:), key); + count++; +@@ -648,14 +653,13 @@ enumerator = [_flags objectEnumerator]; cnt = 0; while ((obj = [enumerator nextObject])) { @@ -645,9 +481,17 @@ Index: sope-mime/NGImap4/NGImap4ResponseNormalizer.m if (objs) free(objs); Index: sope-mime/NGImap4/NGImap4ResponseParser.m =================================================================== ---- sope-mime/NGImap4/NGImap4ResponseParser.m (révision 1626) -+++ sope-mime/NGImap4/NGImap4ResponseParser.m (copie de travail) -@@ -84,6 +84,8 @@ +--- sope-mime/NGImap4/NGImap4ResponseParser.m (revision 1626) ++++ sope-mime/NGImap4/NGImap4ResponseParser.m (working copy) +@@ -31,6 +31,7 @@ + @interface NGImap4ResponseParser(ParsingPrivates) + - (BOOL)_parseNumberUntaggedResponse:(NGMutableHashMap *)result_; + - (NSDictionary *)_parseBodyContent; ++- (NSData *) _parseBodyHeaderFields; + + - (NSData *)_parseData; + +@@ -84,6 +85,8 @@ static NSDictionary *_parseMultipartBody(NGImap4ResponseParser *self, BOOL isBodyStructure); @@ -656,7 +500,7 @@ Index: sope-mime/NGImap4/NGImap4ResponseParser.m static NSString *_parseBodyString(NGImap4ResponseParser *self, BOOL _convertString); static NSString *_parseBodyDecodeString(NGImap4ResponseParser *self, -@@ -111,6 +113,7 @@ +@@ -111,6 +114,7 @@ static NSNumber *_parseUnsigned(NGImap4ResponseParser *self); static NSString *_parseUntil(NGImap4ResponseParser *self, char _c); static NSString *_parseUntil2(NGImap4ResponseParser *self, char _c1, char _c2); @@ -664,7 +508,58 @@ Index: sope-mime/NGImap4/NGImap4ResponseParser.m static __inline__ NSException *_consumeIfMatch (NGImap4ResponseParser *self, unsigned char _m); -@@ -648,13 +651,148 @@ +@@ -488,6 +492,50 @@ + return [self _parseDataIntoRAM:size]; + } + ++/* ++ Similair to _parseData but used to parse something like this : ++ ++ BODY[HEADER.FIELDS (X-PRIORITY)] {17} ++ X-Priority: 1 ++ ++ ) ++ ++ Headers are returned as data, as is. ++*/ ++- (NSData *) _parseBodyHeaderFields ++{ ++ NSData *result; ++ unsigned size; ++ NSNumber *sizeNum; ++ ++ /* we skip until we're ready to parse {length} */ ++ _parseUntil(self, '{'); ++ ++ result = nil; ++ ++ if ((sizeNum = _parseUnsigned(self)) == nil) { ++ NSException *e; ++ ++ e = [[NGImap4ParserException alloc] ++ initWithFormat:@"expect a number between {}"]; ++ [self setLastException:[e autorelease]]; ++ return nil; ++ } ++ _consumeIfMatch(self, '}'); ++ _consumeIfMatch(self, '\n'); ++ ++ if ((size = [sizeNum intValue]) == 0) { ++ [self logWithFormat:@"ERROR(%s): got content size '0'!", ++ __PRETTY_FUNCTION__]; ++ return nil; ++ } ++ ++ if (UseMemoryMappedData && (size > Imap4MMDataBoundary)) ++ return [self _parseDataToFile:size]; ++ ++ return [self _parseDataIntoRAM:size]; ++} ++ + static int _parseTaggedResponse(NGImap4ResponseParser *self, + NGMutableHashMap *result_) + { +@@ -648,13 +696,148 @@ [result_ addObject:_parseUntil(self, '\n') forKey:@"description"]; } @@ -815,7 +710,7 @@ Index: sope-mime/NGImap4/NGImap4ResponseParser.m } - (void)_consumeOptionalSpace { if (_la(self, 0) == ' ') _consume(self, 1); -@@ -1090,6 +1228,8 @@ +@@ -1090,6 +1273,8 @@ return @""; s = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; @@ -824,7 +719,7 @@ Index: sope-mime/NGImap4/NGImap4ResponseParser.m if (s == nil) { [self logWithFormat: @"ERROR(%s): could not convert data (%d bytes) into string.", -@@ -1185,7 +1325,7 @@ +@@ -1185,7 +1370,7 @@ route = [self _parseQuotedStringOrNIL]; [self _consumeOptionalSpace]; mailbox = [self _parseQuotedStringOrNIL]; [self _consumeOptionalSpace]; host = [self _parseQuotedStringOrNIL]; [self _consumeOptionalSpace]; @@ -833,7 +728,7 @@ Index: sope-mime/NGImap4/NGImap4ResponseParser.m if (_la(self, 0) != ')') { [self logWithFormat:@"WARNING: IMAP4 envelope " @"address not properly closed (c0=%c,c1=%c): %@", -@@ -1197,6 +1337,7 @@ +@@ -1197,6 +1382,7 @@ address = [[NGImap4EnvelopeAddress alloc] initWithPersonalName:pname sourceRoute:route mailbox:mailbox host:host]; @@ -841,7 +736,24 @@ Index: sope-mime/NGImap4/NGImap4ResponseParser.m return address; } -@@ -1594,8 +1735,11 @@ +@@ -1382,7 +1568,15 @@ + #if 0 + [self logWithFormat:@"PARSE KEY: %@", key]; + #endif +- if ([key hasPrefix:@"body["]) { ++ if ([key hasPrefix:@"body[header.fields"]) { ++ NSData *content; ++ ++ if ((content = [self _parseBodyHeaderFields]) != nil) ++ [fetch setObject:content forKey:key]; ++ else ++ [self logWithFormat:@"ERROR: got no body content for key: '%@'",key]; ++ } ++ else if ([key hasPrefix:@"body["]) { + NSDictionary *content; + + if ((content = [self _parseBodyContent]) != nil) +@@ -1594,8 +1788,11 @@ if (_decode) data = [data decodeQuotedPrintableValueOfMIMEHeaderField:nil]; @@ -855,7 +767,7 @@ Index: sope-mime/NGImap4/NGImap4ResponseParser.m } else { str = _parseUntil2(self, ' ', ')'); -@@ -1620,13 +1764,35 @@ +@@ -1620,13 +1817,35 @@ return str; } @@ -892,7 +804,7 @@ Index: sope-mime/NGImap4/NGImap4ResponseParser.m static NSDictionary *_parseBodyParameterList(NGImap4ResponseParser *self) { NSMutableDictionary *list; -@@ -1646,7 +1812,7 @@ +@@ -1646,7 +1865,7 @@ _consumeIfMatch(self, ' '); value = _parseBodyDecodeString(self, YES, YES); @@ -901,7 +813,7 @@ Index: sope-mime/NGImap4/NGImap4ResponseParser.m } _consumeIfMatch(self, ')'); } -@@ -1731,13 +1897,14 @@ +@@ -1731,13 +1950,14 @@ static NSDictionary *_parseSingleBody(NGImap4ResponseParser *self, BOOL isBodyStructure) { NSString *type, *subtype, *bodyId, *description, @@ -918,7 +830,7 @@ Index: sope-mime/NGImap4/NGImap4ResponseParser.m _consumeIfMatch(self, ' '); parameterList = _parseBodyParameterList(self); _consumeIfMatch(self, ' '); -@@ -1762,13 +1929,18 @@ +@@ -1762,13 +1982,18 @@ _consumeIfMatch(self, ' '); [dict setObject:_parseBodyString(self, YES) forKey:@"lines"]; } @@ -940,7 +852,7 @@ Index: sope-mime/NGImap4/NGImap4ResponseParser.m _consumeIfMatch(self, ' '); [dict setObject:_parseParenthesizedAddressList(self) forKey:@"from"]; _consumeIfMatch(self, ' '); -@@ -1783,14 +1955,20 @@ +@@ -1783,14 +2008,20 @@ _consumeIfMatch(self, ' '); [dict setObject:_parseParenthesizedAddressList(self) forKey:@"bcc"]; _consumeIfMatch(self, ' '); @@ -964,7 +876,7 @@ Index: sope-mime/NGImap4/NGImap4ResponseParser.m } } -@@ -1805,14 +1983,9 @@ +@@ -1805,14 +2036,9 @@ forKey: @"disposition"]; if (_la(self, 0) != ')') { _consume(self,1); @@ -982,7 +894,7 @@ Index: sope-mime/NGImap4/NGImap4ResponseParser.m if (_la(self, 0) != ')') { _consume(self,1); [dict setObject: _parseBodyString(self, YES) -@@ -1829,6 +2002,7 @@ +@@ -1829,6 +2055,7 @@ static NSDictionary *_parseMultipartBody(NGImap4ResponseParser *self, BOOL isBodyStructure) { NSMutableArray *parts; @@ -990,7 +902,7 @@ Index: sope-mime/NGImap4/NGImap4ResponseParser.m NSString *kind; NSMutableDictionary *dict; -@@ -1854,14 +2028,9 @@ +@@ -1854,14 +2081,9 @@ forKey: @"disposition"]; if (_la(self, 0) != ')') { _consume(self,1); @@ -1008,7 +920,7 @@ Index: sope-mime/NGImap4/NGImap4ResponseParser.m if (_la(self, 0) != ')') { _consume(self,1); [dict setObject: _parseBodyString(self, YES) -@@ -2170,6 +2339,21 @@ +@@ -2170,6 +2392,21 @@ } } @@ -1030,7 +942,7 @@ Index: sope-mime/NGImap4/NGImap4ResponseParser.m - (NSException *)exceptionForFailedMatch:(unsigned char)_match got:(unsigned char)_avail { -@@ -2225,9 +2409,9 @@ +@@ -2225,9 +2462,9 @@ [s release]; if (c == '\n') { @@ -1044,8 +956,8 @@ Index: sope-mime/NGImap4/NGImap4ResponseParser.m self->serverResponseDebug = Index: sope-mime/NGImap4/ChangeLog =================================================================== ---- sope-mime/NGImap4/ChangeLog (révision 1626) -+++ sope-mime/NGImap4/ChangeLog (copie de travail) +--- sope-mime/NGImap4/ChangeLog (revision 1626) ++++ sope-mime/NGImap4/ChangeLog (working copy) @@ -1,3 +1,23 @@ +2008-09-22 Wolfgang Sourdeau + @@ -1072,8 +984,8 @@ Index: sope-mime/NGImap4/ChangeLog * NGImap4Connection.m: some fix for folders ending with a slash (OGo Index: sope-mime/NGImap4/NGImap4ConnectionManager.m =================================================================== ---- sope-mime/NGImap4/NGImap4ConnectionManager.m (révision 1626) -+++ sope-mime/NGImap4/NGImap4ConnectionManager.m (copie de travail) +--- sope-mime/NGImap4/NGImap4ConnectionManager.m (revision 1626) ++++ sope-mime/NGImap4/NGImap4ConnectionManager.m (working copy) @@ -38,6 +38,9 @@ debugCache = [ud boolForKey:@"NGImap4EnableIMAP4CacheDebug"]; poolingOff = [ud boolForKey:@"NGImap4DisableIMAP4Pooling"]; @@ -1199,8 +1111,8 @@ Index: sope-mime/NGImap4/NGImap4ConnectionManager.m /* client object */ Index: sope-mime/NGImap4/NSString+Imap4.m =================================================================== ---- sope-mime/NGImap4/NSString+Imap4.m (révision 1626) -+++ sope-mime/NGImap4/NSString+Imap4.m (copie de travail) +--- sope-mime/NGImap4/NSString+Imap4.m (revision 1626) ++++ sope-mime/NGImap4/NSString+Imap4.m (working copy) @@ -20,11 +20,56 @@ 02111-1307, USA. */ @@ -1721,8 +1633,8 @@ Index: sope-mime/NGImap4/NSString+Imap4.m +@end /* NSString(Imap4) */ Index: sope-mime/NGMail/NGSmtpClient.m =================================================================== ---- sope-mime/NGMail/NGSmtpClient.m (révision 1626) -+++ sope-mime/NGMail/NGSmtpClient.m (copie de travail) +--- sope-mime/NGMail/NGSmtpClient.m (revision 1626) ++++ sope-mime/NGMail/NGSmtpClient.m (working copy) @@ -24,6 +24,82 @@ #include "NGSmtpReplyCodes.h" #include "common.h" @@ -1877,8 +1789,8 @@ Index: sope-mime/NGMail/NGSmtpClient.m reply = [self receiveReply]; Index: sope-mime/NGMail/NGMailAddressParser.h =================================================================== ---- sope-mime/NGMail/NGMailAddressParser.h (révision 1626) -+++ sope-mime/NGMail/NGMailAddressParser.h (copie de travail) +--- sope-mime/NGMail/NGMailAddressParser.h (revision 1626) ++++ sope-mime/NGMail/NGMailAddressParser.h (working copy) @@ -24,7 +24,9 @@ #import @@ -1915,8 +1827,8 @@ Index: sope-mime/NGMail/NGMailAddressParser.h Index: sope-mime/NGMail/NGMimeMessageGenerator.m =================================================================== ---- sope-mime/NGMail/NGMimeMessageGenerator.m (révision 1626) -+++ sope-mime/NGMail/NGMimeMessageGenerator.m (copie de travail) +--- sope-mime/NGMail/NGMimeMessageGenerator.m (revision 1626) ++++ sope-mime/NGMail/NGMimeMessageGenerator.m (working copy) @@ -86,37 +86,40 @@ char *des = NULL; unsigned int cnt; @@ -1981,8 +1893,8 @@ Index: sope-mime/NGMail/NGMimeMessageGenerator.m unsigned isoEndLen = 2; Index: sope-mime/NGMail/NGMailAddressParser.m =================================================================== ---- sope-mime/NGMail/NGMailAddressParser.m (révision 1626) -+++ sope-mime/NGMail/NGMailAddressParser.m (copie de travail) +--- sope-mime/NGMail/NGMailAddressParser.m (revision 1626) ++++ sope-mime/NGMail/NGMailAddressParser.m (working copy) @@ -52,9 +52,9 @@ StrClass = [NSString class]; } @@ -2126,8 +2038,8 @@ Index: sope-mime/NGMail/NGMailAddressParser.m self->dataPos = 0; Index: sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m =================================================================== ---- sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m (révision 1626) -+++ sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m (copie de travail) +--- sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m (revision 1626) ++++ sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m (working copy) @@ -19,88 +19,45 @@ 02111-1307, USA. */ @@ -2531,8 +2443,8 @@ Index: sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m #if 0 Index: sope-mime/NGMime/NGMimeMultipartBodyParser.m =================================================================== ---- sope-mime/NGMime/NGMimeMultipartBodyParser.m (révision 1626) -+++ sope-mime/NGMime/NGMimeMultipartBodyParser.m (copie de travail) +--- sope-mime/NGMime/NGMimeMultipartBodyParser.m (revision 1626) ++++ sope-mime/NGMime/NGMimeMultipartBodyParser.m (working copy) @@ -428,6 +428,7 @@ NSString *boundary = nil; NSArray *rawBodyParts = nil; @@ -2556,8 +2468,8 @@ Index: sope-mime/NGMime/NGMimeMultipartBodyParser.m if (rawBodyParts) { Index: sope-mime/NGMime/NGMimeHeaderFieldGeneratorSet.m =================================================================== ---- sope-mime/NGMime/NGMimeHeaderFieldGeneratorSet.m (révision 1626) -+++ sope-mime/NGMime/NGMimeHeaderFieldGeneratorSet.m (copie de travail) +--- sope-mime/NGMime/NGMimeHeaderFieldGeneratorSet.m (revision 1626) ++++ sope-mime/NGMime/NGMimeHeaderFieldGeneratorSet.m (working copy) @@ -77,6 +77,7 @@ [rfc822Set setGenerator:gen forField:@"bcc"]; [rfc822Set setGenerator:gen forField:Fields->from]; @@ -2568,8 +2480,8 @@ Index: sope-mime/NGMime/NGMimeHeaderFieldGeneratorSet.m Index: sope-mime/NGMime/NGMimeType.m =================================================================== ---- sope-mime/NGMime/NGMimeType.m (révision 1626) -+++ sope-mime/NGMime/NGMimeType.m (copie de travail) +--- sope-mime/NGMime/NGMimeType.m (revision 1626) ++++ sope-mime/NGMime/NGMimeType.m (working copy) @@ -120,28 +120,23 @@ /* some unsupported, but known encoding */ @@ -2666,8 +2578,8 @@ Index: sope-mime/NGMime/NGMimeType.m - (NSString *)stringValue { Index: sope-mime/NGMime/NGMimeBodyPart.m =================================================================== ---- sope-mime/NGMime/NGMimeBodyPart.m (révision 1626) -+++ sope-mime/NGMime/NGMimeBodyPart.m (copie de travail) +--- sope-mime/NGMime/NGMimeBodyPart.m (revision 1626) ++++ sope-mime/NGMime/NGMimeBodyPart.m (working copy) @@ -31,18 +31,6 @@ return 2; } @@ -2704,8 +2616,8 @@ Index: sope-mime/NGMime/NGMimeBodyPart.m - (NSString *)contentId { Index: sope-mime/NGMime/ChangeLog =================================================================== ---- sope-mime/NGMime/ChangeLog (révision 1626) -+++ sope-mime/NGMime/ChangeLog (copie de travail) +--- sope-mime/NGMime/ChangeLog (revision 1626) ++++ sope-mime/NGMime/ChangeLog (working copy) @@ -1,3 +1,25 @@ +2008-09-08 Wolfgang Sourdeau + @@ -2734,8 +2646,8 @@ Index: sope-mime/NGMime/ChangeLog * fixes for OGo bug #789 (reply-to QP encoding) Index: sope-mime/NGMime/NGMimeContentTypeHeaderFieldGenerator.m =================================================================== ---- sope-mime/NGMime/NGMimeContentTypeHeaderFieldGenerator.m (révision 1626) -+++ sope-mime/NGMime/NGMimeContentTypeHeaderFieldGenerator.m (copie de travail) +--- sope-mime/NGMime/NGMimeContentTypeHeaderFieldGenerator.m (revision 1626) ++++ sope-mime/NGMime/NGMimeContentTypeHeaderFieldGenerator.m (working copy) @@ -36,8 +36,7 @@ NGMimeType *type = nil; // only one content-type field NSString *tmp = nil; @@ -2874,8 +2786,8 @@ Index: sope-mime/NGMime/NGMimeContentTypeHeaderFieldGenerator.m } Index: sope-mime/NGMime/NGMimePartGenerator.m =================================================================== ---- sope-mime/NGMime/NGMimePartGenerator.m (révision 1626) -+++ sope-mime/NGMime/NGMimePartGenerator.m (copie de travail) +--- sope-mime/NGMime/NGMimePartGenerator.m (revision 1626) ++++ sope-mime/NGMime/NGMimePartGenerator.m (working copy) @@ -155,8 +155,9 @@ BOOL isMultiValue, isFirst; @@ -2899,8 +2811,8 @@ Index: sope-mime/NGMime/NGMimePartGenerator.m Index: sope-mime/NGMime/NGMimeBodyParser.m =================================================================== ---- sope-mime/NGMime/NGMimeBodyParser.m (révision 1626) -+++ sope-mime/NGMime/NGMimeBodyParser.m (copie de travail) +--- sope-mime/NGMime/NGMimeBodyParser.m (revision 1626) ++++ sope-mime/NGMime/NGMimeBodyParser.m (working copy) @@ -67,7 +67,10 @@ if (_data == nil) return nil; @@ -2915,8 +2827,8 @@ Index: sope-mime/NGMime/NGMimeBodyParser.m Index: sope-mime/NGMime/NGMimePartParser.h =================================================================== ---- sope-mime/NGMime/NGMimePartParser.h (révision 1626) -+++ sope-mime/NGMime/NGMimePartParser.h (copie de travail) +--- sope-mime/NGMime/NGMimePartParser.h (revision 1626) ++++ sope-mime/NGMime/NGMimePartParser.h (working copy) @@ -117,6 +117,7 @@ BOOL parserParseRawBodyDataOfPart:1; BOOL parserBodyParserForPart:1; @@ -2937,8 +2849,8 @@ Index: sope-mime/NGMime/NGMimePartParser.h @interface NSObject(NGMimePartParser) Index: sope-mime/NGMime/NGMimePartParser.m =================================================================== ---- sope-mime/NGMime/NGMimePartParser.m (révision 1626) -+++ sope-mime/NGMime/NGMimePartParser.m (copie de travail) +--- sope-mime/NGMime/NGMimePartParser.m (revision 1626) ++++ sope-mime/NGMime/NGMimePartParser.m (working copy) @@ -227,7 +227,7 @@ } @@ -2962,8 +2874,8 @@ Index: sope-mime/NGMime/NGMimePartParser.m : [NGMimeType mimeType:[ctype stringValue]]; Index: sope-mime/NGMime/NGMimeAddressHeaderFieldGenerator.m =================================================================== ---- sope-mime/NGMime/NGMimeAddressHeaderFieldGenerator.m (révision 1626) -+++ sope-mime/NGMime/NGMimeAddressHeaderFieldGenerator.m (copie de travail) +--- sope-mime/NGMime/NGMimeAddressHeaderFieldGenerator.m (revision 1626) ++++ sope-mime/NGMime/NGMimeAddressHeaderFieldGenerator.m (working copy) @@ -105,10 +105,10 @@ } @@ -3048,8 +2960,8 @@ Index: sope-mime/NGMime/NGMimeAddressHeaderFieldGenerator.m return data; Index: sope-mime/NGMime/NGMimeContentDispositionHeaderFieldGenerator.m =================================================================== ---- sope-mime/NGMime/NGMimeContentDispositionHeaderFieldGenerator.m (révision 1626) -+++ sope-mime/NGMime/NGMimeContentDispositionHeaderFieldGenerator.m (copie de travail) +--- sope-mime/NGMime/NGMimeContentDispositionHeaderFieldGenerator.m (revision 1626) ++++ sope-mime/NGMime/NGMimeContentDispositionHeaderFieldGenerator.m (working copy) @@ -49,80 +49,70 @@ // TODO: move the stuff below to some NSString or NSData category? @@ -3182,10 +3094,197 @@ Index: sope-mime/NGMime/NGMimeContentDispositionHeaderFieldGenerator.m } return data; } +Index: sope-gdl1/PostgreSQL/PostgreSQL72Channel.m +=================================================================== +--- sope-gdl1/PostgreSQL/PostgreSQL72Channel.m (revision 1626) ++++ sope-gdl1/PostgreSQL/PostgreSQL72Channel.m (working copy) +@@ -713,6 +713,39 @@ + return ms; + } + ++/* GCSEOAdaptorChannel protocol */ ++static NSString *sqlFolderFormat = (@"CREATE TABLE %@ (\n" \ ++ @" c_name VARCHAR (256) NOT NULL PRIMARY KEY,\n" ++ @" c_content VARCHAR (100000) NOT NULL,\n" ++ @" c_creationdate INT4 NOT NULL,\n" ++ @" c_lastmodified INT4 NOT NULL,\n" ++ @" c_version INT4 NOT NULL,\n" ++ @" c_deleted INT4 NULL\n" ++ @")"); ++static NSString *sqlFolderACLFormat = (@"CREATE TABLE %@ (\n" \ ++ @" c_uid VARCHAR (256) NOT NULL,\n" ++ @" c_object VARCHAR (256) NOT NULL,\n" ++ @" c_role VARCHAR (80) NOT NULL\n" ++ @")"); ++ ++- (NSException *) createGCSFolderTableWithName: (NSString *) tableName ++{ ++ NSString *sql; ++ ++ sql = [NSString stringWithFormat: sqlFolderFormat, tableName]; ++ ++ return [self evaluateExpressionX: sql]; ++} ++ ++- (NSException *) createGCSFolderACLTableWithName: (NSString *) tableName ++{ ++ NSString *sql; ++ ++ sql = [NSString stringWithFormat: sqlFolderACLFormat, tableName]; ++ ++ return [self evaluateExpressionX: sql]; ++} ++ + @end /* PostgreSQL72Channel */ + + @implementation PostgreSQL72Channel(PrimaryKeyGeneration) +Index: sope-gdl1/Oracle8/OracleAdaptorChannel.m +=================================================================== +--- sope-gdl1/Oracle8/OracleAdaptorChannel.m (revision 1626) ++++ sope-gdl1/Oracle8/OracleAdaptorChannel.m (working copy) +@@ -30,6 +30,7 @@ + + #import + ++static BOOL debugOn = NO; + // + // + // +@@ -41,10 +42,19 @@ + + @implementation OracleAdaptorChannel (Private) + +-- (void) _cleanup +++ (void) initialize + { ++ NSUserDefaults *ud; ++ ++ ud = [NSUserDefaults standardUserDefaults]; ++ debugOn = [ud boolForKey: @"OracleAdaptorDebug"]; ++} ++ ++- (void) _cleanup ++{ + column_info *info; + int c; ++ sword result; + + [_resultSetProperties removeAllObjects]; + +@@ -58,11 +68,29 @@ + // so we just free the value instead. + if (info->value) + { +- if (OCIDescriptorFree((dvoid *)info->value, (ub4)OCI_DTYPE_LOB) != OCI_SUCCESS) ++ if (info->type == SQLT_CLOB ++ || info->type == SQLT_BLOB ++ || info->type == SQLT_BFILEE ++ || info->type == SQLT_CFILEE) ++ { ++ result = OCIDescriptorFree((dvoid *)info->value, (ub4) OCI_DTYPE_LOB); ++ if (result != OCI_SUCCESS) ++ { ++ NSLog (@"value was not a LOB descriptor"); ++ abort(); ++ } ++ } ++ else + free(info->value); + info->value = NULL; + } +- free(info); ++ else ++ { ++ NSLog (@"trying to free an already freed value!"); ++ abort(); ++ } ++ free(info); ++ + [_row_buffer removeObjectAtIndex: c]; + } + +@@ -231,6 +259,9 @@ + + [self _cleanup]; + ++ if (debugOn) ++ [self logWithFormat: @"expression: %@", theExpression]; ++ + if (!theExpression || ![theExpression length]) + { + [NSException raise: @"OracleInvalidExpressionException" +@@ -302,7 +333,9 @@ + // We read the maximum width of a column + info->max_width = 0; + status = OCIAttrGet((dvoid*)param, (ub4)OCI_DTYPE_PARAM, (dvoid*)&(info->max_width), (ub4 *)0, (ub4)OCI_ATTR_DATA_SIZE, (OCIError *)_oci_err); +- ++ ++ if (debugOn) ++ NSLog(@"name: %s, type: %d", cname, info->type); + attribute = [EOAttribute attributeWithOracleType: info->type name: cname length: clen width: info->max_width]; + [_resultSetProperties addObject: attribute]; + +@@ -609,7 +642,7 @@ + + /* GCSEOAdaptorChannel protocol */ + static NSString *sqlFolderFormat = (@"CREATE TABLE %@ (\n" \ +- @" c_name VARCHAR2 (256) NOT NULL,\n" ++ @" c_name VARCHAR2 (256) NOT NULL PRIMARY KEY,\n" + @" c_content CLOB NOT NULL,\n" + @" c_creationdate INTEGER NOT NULL,\n" + @" c_lastmodified INTEGER NOT NULL,\n" +Index: sope-gdl1/Oracle8/OracleAdaptorChannelController.m +=================================================================== +--- sope-gdl1/Oracle8/OracleAdaptorChannelController.m (revision 1626) ++++ sope-gdl1/Oracle8/OracleAdaptorChannelController.m (working copy) +@@ -31,6 +31,8 @@ + #import + #import + ++static BOOL debugOn = NO; ++ + // + // + // +@@ -48,6 +50,14 @@ + // + @implementation OracleAdaptorChannelController + +++ (void) initialize ++{ ++ NSUserDefaults *ud; ++ ++ ud = [NSUserDefaults standardUserDefaults]; ++ debugOn = [ud boolForKey: @"OracleAdaptorDebug"]; ++} ++ + - (EODelegateResponse) adaptorChannel: (id) theChannel + willInsertRow: (NSMutableDictionary *) theRow + forEntity: (EOEntity *) theEntity +@@ -56,7 +66,8 @@ + NSArray *keys; + int i, c; + +- NSLog(@"willInsertRow: %@ %@", [theRow description], [theEntity description]); ++ if (debugOn) ++ NSLog(@"willInsertRow: %@ %@", [theRow description], [theEntity description]); + + s = AUTORELEASE([[NSMutableString alloc] init]); + +@@ -101,7 +112,8 @@ + NSArray *keys; + int i, c; + +- NSLog(@"willUpdatetRow: %@ %@", [theRow description], [theQualifier description]); ++ if (debugOn) ++ NSLog(@"willUpdateRow: %@ %@", [theRow description], [theQualifier description]); + + s = AUTORELEASE([[NSMutableString alloc] init]); + Index: sope-core/NGExtensions/NGExtensions/NSString+Ext.h =================================================================== ---- sope-core/NGExtensions/NGExtensions/NSString+Ext.h (révision 1626) -+++ sope-core/NGExtensions/NGExtensions/NSString+Ext.h (copie de travail) +--- sope-core/NGExtensions/NGExtensions/NSString+Ext.h (revision 1626) ++++ sope-core/NGExtensions/NGExtensions/NSString+Ext.h (working copy) @@ -30,6 +30,7 @@ @interface NSString(GSAdditions) @@ -3222,8 +3321,8 @@ Index: sope-core/NGExtensions/NGExtensions/NSString+Ext.h /* specific to libFoundation */ Index: sope-core/NGExtensions/FdExt.subproj/NSString+Ext.m =================================================================== ---- sope-core/NGExtensions/FdExt.subproj/NSString+Ext.m (révision 1626) -+++ sope-core/NGExtensions/FdExt.subproj/NSString+Ext.m (copie de travail) +--- sope-core/NGExtensions/FdExt.subproj/NSString+Ext.m (revision 1626) ++++ sope-core/NGExtensions/FdExt.subproj/NSString+Ext.m (working copy) @@ -39,18 +39,6 @@ : (NSString *)[[self copy] autorelease]; } @@ -3311,8 +3410,8 @@ Index: sope-core/NGExtensions/FdExt.subproj/NSString+Ext.m - (BOOL)isAbsoluteURL Index: sope-core/NGExtensions/FdExt.subproj/NSString+Encoding.m =================================================================== ---- sope-core/NGExtensions/FdExt.subproj/NSString+Encoding.m (révision 1626) -+++ sope-core/NGExtensions/FdExt.subproj/NSString+Encoding.m (copie de travail) +--- sope-core/NGExtensions/FdExt.subproj/NSString+Encoding.m (revision 1626) ++++ sope-core/NGExtensions/FdExt.subproj/NSString+Encoding.m (working copy) @@ -140,8 +140,12 @@ @@ -3354,8 +3453,8 @@ Index: sope-core/NGExtensions/FdExt.subproj/NSString+Encoding.m static char *iconv_wrapper(id self, char *_src, unsigned _srcLen, Index: sope-core/NGExtensions/NGQuotedPrintableCoding.m =================================================================== ---- sope-core/NGExtensions/NGQuotedPrintableCoding.m (révision 1626) -+++ sope-core/NGExtensions/NGQuotedPrintableCoding.m (copie de travail) +--- sope-core/NGExtensions/NGQuotedPrintableCoding.m (revision 1626) ++++ sope-core/NGExtensions/NGQuotedPrintableCoding.m (working copy) @@ -278,7 +278,12 @@ for (cnt = 0; (cnt < _srcLen) && (destCnt < _destLen); cnt++) { @@ -3372,8 +3471,8 @@ Index: sope-core/NGExtensions/NGQuotedPrintableCoding.m ((c > 31) && (c < 61)) || Index: sope-core/NGExtensions/EOExt.subproj/EOGlobalID+Ext.m =================================================================== ---- sope-core/NGExtensions/EOExt.subproj/EOGlobalID+Ext.m (révision 1626) -+++ sope-core/NGExtensions/EOExt.subproj/EOGlobalID+Ext.m (copie de travail) +--- sope-core/NGExtensions/EOExt.subproj/EOGlobalID+Ext.m (revision 1626) ++++ sope-core/NGExtensions/EOExt.subproj/EOGlobalID+Ext.m (working copy) @@ -19,6 +19,7 @@ 02111-1307, USA. */ @@ -3384,8 +3483,8 @@ Index: sope-core/NGExtensions/EOExt.subproj/EOGlobalID+Ext.m Index: sope-core/NGStreams/GNUmakefile.preamble =================================================================== ---- sope-core/NGStreams/GNUmakefile.preamble (révision 1626) -+++ sope-core/NGStreams/GNUmakefile.preamble (copie de travail) +--- sope-core/NGStreams/GNUmakefile.preamble (revision 1626) ++++ sope-core/NGStreams/GNUmakefile.preamble (working copy) @@ -1,7 +1,10 @@ # compilation settings @@ -3399,8 +3498,8 @@ Index: sope-core/NGStreams/GNUmakefile.preamble -I.. Index: sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.h =================================================================== ---- sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.h (révision 1626) -+++ sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.h (copie de travail) +--- sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.h (revision 1626) ++++ sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.h (working copy) @@ -19,6 +19,8 @@ 02111-1307, USA. */ @@ -3421,8 +3520,8 @@ Index: sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.h id entityResolver; Index: sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.m =================================================================== ---- sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.m (révision 1626) -+++ sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.m (copie de travail) +--- sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.m (revision 1626) ++++ sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.m (working copy) @@ -30,6 +30,12 @@ #include #include @@ -3481,8 +3580,8 @@ Index: sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.m - (void)tearDownParser { Index: sope-xml/libxmlSAXDriver/libxmlSAXDriver.m =================================================================== ---- sope-xml/libxmlSAXDriver/libxmlSAXDriver.m (révision 1626) -+++ sope-xml/libxmlSAXDriver/libxmlSAXDriver.m (copie de travail) +--- sope-xml/libxmlSAXDriver/libxmlSAXDriver.m (revision 1626) ++++ sope-xml/libxmlSAXDriver/libxmlSAXDriver.m (working copy) @@ -614,7 +614,7 @@ xmlParseDocument(ctxt); @@ -3503,8 +3602,8 @@ Index: sope-xml/libxmlSAXDriver/libxmlSAXDriver.m xmlFreeParserCtxt(self->ctxt); Index: sope-appserver/mod_ngobjweb/config.c =================================================================== ---- sope-appserver/mod_ngobjweb/config.c (révision 1626) -+++ sope-appserver/mod_ngobjweb/config.c (copie de travail) +--- sope-appserver/mod_ngobjweb/config.c (revision 1626) ++++ sope-appserver/mod_ngobjweb/config.c (working copy) @@ -21,7 +21,7 @@ #include "common.h" @@ -3514,10 +3613,22 @@ Index: sope-appserver/mod_ngobjweb/config.c static char *_makeString(char *buf, char *str, int max) { if (buf == NULL) +Index: sope-appserver/mod_ngobjweb/NGBufferedDescriptor.c +=================================================================== +--- sope-appserver/mod_ngobjweb/NGBufferedDescriptor.c (revision 1626) ++++ sope-appserver/mod_ngobjweb/NGBufferedDescriptor.c (working copy) +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include "common.h" + #include "NGBufferedDescriptor.h" + + // returns the number of bytes which where read from the buffer Index: sope-appserver/mod_ngobjweb/GNUmakefile =================================================================== ---- sope-appserver/mod_ngobjweb/GNUmakefile (révision 1626) -+++ sope-appserver/mod_ngobjweb/GNUmakefile (copie de travail) +--- sope-appserver/mod_ngobjweb/GNUmakefile (revision 1626) ++++ sope-appserver/mod_ngobjweb/GNUmakefile (working copy) @@ -82,7 +82,7 @@ CFLAGS = -Wall -I. -fPIC \ @@ -3537,22 +3648,10 @@ Index: sope-appserver/mod_ngobjweb/GNUmakefile install-usr-libexec :: all $(INSTALL_PROGRAM) $(product) /usr/libexec/httpd/ -Index: sope-appserver/mod_ngobjweb/NGBufferedDescriptor.c -=================================================================== ---- sope-appserver/mod_ngobjweb/NGBufferedDescriptor.c (révision 1626) -+++ sope-appserver/mod_ngobjweb/NGBufferedDescriptor.c (copie de travail) -@@ -23,6 +23,7 @@ - #include - #include - #include -+#include "common.h" - #include "NGBufferedDescriptor.h" - - // returns the number of bytes which where read from the buffer Index: sope-appserver/NGObjWeb/GNUmakefile.postamble =================================================================== ---- sope-appserver/NGObjWeb/GNUmakefile.postamble (révision 1626) -+++ sope-appserver/NGObjWeb/GNUmakefile.postamble (copie de travail) +--- sope-appserver/NGObjWeb/GNUmakefile.postamble (revision 1626) ++++ sope-appserver/NGObjWeb/GNUmakefile.postamble (working copy) @@ -23,14 +23,20 @@ # install makefiles @@ -3583,8 +3682,8 @@ Index: sope-appserver/NGObjWeb/GNUmakefile.postamble + $(DESTDIR)/$(GNUSTEP_MAKEFILES)/wobundle.make Index: sope-appserver/NGObjWeb/WOContext.m =================================================================== ---- sope-appserver/NGObjWeb/WOContext.m (révision 1626) -+++ sope-appserver/NGObjWeb/WOContext.m (copie de travail) +--- sope-appserver/NGObjWeb/WOContext.m (revision 1626) ++++ sope-appserver/NGObjWeb/WOContext.m (working copy) @@ -64,11 +64,13 @@ static BOOL testNSURLs = NO; static BOOL newCURLStyle = NO; @@ -3623,8 +3722,8 @@ Index: sope-appserver/NGObjWeb/WOContext.m serverURL = [@"http://" stringByAppendingString:host]; Index: sope-appserver/NGObjWeb/ChangeLog =================================================================== ---- sope-appserver/NGObjWeb/ChangeLog (révision 1626) -+++ sope-appserver/NGObjWeb/ChangeLog (copie de travail) +--- sope-appserver/NGObjWeb/ChangeLog (revision 1626) ++++ sope-appserver/NGObjWeb/ChangeLog (working copy) @@ -1,3 +1,8 @@ +2008-09-01 Ludovic Marcotte + @@ -3636,8 +3735,8 @@ Index: sope-appserver/NGObjWeb/ChangeLog * WOHTTPURLHandle.m: add 'query' component of URL to request path Index: sope-appserver/NGObjWeb/DAVPropMap.plist =================================================================== ---- sope-appserver/NGObjWeb/DAVPropMap.plist (révision 1626) -+++ sope-appserver/NGObjWeb/DAVPropMap.plist (copie de travail) +--- sope-appserver/NGObjWeb/DAVPropMap.plist (revision 1626) ++++ sope-appserver/NGObjWeb/DAVPropMap.plist (working copy) @@ -24,13 +24,19 @@ "{DAV:}status" = "davStatus"; "{http://apache.org/dav/props/}executable" = "davIsExecutable"; @@ -3714,8 +3813,8 @@ Index: sope-appserver/NGObjWeb/DAVPropMap.plist "{http://groupdav.org/}component-set" = gdavComponentSet; Index: sope-appserver/NGObjWeb/WebDAV/SaxDAVHandler.m =================================================================== ---- sope-appserver/NGObjWeb/WebDAV/SaxDAVHandler.m (révision 1626) -+++ sope-appserver/NGObjWeb/WebDAV/SaxDAVHandler.m (copie de travail) +--- sope-appserver/NGObjWeb/WebDAV/SaxDAVHandler.m (revision 1626) ++++ sope-appserver/NGObjWeb/WebDAV/SaxDAVHandler.m (working copy) @@ -655,6 +655,7 @@ if (self->responses == nil) self->responses = [[NSMutableArray alloc] initWithCapacity:64]; @@ -3726,8 +3825,8 @@ Index: sope-appserver/NGObjWeb/WebDAV/SaxDAVHandler.m case 'n': Index: sope-appserver/NGObjWeb/WebDAV/SoObjectWebDAVDispatcher.m =================================================================== ---- sope-appserver/NGObjWeb/WebDAV/SoObjectWebDAVDispatcher.m (révision 1626) -+++ sope-appserver/NGObjWeb/WebDAV/SoObjectWebDAVDispatcher.m (copie de travail) +--- sope-appserver/NGObjWeb/WebDAV/SoObjectWebDAVDispatcher.m (revision 1626) ++++ sope-appserver/NGObjWeb/WebDAV/SoObjectWebDAVDispatcher.m (working copy) @@ -1523,16 +1523,16 @@ - (id)doREPORT:(WOContext *)_ctx { id domDocument; @@ -3814,8 +3913,8 @@ Index: sope-appserver/NGObjWeb/WebDAV/SoObjectWebDAVDispatcher.m /* DAV access control lists */ Index: sope-appserver/NGObjWeb/WebDAV/SoWebDAVRenderer.m =================================================================== ---- sope-appserver/NGObjWeb/WebDAV/SoWebDAVRenderer.m (révision 1626) -+++ sope-appserver/NGObjWeb/WebDAV/SoWebDAVRenderer.m (copie de travail) +--- sope-appserver/NGObjWeb/WebDAV/SoWebDAVRenderer.m (revision 1626) ++++ sope-appserver/NGObjWeb/WebDAV/SoWebDAVRenderer.m (working copy) @@ -277,7 +277,8 @@ ok = [self renderLockToken:_object inContext:_ctx]; break; @@ -3828,8 +3927,8 @@ Index: sope-appserver/NGObjWeb/WebDAV/SoWebDAVRenderer.m ok = [self renderStatusResult:_object Index: sope-appserver/NGObjWeb/WebDAV/SoObject+SoDAV.h =================================================================== ---- sope-appserver/NGObjWeb/WebDAV/SoObject+SoDAV.h (révision 1626) -+++ sope-appserver/NGObjWeb/WebDAV/SoObject+SoDAV.h (copie de travail) +--- sope-appserver/NGObjWeb/WebDAV/SoObject+SoDAV.h (revision 1626) ++++ sope-appserver/NGObjWeb/WebDAV/SoObject+SoDAV.h (working copy) @@ -62,6 +62,7 @@ properties:(NSDictionary *)_props inContext:(id)_ctx; @@ -3840,8 +3939,8 @@ Index: sope-appserver/NGObjWeb/WebDAV/SoObject+SoDAV.h inContext:(id)_ctx; Index: sope-appserver/NGObjWeb/WODirectAction.m =================================================================== ---- sope-appserver/NGObjWeb/WODirectAction.m (révision 1626) -+++ sope-appserver/NGObjWeb/WODirectAction.m (copie de travail) +--- sope-appserver/NGObjWeb/WODirectAction.m (revision 1626) ++++ sope-appserver/NGObjWeb/WODirectAction.m (working copy) @@ -46,7 +46,7 @@ } - (id)initWithContext:(WOContext *)_ctx { @@ -3875,8 +3974,8 @@ Index: sope-appserver/NGObjWeb/WODirectAction.m Index: sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.m =================================================================== ---- sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.m (révision 1626) -+++ sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.m (copie de travail) +--- sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.m (revision 1626) ++++ sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.m (working copy) @@ -216,6 +216,12 @@ assocCount++; } @@ -3892,8 +3991,8 @@ Index: sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.m Index: sope-appserver/NGObjWeb/DynamicElements/_WOComplexHyperlink.m =================================================================== ---- sope-appserver/NGObjWeb/DynamicElements/_WOComplexHyperlink.m (révision 1626) -+++ sope-appserver/NGObjWeb/DynamicElements/_WOComplexHyperlink.m (copie de travail) +--- sope-appserver/NGObjWeb/DynamicElements/_WOComplexHyperlink.m (revision 1626) ++++ sope-appserver/NGObjWeb/DynamicElements/_WOComplexHyperlink.m (working copy) @@ -41,6 +41,7 @@ WOAssociation *string; WOAssociation *target; @@ -3925,8 +4024,8 @@ Index: sope-appserver/NGObjWeb/DynamicElements/_WOComplexHyperlink.m return NO; Index: sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.h =================================================================== ---- sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.h (révision 1626) -+++ sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.h (copie de travail) +--- sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.h (revision 1626) ++++ sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.h (working copy) @@ -41,7 +41,8 @@ WOAssociation *pageName; WOAssociation *actionClass; @@ -3939,8 +4038,8 @@ Index: sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.h /* 'ivar' associations */ Index: sope-appserver/NGObjWeb/SoObjects/SoObject.m =================================================================== ---- sope-appserver/NGObjWeb/SoObjects/SoObject.m (révision 1626) -+++ sope-appserver/NGObjWeb/SoObjects/SoObject.m (copie de travail) +--- sope-appserver/NGObjWeb/SoObjects/SoObject.m (revision 1626) ++++ sope-appserver/NGObjWeb/SoObjects/SoObject.m (working copy) @@ -39,22 +39,34 @@ static int debugLookup = -1; static int debugBaseURL = -1; @@ -4090,8 +4189,8 @@ Index: sope-appserver/NGObjWeb/SoObjects/SoObject.m Index: sope-appserver/NGObjWeb/SoObjects/SoObject+Traversal.m =================================================================== ---- sope-appserver/NGObjWeb/SoObjects/SoObject+Traversal.m (révision 1626) -+++ sope-appserver/NGObjWeb/SoObjects/SoObject+Traversal.m (copie de travail) +--- sope-appserver/NGObjWeb/SoObjects/SoObject+Traversal.m (revision 1626) ++++ sope-appserver/NGObjWeb/SoObjects/SoObject+Traversal.m (working copy) @@ -195,7 +195,8 @@ isCreateIfMissingMethod = YES; else if ([m isEqualToString:@"PROPPATCH"]) @@ -4104,8 +4203,8 @@ Index: sope-appserver/NGObjWeb/SoObjects/SoObject+Traversal.m // TODO: the following are only create-if-missing on the target! Index: sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m =================================================================== ---- sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m (révision 1626) -+++ sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m (copie de travail) +--- sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m (revision 1626) ++++ sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m (working copy) @@ -32,6 +32,7 @@ #include #include @@ -4129,8 +4228,8 @@ Index: sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m @implementation WOCoreApplication(SimpleParserSelection) Index: sope-appserver/NGObjWeb/Defaults.plist =================================================================== ---- sope-appserver/NGObjWeb/Defaults.plist (révision 1626) -+++ sope-appserver/NGObjWeb/Defaults.plist (copie de travail) +--- sope-appserver/NGObjWeb/Defaults.plist (revision 1626) ++++ sope-appserver/NGObjWeb/Defaults.plist (working copy) @@ -216,7 +216,7 @@ SoWebDAVDisableCrossHostMoveCheck = NO; @@ -4150,8 +4249,8 @@ Index: sope-appserver/NGObjWeb/Defaults.plist DELETE, Index: sope-appserver/NGObjWeb/WORequest.m =================================================================== ---- sope-appserver/NGObjWeb/WORequest.m (révision 1626) -+++ sope-appserver/NGObjWeb/WORequest.m (copie de travail) +--- sope-appserver/NGObjWeb/WORequest.m (revision 1626) ++++ sope-appserver/NGObjWeb/WORequest.m (working copy) @@ -597,6 +597,8 @@ if (r.length > 0) language = [language substringToIndex:r.location]; @@ -4163,8 +4262,8 @@ Index: sope-appserver/NGObjWeb/WORequest.m if ((tmp = [self languageForBrowserLanguageCode:language])) Index: sope-appserver/NGObjWeb/NGHttp/NGHttpRequest.h =================================================================== ---- sope-appserver/NGObjWeb/NGHttp/NGHttpRequest.h (révision 1626) -+++ sope-appserver/NGObjWeb/NGHttp/NGHttpRequest.h (copie de travail) +--- sope-appserver/NGObjWeb/NGHttp/NGHttpRequest.h (revision 1626) ++++ sope-appserver/NGObjWeb/NGHttp/NGHttpRequest.h (working copy) @@ -62,6 +62,10 @@ /* RFC 3253 (DeltaV) */ NGHttpMethod_REPORT, @@ -4178,8 +4277,8 @@ Index: sope-appserver/NGObjWeb/NGHttp/NGHttpRequest.h Index: sope-appserver/NGObjWeb/NGHttp/NGHttpRequest.m =================================================================== ---- sope-appserver/NGObjWeb/NGHttp/NGHttpRequest.m (révision 1626) -+++ sope-appserver/NGObjWeb/NGHttp/NGHttpRequest.m (copie de travail) +--- sope-appserver/NGObjWeb/NGHttp/NGHttpRequest.m (revision 1626) ++++ sope-appserver/NGObjWeb/NGHttp/NGHttpRequest.m (working copy) @@ -59,6 +59,10 @@ /* RFC 3253 (DeltaV) */ @"REPORT", diff --git a/SoObjects/Mailer/SOGoDraftObject.m b/SoObjects/Mailer/SOGoDraftObject.m index 7eb463975..e36d98348 100644 --- a/SoObjects/Mailer/SOGoDraftObject.m +++ b/SoObjects/Mailer/SOGoDraftObject.m @@ -181,7 +181,7 @@ static BOOL showTextAttachmentsInline = NO; { id headerValue; unsigned int count; - NSString *messageID; + NSString *messageID, *priority; for (count = 0; count < 8; count++) { @@ -199,6 +199,29 @@ static BOOL showTextAttachmentsInline = NO; messageID = [self _generateMessageID]; [headers setObject: messageID forKey: @"message-id"]; } + + priority = [newHeaders objectForKey: @"priority"]; + + if (!priority || [priority isEqualToString: @"NORMAL"]) + { + [headers removeObjectForKey: @"X-Priority"]; + } + else if ([priority isEqualToString: @"HIGHEST"]) + { + [headers setObject: @"1 (Highest)" forKey: @"X-Priority"]; + } + else if ([priority isEqualToString: @"HIGH"]) + { + [headers setObject: @"2 (High)" forKey: @"X-Priority"]; + } + else if ([priority isEqualToString: @"LOW"]) + { + [headers setObject: @"4 (Low)" forKey: @"X-Priority"]; + } + else + { + [headers setObject: @"5 (Lowest)" forKey: @"X-Priority"]; + } } - (NSDictionary *) headers @@ -1235,8 +1258,10 @@ static BOOL showTextAttachmentsInline = NO; [map addObject: userAgent forKey: @"User-Agent"]; /* add custom headers */ - -// [self _addHeaders: [lInfo objectForKey: @"headers"] toHeaderMap:map]; + if ([(s = [headers objectForKey: @"X-Priority"]) length] > 0) + [map setObject: s + forKey: @"X-Priority"]; + [self _addHeaders: _headers toHeaderMap: map]; return map; diff --git a/UI/MailerUI/Dutch.lproj/Localizable.strings b/UI/MailerUI/Dutch.lproj/Localizable.strings index 16d9913bb..99523d1f2 100644 --- a/UI/MailerUI/Dutch.lproj/Localizable.strings +++ b/UI/MailerUI/Dutch.lproj/Localizable.strings @@ -79,6 +79,12 @@ "Edit Draft..." = "Concept aanpassen..."; +"highest" = "Highest"; +"high" = "High"; +"normal" = "Normal"; +"low" = "Low"; +"lowest" = "Lowest"; + "This mail is being sent from an unsecure network!" = "Deze e-mail wordt verzonden vanaf een onveilig netwerk!"; /* Popup "show" */ diff --git a/UI/MailerUI/English.lproj/Localizable.strings b/UI/MailerUI/English.lproj/Localizable.strings index 7320cca1d..3c9524724 100644 --- a/UI/MailerUI/English.lproj/Localizable.strings +++ b/UI/MailerUI/English.lproj/Localizable.strings @@ -92,10 +92,15 @@ "bcc" = "Bcc"; "Addressbook" = "Address Book"; -"Anais" = "Anais"; "Edit Draft..." = "Edit Draft..."; +"highest" = "Highest"; +"high" = "High"; +"normal" = "Normal"; +"low" = "Low"; +"lowest" = "Lowest"; + "This mail is being sent from an unsecure network!" = "This mail is being sent from an unsecure network!"; /* Popup "show" */ diff --git a/UI/MailerUI/French.lproj/Localizable.strings b/UI/MailerUI/French.lproj/Localizable.strings index 698120403..6c703ebae 100644 --- a/UI/MailerUI/French.lproj/Localizable.strings +++ b/UI/MailerUI/French.lproj/Localizable.strings @@ -96,6 +96,12 @@ "Edit Draft..." = "Modifier le brouillon..."; +"highest" = "Maximale"; +"high" = "Haute"; +"normal" = "Normale"; +"low" = "Basse"; +"lowest" = "Minimale"; + "This mail is being sent from an unsecure network!" = "Ce mail est envoyé depuis un réseau non sécurisé !"; /* Popup "show" */ diff --git a/UI/MailerUI/German.lproj/Localizable.strings b/UI/MailerUI/German.lproj/Localizable.strings index 9b9ee6586..0a8e7c831 100644 --- a/UI/MailerUI/German.lproj/Localizable.strings +++ b/UI/MailerUI/German.lproj/Localizable.strings @@ -80,6 +80,12 @@ "Edit Draft..." = "Entwurf bearbeiten..."; +"highest" = "Highest"; +"high" = "High"; +"normal" = "Normal"; +"low" = "Low"; +"lowest" = "Lowest"; + "This mail is being sent from an unsecure network!" = "Diese e-Mail wurde von einem unsicheren Netzwerk gesendet!"; /* Popup "show" */ diff --git a/UI/MailerUI/Italian.lproj/Localizable.strings b/UI/MailerUI/Italian.lproj/Localizable.strings index 7057fb6e1..ed874dd86 100644 --- a/UI/MailerUI/Italian.lproj/Localizable.strings +++ b/UI/MailerUI/Italian.lproj/Localizable.strings @@ -102,6 +102,12 @@ "Edit Draft..." = "Modifica bozza..."; +"highest" = "Highest"; +"high" = "High"; +"normal" = "Normal"; +"low" = "Low"; +"lowest" = "Lowest"; + "This mail is being sent from an unsecure network!" = "Questa email è stata spedita da un network contrassegnato come non sicuro!"; /* Popup "show" */ diff --git a/UI/MailerUI/Spanish.lproj/Localizable.strings b/UI/MailerUI/Spanish.lproj/Localizable.strings index 8822a297a..b772b231a 100644 --- a/UI/MailerUI/Spanish.lproj/Localizable.strings +++ b/UI/MailerUI/Spanish.lproj/Localizable.strings @@ -99,6 +99,12 @@ "Edit Draft..." = "Modificar borrador..."; +"highest" = "Highest"; +"high" = "High"; +"normal" = "Normal"; +"low" = "Low"; +"lowest" = "Lowest"; + "This mail is being sent from an unsecure network!" = "Este mendaje es enviado desde una red no segura."; /* Popup "show" */ diff --git a/UI/MailerUI/Toolbars/SOGoDraftObject.toolbar b/UI/MailerUI/Toolbars/SOGoDraftObject.toolbar index c78528b91..e9bdfd5bf 100644 --- a/UI/MailerUI/Toolbars/SOGoDraftObject.toolbar +++ b/UI/MailerUI/Toolbars/SOGoDraftObject.toolbar @@ -27,5 +27,10 @@ cssClass = "tbicon_save"; label = "Save"; tooltip = "Save this message"; }, + { link = "#"; + hasMenu = YES; + label = "Priority"; + onclick = "return onSelectPriority(event);"; + image = "priority.png"; }, ) ) diff --git a/UI/MailerUI/UIxMailEditor.m b/UI/MailerUI/UIxMailEditor.m index dc9f2dedd..a1effdb92 100644 --- a/UI/MailerUI/UIxMailEditor.m +++ b/UI/MailerUI/UIxMailEditor.m @@ -1,6 +1,8 @@ /* Copyright (C) 2004-2005 SKYRIX Software AG + Copyright (C) 2008 Inverse inc. + This file is part of OpenGroupware.org. OGo is free software; you can redistribute it and/or modify it under @@ -64,6 +66,9 @@ NSString *from; SOGoMailFolder *sentFolder; + NSString *priority; + id item; + /* these are for the inline attachment list */ NSString *attachmentName; NSArray *attachmentNames; @@ -85,7 +90,7 @@ static NSArray *infoKeys = nil; infoKeys = [[NSArray alloc] initWithObjects: @"subject", @"to", @"cc", @"bcc", @"from", @"replyTo", @"inReplyTo", - nil]; + @"priority", nil]; /* Internet mail settings */ @@ -100,8 +105,20 @@ static NSArray *infoKeys = nil; [internetMailHeaders count]); } +- (id) init +{ + if ((self = [super init])) + { + [self setPriority: @"NORMAL"]; + } + + return self; +} + - (void) dealloc { + [item release]; + [priority release]; [sentFolder release]; [fromEMails release]; [from release]; @@ -117,6 +134,45 @@ static NSArray *infoKeys = nil; } /* accessors */ +- (void) setItem: (id) _item +{ + ASSIGN (item, _item); +} + +- (id) item +{ + return item; +} + +- (NSArray *) priorityClasses +{ + static NSArray *priorities = nil; + + if (!priorities) + { + priorities = [NSArray arrayWithObjects: @"HIGHEST", @"HIGH", + @"NORMAL", @"LOW", @"LOWEST", nil]; + [priorities retain]; + } + + return priorities; +} + +- (void) setPriority: (NSString *) _priority +{ + ASSIGN(priority, _priority); +} + +- (NSString *) priority +{ + return priority; +} + +- (NSString *) itemPriorityText +{ + return [self labelForKey: [NSString stringWithFormat: @"%@", [item lowercaseString]]]; +} + - (NSString *) isMailReply { return ([to count] > 0 ? @"true" : @"false"); diff --git a/UI/MailerUI/UIxMailListView.m b/UI/MailerUI/UIxMailListView.m index fb3f331d5..059149996 100644 --- a/UI/MailerUI/UIxMailListView.m +++ b/UI/MailerUI/UIxMailListView.m @@ -27,6 +27,7 @@ */ #import +#import #import #import #import @@ -104,6 +105,55 @@ return [dateFormatter formattedDateAndTime: messageDate]; } +// +// Priorities are defined like this: +// +// X-Priority: 1 (Highest) +// X-Priority: 2 (High) +// X-Priority: 3 (Normal) +// X-Priority: 4 (Low) +// X-Priority: 5 (Lowest) +// +// Sometimes, the MUAs don't send over the string in () so we ignore it. +// +- (NSString *) messagePriority +{ + NSString *result; + NSData *data; + + data = [message objectForKey: @"header"]; + result = @""; + + if (data) + { + NSString *s; + + s = [[NSString alloc] initWithData: data + encoding: NSASCIIStringEncoding]; + + if (s) + { + NSRange r; + + [s autorelease]; + r = [s rangeOfString: @":"]; + + if (r.length) + { + s = [[s substringFromIndex: r.location+1] + stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]]; + + if ([s hasPrefix: @"1"]) result = [self labelForKey: @"highest"]; + else if ([s hasPrefix: @"2"]) result = [self labelForKey: @"high"]; + else if ([s hasPrefix: @"4"]) result = [self labelForKey: @"low"]; + else if ([s hasPrefix: @"5"]) result = [self labelForKey: @"lowest"]; + } + } + } + + return result; +} + - (NSString *) messageSubject { id baseSubject; @@ -239,9 +289,8 @@ if (!keys) keys = [[NSArray alloc] initWithObjects: @"UID", - @"FLAGS", @"ENVELOPE", @"RFC822.SIZE", - @"BODYSTRUCTURE", nil]; - + @"FLAGS", @"ENVELOPE", @"RFC822.SIZE", + @"BODYSTRUCTURE", @"BODY[HEADER.FIELDS (X-PRIORITY)]", nil]; return keys; } diff --git a/UI/Templates/MailerUI/UIxMailEditor.wox b/UI/Templates/MailerUI/UIxMailEditor.wox index e8a9bda57..52c97058b 100644 --- a/UI/Templates/MailerUI/UIxMailEditor.wox +++ b/UI/Templates/MailerUI/UIxMailEditor.wox @@ -28,7 +28,19 @@ + +
+ +
    diff --git a/UI/Templates/MailerUI/UIxMailListView.wox b/UI/Templates/MailerUI/UIxMailListView.wox index 26f458bd4..c4434e397 100644 --- a/UI/Templates/MailerUI/UIxMailListView.wox +++ b/UI/Templates/MailerUI/UIxMailListView.wox @@ -26,9 +26,11 @@ > | @@ -107,6 +109,12 @@ > diff --git a/UI/WebServerResources/UIxMailEditor.js b/UI/WebServerResources/UIxMailEditor.js index 64b970e37..b976ee0a4 100644 --- a/UI/WebServerResources/UIxMailEditor.js +++ b/UI/WebServerResources/UIxMailEditor.js @@ -553,6 +553,33 @@ function initMailEditor() { var focusField = (mailIsReply ? textarea : $("addr_0")); focusField.focus(); + + initializePriorityMenu(); +} + +function initializePriorityMenu() { + var priority = $("priority").value.toUpperCase(); + var priorityMenu = $("priority-menu").childNodesWithTag("ul")[0]; + var menuEntries = $(priorityMenu).childNodesWithTag("li"); + var chosenNode; + if (priority == "HIGHEST") + chosenNode = menuEntries[0]; + else if (priority == "HIGH") + chosenNode = menuEntries[1]; + else if (priority == "LOW") + chosenNode = menuEntries[3]; + else if (priority == "LOWEST") + chosenNode = menuEntries[4]; + else + chosenNode = menuEntries[2]; + priorityMenu.chosenNode = chosenNode; + $(chosenNode).addClassName("_chosen"); + + var menuItems = $("itemPriorityList").childNodesWithTag("li"); + for (var i = 0; i < menuItems.length; i++) + menuItems[i].observe("mousedown", + onMenuSetPriority.bindAsEventListener(menuItems[i]), + false); } function getMenus() { @@ -599,6 +626,19 @@ function attachmentDeleteCallback(http) { } } +function onMenuSetPriority(event) { + event.cancelBubble = true; + + var priority = this.getAttribute("priority"); + if (this.parentNode.chosenNode) + this.parentNode.chosenNode.removeClassName("_chosen"); + this.addClassName("_chosen"); + this.parentNode.chosenNode = this; + + var priorityInput = $("priority"); + priorityInput.value = priority; +} + function onSelectAllAttachments() { var list = $("attachments"); var nodes = list.childNodesWithTag("li"); @@ -606,6 +646,17 @@ function onSelectAllAttachments() { nodes[i].selectElement(); } +function onSelectPriority(event) { + if (event.button == 0 || (isSafari() && event.button == 1)) { + var node = getTarget(event); + if (node.tagName != 'BUTTON') + node = $(node).up("button"); + popupToolbarMenu(node, "priority-menu"); + Event.stop(event); + // preventDefault(event); + } +} + function onWindowResize(event) { var textarea = document.pageform.text; var rowheight = (Element.getHeight(textarea) / textarea.rows);