Monotone-Parent: 76c9100436fa0dc82d0c5810c4defbc26164b700
Monotone-Revision: 130c60706cf2d64c1389d2675c1cffcb607d2717 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-02-04T03:50:21 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
350a9fb8bf
commit
a9b6bec242
|
@ -1,5 +1,9 @@
|
|||
2011-02-03 Ludovic Marcotte <lmarcotte@inverse.ca>
|
||||
|
||||
* OpenChange/MAPIStoreCalendarContext.m
|
||||
(-openMessage:forKey:inTable:): overriden method to return
|
||||
attendees as recipients.
|
||||
|
||||
* OpenChange/SOGoMAPIFSMessage.m (-delete): implemented method.
|
||||
(-setMAPIProperties:): append the new properties to the existing
|
||||
ones instead of replacing them.
|
||||
|
|
|
@ -30,13 +30,17 @@
|
|||
#import <Appointments/SOGoAppointmentFolders.h>
|
||||
#import <Appointments/SOGoAppointmentObject.h>
|
||||
|
||||
#import <NGCards/iCalPerson.h>
|
||||
|
||||
#import "MAPIApplication.h"
|
||||
#import "MAPIStoreAuthenticator.h"
|
||||
#import "MAPIStoreCalendarMessageTable.h"
|
||||
#import "MAPIStoreMapping.h"
|
||||
#import "MAPIStoreTypes.h"
|
||||
#import "SOGoGCSFolder+MAPIStore.h"
|
||||
|
||||
#import "MAPIStoreCalendarContext.h"
|
||||
#import "NSString+MAPIStore.h"
|
||||
|
||||
#undef DEBUG
|
||||
#include <mapistore/mapistore.h>
|
||||
|
@ -99,4 +103,63 @@
|
|||
return [MAPIStoreCalendarMessageTable class];
|
||||
}
|
||||
|
||||
- (int) openMessage: (struct mapistore_message *) msg
|
||||
forKey: (NSString *) childKey
|
||||
inTable: (MAPIStoreTable *) table
|
||||
{
|
||||
NSString *name, *email;
|
||||
NSArray *attendees;
|
||||
iCalPerson *person;
|
||||
id event;
|
||||
struct SRowSet *recipients;
|
||||
int count, max, rc;
|
||||
|
||||
rc = [super openMessage: msg forKey: childKey inTable: table];
|
||||
|
||||
if (rc == MAPI_E_SUCCESS && table == messageTable)
|
||||
{
|
||||
event = [[table lookupChild: childKey] component: NO secure: NO];
|
||||
attendees = [event attendees];
|
||||
max = [attendees count];
|
||||
|
||||
recipients = msg->recipients;
|
||||
recipients->cRows = max;
|
||||
recipients->aRow = talloc_array (recipients, struct SRow, max);
|
||||
|
||||
for (count = 0; count < max; count++)
|
||||
{
|
||||
recipients->aRow[count].ulAdrEntryPad = 0;
|
||||
recipients->aRow[count].cValues = 3;
|
||||
recipients->aRow[count].lpProps = talloc_array (recipients->aRow,
|
||||
struct SPropValue,
|
||||
3);
|
||||
|
||||
// TODO (0x01 = primary recipient)
|
||||
set_SPropValue_proptag (&(recipients->aRow[count].lpProps[0]),
|
||||
PR_RECIPIENT_TYPE,
|
||||
MAPILongValue (memCtx, 0x01));
|
||||
|
||||
person = [attendees objectAtIndex: count];
|
||||
|
||||
name = [person cn];
|
||||
if (!name)
|
||||
name = @"";
|
||||
|
||||
email = [person email];
|
||||
if (!email)
|
||||
email = @"";
|
||||
|
||||
set_SPropValue_proptag (&(recipients->aRow[count].lpProps[1]),
|
||||
PR_DISPLAY_NAME,
|
||||
[name asUnicodeInMemCtx: recipients->aRow[count].lpProps]);
|
||||
set_SPropValue_proptag (&(recipients->aRow[count].lpProps[2]),
|
||||
PR_EMAIL_ADDRESS,
|
||||
[email asUnicodeInMemCtx: recipients->aRow[count].lpProps]);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Loading…
Reference in New Issue