mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-06 17:05:10 +00:00
Monotone-Parent: 69cc1831846c1c973825222eaf0faa27fa99c1b9
Monotone-Revision: 1ccdfc75b1ed2e0fae716ec0b1a616d696394d3e Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-02-05T22:26:39 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
2008-02-05 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* UI/MailPartViewers/UIxMailPartICalActions.m ([UIxMailPartICalActions -acceptAction])
|
||||
([UIxMailPartICalActions -declineAction]): define the organizer of
|
||||
the event as one of the reply-to or from addresses whenever the
|
||||
organizer is not specified in those Outlook invitations.
|
||||
|
||||
2008-02-01 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* UI/MailerUI/UIxMailMainFrame.m ([UIxMailMainFrame
|
||||
|
||||
@@ -25,6 +25,9 @@
|
||||
#import <NGObjWeb/WOContext+SoObjects.h>
|
||||
#import <NGObjWeb/WOResponse.h>
|
||||
|
||||
#import <NGExtensions/NSNull+misc.h>
|
||||
#import <NGExtensions/NSObject+Logs.h>
|
||||
|
||||
#import <NGCards/iCalCalendar.h>
|
||||
#import <NGCards/iCalEvent.h>
|
||||
#import <NGCards/iCalPerson.h>
|
||||
@@ -93,10 +96,46 @@
|
||||
return [self _eventObjectWithUID: uid forUser: [context activeUser]];
|
||||
}
|
||||
|
||||
- (void) _fixOrganizerInEvent: (iCalEvent *) brokenEvent
|
||||
{
|
||||
iCalPerson *organizer;
|
||||
SOGoMailObject *mail;
|
||||
NSArray *addresses;
|
||||
NGImap4EnvelopeAddress *from;
|
||||
id value;
|
||||
|
||||
organizer = nil;
|
||||
|
||||
mail = [[self clientObject] mailObject];
|
||||
|
||||
addresses = [mail replyToEnvelopeAddresses];
|
||||
if (![addresses count])
|
||||
addresses = [mail fromEnvelopeAddresses];
|
||||
if ([addresses count] > 0)
|
||||
{
|
||||
from = [addresses objectAtIndex: 0];
|
||||
value = [from baseEMail];
|
||||
if ([value isNotNull])
|
||||
{
|
||||
organizer = [iCalPerson elementWithTag: @"organizer"];
|
||||
[organizer setEmail: value];
|
||||
value = [from personalName];
|
||||
if ([value isNotNull])
|
||||
[organizer setCn: value];
|
||||
[brokenEvent setOrganizer: organizer];
|
||||
}
|
||||
}
|
||||
|
||||
if (!organizer)
|
||||
[self errorWithFormat: @"no organizer could be found, SOGo will crash"
|
||||
@" if the user replies"];
|
||||
}
|
||||
|
||||
- (iCalEvent *)
|
||||
_setupChosenEventAndEventObject: (SOGoAppointmentObject **) eventObject
|
||||
{
|
||||
iCalEvent *emailEvent, *calendarEvent, *chosenEvent;
|
||||
iCalPerson *organizer;
|
||||
|
||||
emailEvent = [self _emailEvent];
|
||||
if (emailEvent)
|
||||
@@ -113,6 +152,10 @@
|
||||
else
|
||||
chosenEvent = calendarEvent;
|
||||
}
|
||||
|
||||
organizer = [chosenEvent organizer];
|
||||
if (![[organizer rfc822Email] length])
|
||||
[self _fixOrganizerInEvent: chosenEvent];
|
||||
}
|
||||
else
|
||||
chosenEvent = nil;
|
||||
|
||||
Reference in New Issue
Block a user