Monotone-Parent: 90d12047f041f8515efbf14e53d72f0e23f40633

Monotone-Revision: d21cefd93fac803cfbe8968d3756327533467537

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2008-08-09T15:20:56
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2008-08-09 15:20:56 +00:00
parent 0af9477392
commit 846d28a2bf
2 changed files with 32 additions and 9 deletions

View File

@ -1,5 +1,14 @@
2008-08-09 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/Appointments/SOGoCalendarComponent.m
([SOGoCalendarComponent
-sendEMailUsingTemplateNamed:_pageNameforOldObject:_oldObjectandNewObject:_newObjecttoAttendees:_attendees]):
the sender email is always the one of the owner, even though the
action might be done by a delegate. If the case, we setup the
"SENT-BY" parameter of the organizer field.
([SOGoCalendarComponent -sendResponseToOrganizer]): If needed,
setup the "SENT-BY" parameter of the attendee field.
* UI/Scheduler/UIxComponentEditor.m ([UIxComponentEditor
-toolbar]): changed algoritm so that a delegate would really see
what the owner would, depending on his/her rights.

View File

@ -451,6 +451,20 @@ _occurenceHasID (iCalRepeatableEntityObject *occurence, NSString *recID)
return [[SOGoUser userWithLogin: uid roles: nil] timeZone];
}
- (void) _setupSentByIfNeeded: (iCalPerson *) person
{
SOGoUser *currentUser;
NSString *currentEmail;
currentUser = [context activeUser];
if (![[currentUser login] isEqualToString: owner])
{
currentEmail = [[currentUser allEmails] objectAtIndex: 0];
[person addAttribute: @"SENT-BY"
value: [NSString stringWithFormat: @"MAILTO:%@", currentEmail]];
}
}
- (void) sendEMailUsingTemplateNamed: (NSString *) _pageName
forOldObject: (iCalRepeatableEntityObject *) _oldObject
andNewObject: (iCalRepeatableEntityObject *) _newObject
@ -468,7 +482,7 @@ _occurenceHasID (iCalRepeatableEntityObject *occurence, NSString *recID)
NGMimeMessage *msg;
NGMimeBodyPart *bodyPart;
NGMimeMultipartBody *body;
SOGoUser *currentUser;
SOGoUser *ownerUser, *currentUser;
if (sendEMailNotifications
&& [_newObject isStillRelevant])
@ -477,17 +491,17 @@ _occurenceHasID (iCalRepeatableEntityObject *occurence, NSString *recID)
if (count)
{
/* sender */
ownerUser = [SOGoUser userWithLogin: owner roles: nil];
currentUser = [context activeUser];
shortSenderEmail = [[currentUser allEmails] objectAtIndex: 0];
senderEmail = [NSString stringWithFormat: @"%@ <%@>",
[currentUser cn], shortSenderEmail];
NSLog (@"sending '%@' from %@",
[(iCalCalendar *) [_newObject parent] method], senderEmail);
[ownerUser cn], shortSenderEmail];
[self _setupSentByIfNeeded: [_newObject organizer]];
// NSLog (@"sending '%@' from %@",
// [(iCalCalendar *) [_newObject parent] method], senderEmail);
/* generate iCalString once */
iCalString = [[_newObject parent] versitString];
/* get WOApplication instance */
app = [WOApplication application];
@ -502,8 +516,7 @@ _occurenceHasID (iCalRepeatableEntityObject *occurence, NSString *recID)
recipient = [attendee mailAddress];
email = [attendee rfc822Email];
NSLog (@"recipient: %@", recipient);
language = [[context activeUser] language];
language = [ownerUser language];
#warning this could be optimized in a class hierarchy common with the \
SOGoObject acl notification mechanism
/* create page name */
@ -676,6 +689,7 @@ _occurenceHasID (iCalRepeatableEntityObject *occurence, NSString *recID)
{
organizer = [event organizer];
attendee = [event findParticipant: ownerUser];
[self _setupSentByIfNeeded: attendee];
[event setAttendees: [NSArray arrayWithObject: attendee]];
[self sendIMIPReplyForEvent: event to: organizer];
}