Monotone-Parent: fffc8593a1392a49172e584c88de206cd6d7081b

Monotone-Revision: 6482adea519086d475da864618f587552d0acbf1

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2010-12-13T17:07:24
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau 2010-12-13 17:07:24 +00:00
parent ad416ef1e0
commit 0ae53f51d8

View file

@ -1,12 +1,12 @@
/* SOGoDraftObject+MAPIStore.m - this file is part of SOGo /* SOGoDraftObject+MAPIStore.m - this file is part of SOGo
* *
* Copyright (C) 2010 Wolfgang Sourdeau * Copyright (C) 2010 Inverse inc.
* *
* Author: Wolfgang Sourdeau <root@inverse.ca> * Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
* *
* This file is free software; you can redistribute it and/or modify * This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option) * the Free Software Foundation; either version 3, or (at your option)
* any later version. * any later version.
* *
* This file is distributed in the hope that it will be useful, * This file is distributed in the hope that it will be useful,
@ -26,6 +26,8 @@
#import <NGObjWeb/WOContext+SoObjects.h> #import <NGObjWeb/WOContext+SoObjects.h>
#import <NGExtensions/NSObject+Logs.h>
#import <SOGo/NSArray+Utilities.h> #import <SOGo/NSArray+Utilities.h>
#import <SOGo/NSDictionary+Utilities.h> #import <SOGo/NSDictionary+Utilities.h>
#import <SOGo/SOGoUser.h> #import <SOGo/SOGoUser.h>
@ -46,10 +48,10 @@
NSUInteger count; NSUInteger count;
id value; id value;
// MAPIStoreDumpMessageProperties (properties);
newHeaders = [NSMutableDictionary dictionaryWithCapacity: 6]; newHeaders = [NSMutableDictionary dictionaryWithCapacity: 6];
recipients = [properties objectForKey: @"recipients"]; recipients = [properties objectForKey: @"recipients"];
if (recipients)
{
for (count = 0; count < 3; count++) for (count = 0; count < 3; count++)
{ {
recId = recIds[count]; recId = recIds[count];
@ -59,6 +61,9 @@
notFoundMarker: nil] notFoundMarker: nil]
forKey: recId]; forKey: recId];
} }
}
else
[self errorWithFormat: @"message without recipients"];
/* /*
message properties (20): message properties (20):
@ -70,7 +75,7 @@ e)
2010-11-24 13:45:38.715 samba[25685] 0x0e62000b (PR_URL_COMP_NAME_SET): 2010-11-24 13:45:38.715 samba[25685] 0x0e62000b (PR_URL_COMP_NAME_SET):
0 (NSIntNumber) */ 0 (NSIntNumber) */
value = [properties objectForKey: MAPIPropertyNumber (PR_SUBJECT_UNICODE)]; value = [properties objectForKey: MAPIPropertyKey (PR_SUBJECT_UNICODE)];
if (value) if (value)
[newHeaders setObject: value forKey: @"subject"]; [newHeaders setObject: value forKey: @"subject"];
@ -79,7 +84,7 @@ e)
forKey: @"from"]; forKey: @"from"];
[self setHeaders: newHeaders]; [self setHeaders: newHeaders];
value = [properties objectForKey: MAPIPropertyNumber (PR_HTML)]; value = [properties objectForKey: MAPIPropertyKey (PR_HTML)];
if (value) if (value)
{ {
[self setIsHTML: YES]; [self setIsHTML: YES];
@ -91,7 +96,7 @@ e)
} }
else else
{ {
value = [properties objectForKey: MAPIPropertyNumber (PR_BODY_UNICODE)]; value = [properties objectForKey: MAPIPropertyKey (PR_BODY_UNICODE)];
if (value) if (value)
{ {
[self setIsHTML: NO]; [self setIsHTML: NO];
@ -102,11 +107,13 @@ e)
- (void) MAPISubmit - (void) MAPISubmit
{ {
[self logWithFormat: @"sending message"];
[self sendMail]; [self sendMail];
} }
- (void) MAPISave - (void) MAPISave
{ {
[self logWithFormat: @"saving message"];
[self save]; [self save];
} }