See ChangeLog

Monotone-Parent: 52bbcfeb1dfff49a3bb753faaefd8bf92a5ad7eb
Monotone-Revision: f16d87f59f756ed8514cb53f85c6de0f559d8af2

Monotone-Author: ludovic@Sophos.ca
Monotone-Date: 2010-03-19T13:08:15
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Ludovic Marcotte
2010-03-19 13:08:15 +00:00
parent bf275960b4
commit e7b0efaace
6 changed files with 61 additions and 5 deletions
+41 -1
View File
@@ -1497,6 +1497,33 @@
[rq setContent: newContent];
}
- (void) _adjustTransparencyInRequest: (WORequest *) rq
{
iCalCalendar *calendar;
NSArray *allEvents;
iCalEvent *event;
int i;
BOOL modified;
calendar = [iCalCalendar parseSingleFromSource: [rq contentAsString]];
allEvents = [calendar events];
modified = NO;
for (i = 0; i < [allEvents count]; i++)
{
event = [allEvents objectAtIndex: i];
if ([event isAllDay] && [event isOpaque])
{
[event setTransparency: @"TRANSPARENT"];
modified = YES;
}
}
if (modified)
[rq setContent: [[calendar versitString] dataUsingEncoding: [rq contentEncoding]]];
}
- (void) _decomposeGroupsInRequest: (WORequest *) rq
{
iCalCalendar *calendar;
@@ -1537,10 +1564,13 @@
// If we see "X-SOGo: NoGroupsDecomposition" in the HTTP headers, we
// simply invoke super's PUTAction.
//
// We also check if we must force transparency on all day events
// from iPhone clients.
//
- (id) PUTAction: (WOContext *) _ctx
{
WORequest *rq;
NSArray *roles;
WORequest *rq;
rq = [_ctx request];
@@ -1550,9 +1580,19 @@
[self _setupResponseCalendarInRequest: rq];
else
{
SOGoUser *user;
user = [SOGoUser userWithLogin: owner];
if (![[rq headersForKey: @"X-SOGo"]
containsObject: @"NoGroupsDecomposition"])
[self _decomposeGroupsInRequest: rq];
if ([[user domainDefaults] iPhoneForceAllDayTransparency]
&& [rq isIPhone])
{
[self _adjustTransparencyInRequest: rq];
}
}
return [super PUTAction: _ctx];