mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-12 11:55:09 +00:00
merge of '20c7862f09b4fde6c2067b6fa562bc2dcd72ae78'
and '2699a7bfc566b3d087c4b5ed82888408feaa4fb3' Monotone-Parent: 20c7862f09b4fde6c2067b6fa562bc2dcd72ae78 Monotone-Parent: 2699a7bfc566b3d087c4b5ed82888408feaa4fb3 Monotone-Revision: 9932c60ae3f371eb7352ff77e53ef5ca51f43aec Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-11-12T20:57:09 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -16,7 +16,8 @@
|
||||
([UIxMailPartICalViewer -declineLink])
|
||||
([UIxMailPartICalViewer -tentativeLink]): removed useless methods.
|
||||
|
||||
* UI/MailPartViewers/UIxMailPartICalAction.m ([UIxMailPartICalAction -addToCalendarAction])
|
||||
* UI/MailPartViewers/UIxMailPartICalAction.m
|
||||
([UIxMailPartICalAction -addToCalendarAction])
|
||||
([UIxMailPartICalAction -deleteFromCalendarAction]): new stub
|
||||
methods.
|
||||
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
2007-11-12 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* iCalTimeZonePeriod.m ([iCalTimeZonePeriod
|
||||
-occurenceForDate:refDate]): added support for timezone periods
|
||||
which do not contain a recurrence rule, such as the one provided
|
||||
by iCal.
|
||||
|
||||
2007-11-02 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* iCalDateHolder.m ([iCalDateHolder -awakeAfterUsingSaxDecoder:]):
|
||||
|
||||
@@ -99,35 +99,48 @@
|
||||
return dayOfWeek;
|
||||
}
|
||||
|
||||
- (NSCalendarDate *) occurenceForDate: (NSCalendarDate *) refDate;
|
||||
- (NSCalendarDate *) _occurenceForDate: (NSCalendarDate *) refDate
|
||||
byRRule: (iCalRecurrenceRule *) rrule
|
||||
{
|
||||
NSCalendarDate *tmpDate;
|
||||
iCalRecurrenceRule *rrule;
|
||||
NSString *byDay;
|
||||
int dayOfWeek, dateDayOfWeek, offset, pos;
|
||||
|
||||
rrule = (iCalRecurrenceRule *) [self uniqueChildWithTag: @"rrule"];
|
||||
byDay = [rrule namedValue: @"byday"];
|
||||
dayOfWeek = [self dayOfWeekFromRruleDay: [rrule byDayMask]];
|
||||
pos = [[byDay substringToIndex: 2] intValue];
|
||||
if (!pos)
|
||||
pos = 1;
|
||||
|
||||
tmpDate = [NSCalendarDate
|
||||
dateWithYear: [refDate yearOfCommonEra]
|
||||
month: [[rrule namedValue: @"bymonth"] intValue]
|
||||
day: 1 hour: 0 minute: 0 second: 0
|
||||
timeZone: [NSTimeZone timeZoneWithName: @"GMT"]];
|
||||
tmpDate = [NSCalendarDate dateWithYear: [refDate yearOfCommonEra]
|
||||
month: [[rrule namedValue: @"bymonth"] intValue]
|
||||
day: 1 hour: 0 minute: 0 second: 0
|
||||
timeZone: [NSTimeZone timeZoneWithName: @"GMT"]];
|
||||
tmpDate = [tmpDate addYear: 0 month: ((pos > 0) ? 0 : 1)
|
||||
day: 0 hour: 0 minute: 0
|
||||
second: -[self _secondsOfOffset: @"tzoffsetfrom"]];
|
||||
day: 0 hour: 0 minute: 0
|
||||
second: -[self _secondsOfOffset: @"tzoffsetfrom"]];
|
||||
dateDayOfWeek = [tmpDate dayOfWeek];
|
||||
offset = (dayOfWeek - dateDayOfWeek);
|
||||
if (pos > 0 && offset < 0)
|
||||
offset += 7;
|
||||
offset += (pos * 7);
|
||||
tmpDate = [tmpDate addYear: 0 month: 0 day: offset
|
||||
hour: 0 minute: 0 second: 0];
|
||||
hour: 0 minute: 0 second: 0];
|
||||
|
||||
return tmpDate;
|
||||
}
|
||||
|
||||
- (NSCalendarDate *) occurenceForDate: (NSCalendarDate *) refDate;
|
||||
{
|
||||
NSCalendarDate *tmpDate;
|
||||
iCalRecurrenceRule *rrule;
|
||||
|
||||
rrule = (iCalRecurrenceRule *) [self uniqueChildWithTag: @"rrule"];
|
||||
if ([rrule isVoid])
|
||||
tmpDate
|
||||
= [(iCalDateTime *) [self uniqueChildWithTag: @"dtstart"] dateTime];
|
||||
else
|
||||
tmpDate = [self _occurenceForDate: refDate byRRule: rrule];
|
||||
|
||||
return tmpDate;
|
||||
}
|
||||
|
||||
@@ -252,36 +252,32 @@
|
||||
uid = [self getUIDForICalPerson: organizer];
|
||||
if (!uid)
|
||||
uid = [self ownerInContext: nil];
|
||||
if (uid) {
|
||||
if (![storeUIDs containsObject:uid])
|
||||
[storeUIDs addObject:uid];
|
||||
[removedUIDs removeObject:uid];
|
||||
}
|
||||
if (uid)
|
||||
{
|
||||
[storeUIDs addObjectUniquely: uid];
|
||||
[removedUIDs removeObject: uid];
|
||||
}
|
||||
|
||||
/* organizer might have changed completely */
|
||||
|
||||
if (oldApt && ([props containsObject: @"organizer"])) {
|
||||
uid = [self getUIDForICalPerson:[oldApt organizer]];
|
||||
if (uid) {
|
||||
if (![storeUIDs containsObject:uid]) {
|
||||
if (![removedUIDs containsObject:uid]) {
|
||||
[removedUIDs addObject:uid];
|
||||
}
|
||||
}
|
||||
if (oldApt && ([props containsObject: @"organizer"]))
|
||||
{
|
||||
uid = [self getUIDForICalPerson: [oldApt organizer]];
|
||||
if (uid && ![storeUIDs containsObject: uid])
|
||||
[removedUIDs addObjectUniquely: uid];
|
||||
}
|
||||
}
|
||||
|
||||
[self debugWithFormat:@"UID ops:\n store: %@\n remove: %@",
|
||||
[self debugWithFormat: @"UID ops:\n store: %@\n remove: %@",
|
||||
storeUIDs, removedUIDs];
|
||||
|
||||
/* if time did change, all participants have to re-decide ...
|
||||
* ... exception from that rule: the organizer
|
||||
*/
|
||||
|
||||
if (oldApt != nil &&
|
||||
([props containsObject: @"startDate"] ||
|
||||
[props containsObject: @"endDate"] ||
|
||||
[props containsObject: @"duration"]))
|
||||
if (oldApt
|
||||
&& ([props containsObject: @"startDate"]
|
||||
|| [props containsObject: @"endDate"]
|
||||
|| [props containsObject: @"duration"]))
|
||||
{
|
||||
NSArray *ps;
|
||||
unsigned i, count;
|
||||
@@ -320,15 +316,16 @@
|
||||
andNewObject: newApt
|
||||
toAttendees: attendees];
|
||||
|
||||
if (updateForcesReconsider) {
|
||||
attendees = [NSMutableArray arrayWithArray:[newApt attendees]];
|
||||
[attendees removeObjectsInArray:[changes insertedAttendees]];
|
||||
[attendees removePerson:organizer];
|
||||
[self sendEMailUsingTemplateNamed: @"Update"
|
||||
forOldObject: oldApt
|
||||
andNewObject: newApt
|
||||
toAttendees: attendees];
|
||||
}
|
||||
if (updateForcesReconsider)
|
||||
{
|
||||
attendees = [NSMutableArray arrayWithArray:[newApt attendees]];
|
||||
[attendees removeObjectsInArray:[changes insertedAttendees]];
|
||||
[attendees removePerson:organizer];
|
||||
[self sendEMailUsingTemplateNamed: @"Update"
|
||||
forOldObject: oldApt
|
||||
andNewObject: newApt
|
||||
toAttendees: attendees];
|
||||
}
|
||||
|
||||
attendees
|
||||
= [NSMutableArray arrayWithArray: [changes deletedAttendees]];
|
||||
@@ -393,8 +390,8 @@
|
||||
&& [self _aptIsStillRelevant: apt])
|
||||
{
|
||||
/* send notification email to attendees excluding organizer */
|
||||
attendees = [NSMutableArray arrayWithArray:[apt attendees]];
|
||||
[attendees removePerson:[apt organizer]];
|
||||
attendees = [NSMutableArray arrayWithArray: [apt attendees]];
|
||||
[attendees removePerson: [apt organizer]];
|
||||
|
||||
/* flag appointment as being cancelled */
|
||||
[(iCalCalendar *) [apt parent] setMethod: @"cancel"];
|
||||
|
||||
@@ -82,6 +82,7 @@ static NSTimeZone *EST = nil;
|
||||
- (NSString *)homePageURL {
|
||||
return self->homePageURL;
|
||||
}
|
||||
|
||||
- (void)setHomePageURL:(NSString *)_homePageURL {
|
||||
ASSIGN(self->homePageURL, _homePageURL);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user