Monotone-Parent: d8176e69adb43439b407009e5a278940e900bab3
Monotone-Revision: 519b35b472d44f41b6d49bd13a634936f034f790 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-07-10T15:11:01 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
parent
23c75ba8ad
commit
095cb07f17
|
@ -1,10 +1,3 @@
|
|||
2008-07-10 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* SoObjects/Appointments/SOGoCalendarComponent.m
|
||||
([SOGoCalendarComponent -sendResponseTo:recipient]): method
|
||||
renamed from 'sendResponseToOrganizer' and which now takes an
|
||||
optional argument indicating the recipient of the REPLY.
|
||||
|
||||
2008-07-09 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* SoObjects/Appointments/SOGoAppointmentFolders.m ([SOGoAppointmentFolders -davCreateCalendarCollection:newNameinContext:createContext]):
|
||||
|
|
|
@ -390,7 +390,7 @@
|
|||
{
|
||||
if ([[attendee rsvp] isEqualToString: @"true"]
|
||||
&& [event isStillRelevant])
|
||||
[self sendResponseTo: nil];
|
||||
[self sendResponseToOrganizer];
|
||||
organizerUID = [[event organizer] uid];
|
||||
if (organizerUID)
|
||||
ex = [self _updateAttendee: attendee
|
||||
|
@ -533,7 +533,9 @@
|
|||
[recipientEvent takeAttendeeStatus: attendee];
|
||||
}
|
||||
#warning fix this when sendEmailUsing blabla has been cleaned up
|
||||
[self sendResponseTo: person];
|
||||
[self sendEMailUsingTemplateNamed: @"ICalReply"
|
||||
forOldObject: nil andNewObject: event
|
||||
toAttendees: [NSArray arrayWithObject: person]];
|
||||
[person release];
|
||||
[elements
|
||||
addObject: [self _caldavSuccessCodeWithRecipient: recipient]];
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
forOldObject: (iCalRepeatableEntityObject *) _oldObject
|
||||
andNewObject: (iCalRepeatableEntityObject *) _newObject
|
||||
toAttendees: (NSArray *) _attendees;
|
||||
- (void) sendResponseTo: (iCalPerson *) recipient;
|
||||
- (void) sendResponseToOrganizer;
|
||||
|
||||
// - (BOOL) isOrganizerOrOwner: (SOGoUser *) user;
|
||||
|
||||
|
|
|
@ -373,11 +373,11 @@ static BOOL sendEMailNotifications = NO;
|
|||
}
|
||||
}
|
||||
|
||||
- (void) sendResponseTo: (iCalPerson *) recipient
|
||||
- (void) sendResponseToOrganizer
|
||||
{
|
||||
NSString *pageName, *language, *mailDate, *email;
|
||||
WOApplication *app;
|
||||
iCalPerson *attendee;
|
||||
iCalPerson *organizer, *attendee;
|
||||
NSString *iCalString;
|
||||
iCalEvent *event;
|
||||
SOGoAptMailICalReply *p;
|
||||
|
@ -386,88 +386,82 @@ static BOOL sendEMailNotifications = NO;
|
|||
NGMimeBodyPart *bodyPart;
|
||||
NGMimeMultipartBody *body;
|
||||
NSData *bodyData;
|
||||
SOGoUser *ownerUser;
|
||||
|
||||
if (sendEMailNotifications)
|
||||
{
|
||||
ownerUser = [SOGoUser userWithLogin: owner roles: nil];
|
||||
event = [[self component: NO secure: NO] itipEntryWithMethod: @"reply"];
|
||||
if (![event userIsOrganizer: ownerUser])
|
||||
if (![event userIsOrganizer: [context activeUser]])
|
||||
{
|
||||
if (!recipient)
|
||||
recipient = [event organizer];
|
||||
attendee = [event findParticipant: ownerUser];
|
||||
if (attendee)
|
||||
{
|
||||
[event setAttendees: [NSArray arrayWithObject: attendee]];
|
||||
organizer = [event organizer];
|
||||
attendee = [event findParticipant: [context activeUser]];
|
||||
[event setAttendees: [NSArray arrayWithObject: attendee]];
|
||||
|
||||
/* get WOApplication instance */
|
||||
app = [WOApplication application];
|
||||
/* get WOApplication instance */
|
||||
app = [WOApplication application];
|
||||
|
||||
language = [ownerUser language];
|
||||
/* create page name */
|
||||
pageName
|
||||
= [NSString stringWithFormat: @"SOGoAptMail%@ICalReply", language];
|
||||
/* construct message content */
|
||||
p = [app pageWithName: pageName inContext: context];
|
||||
[p setApt: event];
|
||||
[p setAttendee: attendee];
|
||||
language = [[context activeUser] language];
|
||||
/* create page name */
|
||||
pageName
|
||||
= [NSString stringWithFormat: @"SOGoAptMail%@ICalReply", language];
|
||||
/* construct message content */
|
||||
p = [app pageWithName: pageName inContext: context];
|
||||
[p setApt: event];
|
||||
[p setAttendee: attendee];
|
||||
|
||||
/* construct message */
|
||||
headerMap = [NGMutableHashMap hashMapWithCapacity: 5];
|
||||
/* construct message */
|
||||
headerMap = [NGMutableHashMap hashMapWithCapacity: 5];
|
||||
|
||||
/* NOTE: multipart/alternative seems like the correct choice but
|
||||
* unfortunately Thunderbird doesn't offer the rich content alternative
|
||||
* at all. Mail.app shows the rich content alternative _only_
|
||||
* so we'll stick with multipart/mixed for the time being.
|
||||
*/
|
||||
[headerMap setObject: @"multipart/mixed" forKey: @"content-type"];
|
||||
[headerMap setObject: [attendee mailAddress] forKey: @"from"];
|
||||
[headerMap setObject: [recipient mailAddress] forKey: @"to"];
|
||||
mailDate = [[NSCalendarDate date] rfc822DateString];
|
||||
[headerMap setObject: mailDate forKey: @"date"];
|
||||
[headerMap setObject: [p getSubject] forKey: @"subject"];
|
||||
msg = [NGMimeMessage messageWithHeader: headerMap];
|
||||
/* NOTE: multipart/alternative seems like the correct choice but
|
||||
* unfortunately Thunderbird doesn't offer the rich content alternative
|
||||
* at all. Mail.app shows the rich content alternative _only_
|
||||
* so we'll stick with multipart/mixed for the time being.
|
||||
*/
|
||||
[headerMap setObject: @"multipart/mixed" forKey: @"content-type"];
|
||||
[headerMap setObject: [attendee mailAddress] forKey: @"from"];
|
||||
[headerMap setObject: [organizer mailAddress] forKey: @"to"];
|
||||
mailDate = [[NSCalendarDate date] rfc822DateString];
|
||||
[headerMap setObject: mailDate forKey: @"date"];
|
||||
[headerMap setObject: [p getSubject] forKey: @"subject"];
|
||||
msg = [NGMimeMessage messageWithHeader: headerMap];
|
||||
|
||||
NSLog (@"sending 'REPLY' from %@ to %@",
|
||||
[attendee mailAddress], [recipient mailAddress]);
|
||||
NSLog (@"sending 'REPLY' from %@ to %@",
|
||||
[attendee mailAddress], [organizer mailAddress]);
|
||||
|
||||
/* multipart body */
|
||||
body = [[NGMimeMultipartBody alloc] initWithPart: msg];
|
||||
/* multipart body */
|
||||
body = [[NGMimeMultipartBody alloc] initWithPart: msg];
|
||||
|
||||
/* text part */
|
||||
headerMap = [NGMutableHashMap hashMapWithCapacity: 1];
|
||||
[headerMap setObject: @"text/plain; charset=utf-8"
|
||||
forKey: @"content-type"];
|
||||
bodyPart = [NGMimeBodyPart bodyPartWithHeader: headerMap];
|
||||
bodyData = [[p getBody] dataUsingEncoding: NSUTF8StringEncoding];
|
||||
[bodyPart setBody: bodyData];
|
||||
/* text part */
|
||||
headerMap = [NGMutableHashMap hashMapWithCapacity: 1];
|
||||
[headerMap setObject: @"text/plain; charset=utf-8"
|
||||
forKey: @"content-type"];
|
||||
bodyPart = [NGMimeBodyPart bodyPartWithHeader: headerMap];
|
||||
bodyData = [[p getBody] dataUsingEncoding: NSUTF8StringEncoding];
|
||||
[bodyPart setBody: bodyData];
|
||||
|
||||
/* attach text part to multipart body */
|
||||
[body addBodyPart: bodyPart];
|
||||
/* attach text part to multipart body */
|
||||
[body addBodyPart: bodyPart];
|
||||
|
||||
/* calendar part */
|
||||
headerMap = [NGMutableHashMap hashMapWithCapacity: 1];
|
||||
[headerMap setObject: @"text/calendar; method=REPLY; charset=utf-8"
|
||||
forKey: @"content-type"];
|
||||
bodyPart = [NGMimeBodyPart bodyPartWithHeader: headerMap];
|
||||
iCalString = [[event parent] versitString];
|
||||
[bodyPart setBody: [iCalString dataUsingEncoding: NSUTF8StringEncoding]];
|
||||
/* calendar part */
|
||||
headerMap = [NGMutableHashMap hashMapWithCapacity: 1];
|
||||
[headerMap setObject: @"text/calendar; method=REPLY; charset=utf-8"
|
||||
forKey: @"content-type"];
|
||||
bodyPart = [NGMimeBodyPart bodyPartWithHeader: headerMap];
|
||||
iCalString = [[event parent] versitString];
|
||||
[bodyPart setBody: [iCalString dataUsingEncoding: NSUTF8StringEncoding]];
|
||||
|
||||
/* attach calendar part to multipart body */
|
||||
[body addBodyPart: bodyPart];
|
||||
/* attach calendar part to multipart body */
|
||||
[body addBodyPart: bodyPart];
|
||||
|
||||
/* attach multipart body to message */
|
||||
[msg setBody: body];
|
||||
[body release];
|
||||
/* attach multipart body to message */
|
||||
[msg setBody: body];
|
||||
[body release];
|
||||
|
||||
/* send the damn thing */
|
||||
email = [recipient rfc822Email];
|
||||
[[SOGoMailer sharedMailer]
|
||||
sendMimePart: msg
|
||||
toRecipients: [NSArray arrayWithObject: email]
|
||||
sender: [attendee rfc822Email]];
|
||||
}
|
||||
/* send the damn thing */
|
||||
email = [organizer rfc822Email];
|
||||
[[SOGoMailer sharedMailer]
|
||||
sendMimePart: msg
|
||||
toRecipients: [NSArray arrayWithObject: email]
|
||||
sender: [attendee rfc822Email]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
JournalItems IPF.Journal */
|
||||
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <Foundation/NSString.h>
|
||||
#import <Foundation/NSEnumerator.h>
|
||||
|
||||
|
|
|
@ -217,7 +217,7 @@
|
|||
rsvp = nil;
|
||||
[eventObject saveContentString: [calendar versitString]];
|
||||
if ([rsvp isEqualToString: @"true"])
|
||||
[eventObject sendResponseTo: nil];
|
||||
[eventObject sendResponseToOrganizer];
|
||||
organizerUID = [[chosenEvent organizer] uid];
|
||||
if (organizerUID)
|
||||
[self _updateAttendee: user withSequence: [chosenEvent sequence]
|
||||
|
|
Loading…
Reference in a new issue