Monotone-Parent: 300b960b99af9d890f03b4a72f3a63164c19b44c

Monotone-Revision: eba51f48761a50897d61f4fffe1e4122f78c7a2d

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2009-07-03T19:46:01
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau 2009-07-03 19:46:01 +00:00
parent 3e4c791238
commit ebe9c0f453
3 changed files with 74 additions and 43 deletions

View file

@ -1,5 +1,9 @@
2009-07-03 Wolfgang Sourdeau <wsourdeau@inverse.ca> 2009-07-03 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* UI/Scheduler/UIxCalListingActions.m (-eventsBlocksAction): added
sanity checks to avoid crashes when quick fields were wrongly
parsed.
* SoObjects/SOGo/LDAPUserManager.m (_fillContactMailRecords:): if * SoObjects/SOGo/LDAPUserManager.m (_fillContactMailRecords:): if
the user uid contains a "@", we set it directly as system email the user uid contains a "@", we set it directly as system email
rather than suffixing it with the default mail domain. rather than suffixing it with the default mail domain.

3
NEWS
View file

@ -9,6 +9,9 @@
- improved the attendees modification dialog by implementing slots management and zooming - improved the attendees modification dialog by implementing slots management and zooming
- added the capability to display the size of messages in the mail module - added the capability to display the size of messages in the mail module
- added the capability of limiting the number of returned events from DAV requests - added the capability of limiting the number of returned events from DAV requests
- added support for Cyrus Daboo's Webdav sync draft spec in the calendar and addressbook collections
- added unicode support in the IMAP folder names
- fixed some issues with the conversion of folder names in modified UTF-7
1.0-20090605 (1.0.2) 1.0-20090605 (1.0.2)
-------------------- --------------------

View file

@ -37,6 +37,7 @@
#import <NGExtensions/NGCalendarDateRange.h> #import <NGExtensions/NGCalendarDateRange.h>
#import <NGExtensions/NSCalendarDate+misc.h> #import <NGExtensions/NSCalendarDate+misc.h>
#import <NGExtensions/NSObject+Logs.h>
#import <SoObjects/SOGo/SOGoDateFormatter.h> #import <SoObjects/SOGo/SOGoDateFormatter.h>
#import <SoObjects/SOGo/SOGoUser.h> #import <SoObjects/SOGo/SOGoUser.h>
@ -591,59 +592,82 @@ _userStateInEvent (NSArray *event)
withEvent: (NSArray *) event withEvent: (NSArray *) event
withNumber: (NSNumber *) number withNumber: (NSNumber *) number
{ {
unsigned int currentDayStart, startSecs, endsSecs, currentStart, eventStart, int currentDayStart, startSecs, endsSecs, currentStart, eventStart,
eventEnd, offset, recurrenceTime; eventEnd, offset, recurrenceTime;
NSMutableArray *currentDay; NSMutableArray *currentDay;
NSMutableDictionary *eventBlock; NSMutableDictionary *eventBlock;
iCalPersonPartStat userState; iCalPersonPartStat userState;
startSecs = (unsigned int) [startDate timeIntervalSince1970]; eventStart = [[event objectAtIndex: 4] intValue];
endsSecs = (unsigned int) [endDate timeIntervalSince1970]; if (eventStart < 0)
eventStart = [[event objectAtIndex: 4] unsignedIntValue]; [self errorWithFormat: @"event '%@' has negative start: %d (skipped)",
eventEnd = [[event objectAtIndex: 5] unsignedIntValue]; [event objectAtIndex: 0], eventStart];
if ([[event objectAtIndex: 12] boolValue]) // c_iscycle
recurrenceTime = [[event objectAtIndex: 14] unsignedIntValue]; // c_recurrence_id
else else
recurrenceTime = 0;
currentStart = eventStart;
if (currentStart < startSecs)
{ {
currentStart = startSecs; eventEnd = [[event objectAtIndex: 5] intValue];
offset = 0; if (eventEnd < 0)
} [self errorWithFormat: @"event '%@' has negative end: %d (skipped)",
else [event objectAtIndex: 0], eventEnd];
offset = ((currentStart - startSecs) else
/ dayLength); {
currentDay = [blocks objectAtIndex: offset]; if (eventEnd < eventStart)
currentDayStart = startSecs + dayLength * offset; [self warnWithFormat: @"event '%@' has end < start: %d < %d",
[event objectAtIndex: 0], eventEnd, eventStart];
if (eventEnd > endsSecs) startSecs = (unsigned int) [startDate timeIntervalSince1970];
eventEnd = endsSecs; endsSecs = (unsigned int) [endDate timeIntervalSince1970];
userState = _userStateInEvent (event); if ([[event objectAtIndex: 12] boolValue]) // c_iscycle
while (currentDayStart + dayLength < eventEnd) recurrenceTime = [[event objectAtIndex: 14] unsignedIntValue]; // c_recurrence_id
{ else
eventBlock = [self _eventBlockWithStart: currentStart recurrenceTime = 0;
end: currentDayStart + dayLength - 1
number: number currentStart = eventStart;
onDay: currentDayStart if (currentStart < startSecs)
recurrenceTime: recurrenceTime {
userState: userState]; currentStart = startSecs;
[currentDay addObject: eventBlock]; offset = 0;
currentDayStart += dayLength; }
currentStart = currentDayStart; else
offset++; offset = ((currentStart - startSecs)
currentDay = [blocks objectAtIndex: offset]; / dayLength);
if (offset >= [blocks count])
[self errorWithFormat: "event '%@' has a computed offset that"
@" overflows the amount of blocks (skipped)",
[event objectAtIndex: 0]];
else
{
currentDay = [blocks objectAtIndex: offset];
currentDayStart = startSecs + dayLength * offset;
if (eventEnd > endsSecs)
eventEnd = endsSecs;
userState = _userStateInEvent (event);
while (currentDayStart + dayLength < eventEnd)
{
eventBlock = [self _eventBlockWithStart: currentStart
end: currentDayStart + dayLength - 1
number: number
onDay: currentDayStart
recurrenceTime: recurrenceTime
userState: userState];
[currentDay addObject: eventBlock];
currentDayStart += dayLength;
currentStart = currentDayStart;
offset++;
currentDay = [blocks objectAtIndex: offset];
}
eventBlock = [self _eventBlockWithStart: currentStart
end: eventEnd
number: number
onDay: currentDayStart
recurrenceTime: recurrenceTime
userState: userState];
[currentDay addObject: eventBlock];
}
}
} }
eventBlock = [self _eventBlockWithStart: currentStart
end: eventEnd
number: number
onDay: currentDayStart
recurrenceTime: recurrenceTime
userState: userState];
[currentDay addObject: eventBlock];
} }
- (void) _prepareEventBlocks: (NSMutableArray **) blocks - (void) _prepareEventBlocks: (NSMutableArray **) blocks