Monotone-Parent: 2cb4c559e76b3864636b0072594c02216e619485

Monotone-Revision: 6573eb6d5779706b5935161822c561cf325f7fa6

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2011-07-20T18:30:05
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau 2011-07-20 18:30:05 +00:00
parent 95fb350599
commit f438ad520f
4 changed files with 18 additions and 3 deletions

View file

@ -1,5 +1,8 @@
2011-07-20 Wolfgang Sourdeau <wsourdeau@inverse.ca> 2011-07-20 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* OpenChange/MAPIStoreMailMessage.m (-subject): new overridable
accessor common to certain properties.
* OpenChange/MAPIStoreObject.m: moved "-getEmptyString:inMemCtx:", * OpenChange/MAPIStoreObject.m: moved "-getEmptyString:inMemCtx:",
"-getLongZero:inMemCtx:", "-getYes:inMemCtx:", "-getNo:inMemCtx:" "-getLongZero:inMemCtx:", "-getYes:inMemCtx:", "-getNo:inMemCtx:"
into NSObject+MAPIStore.m into NSObject+MAPIStore.m

View file

@ -214,6 +214,11 @@ e)
[self logWithFormat: @"ignored scheduling message"]; [self logWithFormat: @"ignored scheduling message"];
} }
- (NSString *) subject
{
return [[sogoObject headers] objectForKey: @"subject"];
}
- (NSCalendarDate *) creationTime - (NSCalendarDate *) creationTime
{ {
return [newProperties objectForKey: MAPIPropertyKey (PR_CREATION_TIME)]; return [newProperties objectForKey: MAPIPropertyKey (PR_CREATION_TIME)];

View file

@ -37,6 +37,8 @@
NSString *bodyCharset; NSString *bodyCharset;
} }
- (NSString *) subject;
@end @end
#endif /* MAPISTOREMAILMESSAGE_H */ #endif /* MAPISTOREMAILMESSAGE_H */

View file

@ -144,12 +144,17 @@ static Class NSExceptionK, MAPIStoreSentItemsFolderK, MAPIStoreDraftsFolderK;
return MAPISTORE_SUCCESS; return MAPISTORE_SUCCESS;
} }
- (NSString *) subject
{
return [sogoObject decodedSubject];
}
- (int) getPrSubject: (void **) data - (int) getPrSubject: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx inMemCtx: (TALLOC_CTX *) memCtx
{ {
NSString *stringValue; NSString *stringValue;
stringValue = [sogoObject decodedSubject]; stringValue = [self subject];
if (!stringValue) if (!stringValue)
stringValue = @""; stringValue = @"";
*data = [stringValue asUnicodeInMemCtx: memCtx]; *data = [stringValue asUnicodeInMemCtx: memCtx];
@ -164,7 +169,7 @@ static Class NSExceptionK, MAPIStoreSentItemsFolderK, MAPIStoreDraftsFolderK;
NSUInteger colIdx; NSUInteger colIdx;
NSString *stringValue; NSString *stringValue;
subject = [sogoObject decodedSubject]; subject = [self subject];
colIdx = [subject rangeOfString: @":"].location; colIdx = [subject rangeOfString: @":"].location;
if (colIdx != NSNotFound && colIdx < 4) if (colIdx != NSNotFound && colIdx < 4)
stringValue = [NSString stringWithFormat: @"%@: ", stringValue = [NSString stringWithFormat: @"%@: ",
@ -183,7 +188,7 @@ static Class NSExceptionK, MAPIStoreSentItemsFolderK, MAPIStoreDraftsFolderK;
NSUInteger colIdx; NSUInteger colIdx;
NSString *stringValue; NSString *stringValue;
subject = [sogoObject decodedSubject]; subject = [self subject];
colIdx = [subject rangeOfString: @":"].location; colIdx = [subject rangeOfString: @":"].location;
if (colIdx != NSNotFound && colIdx < 4) if (colIdx != NSNotFound && colIdx < 4)
stringValue = [[subject substringFromIndex: colIdx + 1] stringValue = [[subject substringFromIndex: colIdx + 1]