diff --git a/ChangeLog b/ChangeLog index 8bdb7cacc..a58e3df88 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-07-10 Wolfgang Sourdeau + + * 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 * SoObjects/Appointments/SOGoAppointmentFolders.m ([SOGoAppointmentFolders -davCreateCalendarCollection:newNameinContext:createContext]): diff --git a/SoObjects/Appointments/SOGoAppointmentObject.m b/SoObjects/Appointments/SOGoAppointmentObject.m index e93edd831..98d26d73f 100644 --- a/SoObjects/Appointments/SOGoAppointmentObject.m +++ b/SoObjects/Appointments/SOGoAppointmentObject.m @@ -390,7 +390,7 @@ { if ([[attendee rsvp] isEqualToString: @"true"] && [event isStillRelevant]) - [self sendResponseToOrganizer]; + [self sendResponseTo: nil]; organizerUID = [[event organizer] uid]; if (organizerUID) ex = [self _updateAttendee: attendee @@ -533,9 +533,7 @@ [recipientEvent takeAttendeeStatus: attendee]; } #warning fix this when sendEmailUsing blabla has been cleaned up - [self sendEMailUsingTemplateNamed: @"ICalReply" - forOldObject: nil andNewObject: event - toAttendees: [NSArray arrayWithObject: person]]; + [self sendResponseTo: person]; [person release]; [elements addObject: [self _caldavSuccessCodeWithRecipient: recipient]]; diff --git a/SoObjects/Appointments/SOGoCalendarComponent.h b/SoObjects/Appointments/SOGoCalendarComponent.h index a0973e08f..7cb8bb77a 100644 --- a/SoObjects/Appointments/SOGoCalendarComponent.h +++ b/SoObjects/Appointments/SOGoCalendarComponent.h @@ -55,7 +55,7 @@ forOldObject: (iCalRepeatableEntityObject *) _oldObject andNewObject: (iCalRepeatableEntityObject *) _newObject toAttendees: (NSArray *) _attendees; -- (void) sendResponseToOrganizer; +- (void) sendResponseTo: (iCalPerson *) recipient; // - (BOOL) isOrganizerOrOwner: (SOGoUser *) user; diff --git a/SoObjects/Appointments/SOGoCalendarComponent.m b/SoObjects/Appointments/SOGoCalendarComponent.m index 813a1c5af..62a6657fa 100644 --- a/SoObjects/Appointments/SOGoCalendarComponent.m +++ b/SoObjects/Appointments/SOGoCalendarComponent.m @@ -373,11 +373,11 @@ static BOOL sendEMailNotifications = NO; } } -- (void) sendResponseToOrganizer +- (void) sendResponseTo: (iCalPerson *) recipient { NSString *pageName, *language, *mailDate, *email; WOApplication *app; - iCalPerson *organizer, *attendee; + iCalPerson *attendee; NSString *iCalString; iCalEvent *event; SOGoAptMailICalReply *p; @@ -392,7 +392,8 @@ static BOOL sendEMailNotifications = NO; event = [[self component: NO secure: NO] itipEntryWithMethod: @"reply"]; if (![event userIsOrganizer: [context activeUser]]) { - organizer = [event organizer]; + if (!recipient) + recipient = [event organizer]; attendee = [event findParticipant: [context activeUser]]; [event setAttendees: [NSArray arrayWithObject: attendee]]; @@ -418,14 +419,14 @@ static BOOL sendEMailNotifications = NO; */ [headerMap setObject: @"multipart/mixed" forKey: @"content-type"]; [headerMap setObject: [attendee mailAddress] forKey: @"from"]; - [headerMap setObject: [organizer mailAddress] forKey: @"to"]; + [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]; NSLog (@"sending 'REPLY' from %@ to %@", - [attendee mailAddress], [organizer mailAddress]); + [attendee mailAddress], [recipient mailAddress]); /* multipart body */ body = [[NGMimeMultipartBody alloc] initWithPart: msg]; @@ -457,7 +458,7 @@ static BOOL sendEMailNotifications = NO; [body release]; /* send the damn thing */ - email = [organizer rfc822Email]; + email = [recipient rfc822Email]; [[SOGoMailer sharedMailer] sendMimePart: msg toRecipients: [NSArray arrayWithObject: email] diff --git a/SoObjects/Contacts/SOGoContactFolders.m b/SoObjects/Contacts/SOGoContactFolders.m index 3354a691a..ac645dc5c 100644 --- a/SoObjects/Contacts/SOGoContactFolders.m +++ b/SoObjects/Contacts/SOGoContactFolders.m @@ -28,6 +28,7 @@ JournalItems IPF.Journal */ #import +#import #import #import diff --git a/UI/MailPartViewers/UIxMailPartICalActions.m b/UI/MailPartViewers/UIxMailPartICalActions.m index 77cd6e767..3ec5019e7 100644 --- a/UI/MailPartViewers/UIxMailPartICalActions.m +++ b/UI/MailPartViewers/UIxMailPartICalActions.m @@ -217,7 +217,7 @@ rsvp = nil; [eventObject saveContentString: [calendar versitString]]; if ([rsvp isEqualToString: @"true"]) - [eventObject sendResponseToOrganizer]; + [eventObject sendResponseTo: nil]; organizerUID = [[chosenEvent organizer] uid]; if (organizerUID) [self _updateAttendee: user withSequence: [chosenEvent sequence]