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];
+2
View File
@@ -66,6 +66,8 @@
- (NSArray *) freeBusyDefaultInterval;
- (int) davCalendarStartTimeLimit;
- (BOOL) iPhoneForceAllDayTransparency;
@end
#endif /* SOGODOMAINDEFAULTS_H */
+5
View File
@@ -260,6 +260,11 @@
return [self integerForKey: @"SOGoDAVCalendarStartTimeLimit"];
}
- (BOOL) iPhoneForceAllDayTransparency
{
return [self boolForKey: @"SOGoiPhoneForceAllDayTransparency"];
}
/* overriden methods */
- (NSString *) language
{
+1 -1
View File
@@ -1,6 +1,6 @@
/* WORequest+SOGo.m - this file is part of SOGo
*
* Copyright (C) 2007 Inverse inc.
* Copyright (C) 2007-2010 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*