From 1aa527535b885ace3836779c1b188f330cd8dd58 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 8 Jul 2008 15:40:47 +0000 Subject: [PATCH] Monotone-Parent: 54264028f33a54d13b69aeb1d296454517d33171 Monotone-Revision: 2e93af5446f533d239d1daf98838f4049e3256a0 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-07-08T15:40:47 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 7 +++++++ SoObjects/Appointments/SOGoCalendarComponent.m | 16 +++++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 79deaa84c..e78b9f2a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-07-08 Wolfgang Sourdeau + + * SoObjects/Appointments/SOGoCalendarComponent.m + ([SOGoCalendarComponent + -sendEMailUsingTemplateNamed:_pageNameforOldObject:_oldObjectandNewObject:_newObjecttoAttendees:_attendees]): + take the current user as originator rather than the object's owner. + 2008-07-04 Wolfgang Sourdeau * SoObjects/SOGo/SOGoObject.m ([SOGoObject diff --git a/SoObjects/Appointments/SOGoCalendarComponent.m b/SoObjects/Appointments/SOGoCalendarComponent.m index 636193bb0..813a1c5af 100644 --- a/SoObjects/Appointments/SOGoCalendarComponent.m +++ b/SoObjects/Appointments/SOGoCalendarComponent.m @@ -256,8 +256,7 @@ static BOOL sendEMailNotifications = NO; toAttendees: (NSArray *) _attendees { NSString *pageName; - iCalPerson *organizer; - NSString *email, *sender, *iCalString; + NSString *senderEmail, *shortSenderEmail, *email, *iCalString; WOApplication *app; unsigned i, count; iCalPerson *attendee; @@ -268,6 +267,7 @@ static BOOL sendEMailNotifications = NO; NGMimeMessage *msg; NGMimeBodyPart *bodyPart; NGMimeMultipartBody *body; + SOGoUser *currentUser; if (sendEMailNotifications && [_newObject isStillRelevant]) @@ -276,11 +276,13 @@ static BOOL sendEMailNotifications = NO; if (count) { /* sender */ - organizer = [_newObject organizer]; - sender = [organizer mailAddress]; + currentUser = [context activeUser]; + shortSenderEmail = [[currentUser allEmails] objectAtIndex: 0]; + senderEmail = [NSString stringWithFormat: @"%@ <%@>", + [currentUser cn], shortSenderEmail]; NSLog (@"sending '%@' from %@", - [(iCalCalendar *) [_newObject parent] method], organizer); + [(iCalCalendar *) [_newObject parent] method], senderEmail); /* generate iCalString once */ iCalString = [[_newObject parent] versitString]; @@ -324,7 +326,7 @@ static BOOL sendEMailNotifications = NO; * so we'll stick with multipart/mixed for the time being. */ [headerMap setObject: @"multipart/mixed" forKey: @"content-type"]; - [headerMap setObject: sender forKey: @"from"]; + [headerMap setObject: senderEmail forKey: @"from"]; [headerMap setObject: recipient forKey: @"to"]; mailDate = [[NSCalendarDate date] rfc822DateString]; [headerMap setObject: mailDate forKey: @"date"]; @@ -364,7 +366,7 @@ static BOOL sendEMailNotifications = NO; [[SOGoMailer sharedMailer] sendMimePart: msg toRecipients: [NSArray arrayWithObject: email] - sender: [organizer rfc822Email]]; + sender: shortSenderEmail]; } } }