(fix) more fix regarding recurrence exceptions and body tags
Conflicts: ActiveSync/iCalEvent+ActiveSync.mpull/188/head
parent
30377c0fd6
commit
81f13404bf
|
@ -238,6 +238,34 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
if (![self recurrenceId] && [[self uid] length])
|
if (![self recurrenceId] && [[self uid] length])
|
||||||
[s appendFormat: @"<UID xmlns=\"Calendar:\">%@</UID>", [[self uid] activeSyncRepresentationInContext: context]];
|
[s appendFormat: @"<UID xmlns=\"Calendar:\">%@</UID>", [[self uid] activeSyncRepresentationInContext: context]];
|
||||||
|
|
||||||
|
// Recurrence rules
|
||||||
|
if ([self isRecurrent])
|
||||||
|
[s appendString: [[[self recurrenceRules] lastObject] activeSyncRepresentationInContext: context]];
|
||||||
|
|
||||||
|
// Comment
|
||||||
|
o = [self comment];
|
||||||
|
//if (![self recurrenceId] && [o length])
|
||||||
|
if ([o length])
|
||||||
|
{
|
||||||
|
// It is very important here to NOT set <Truncated>0</Truncated> in the response,
|
||||||
|
// otherwise it'll prevent WP8 phones from sync'ing. See #3028 for details.
|
||||||
|
o = [o activeSyncRepresentationInContext: context];
|
||||||
|
|
||||||
|
if ([[[context request] headerForKey: @"MS-ASProtocolVersion"] isEqualToString: @"2.5"])
|
||||||
|
{
|
||||||
|
[s appendFormat: @"<Body xmlns=\"Calendar:\">%@</Body>", o];
|
||||||
|
[s appendString: @"<BodyTruncated xmlns=\"Calendar:\">0</BodyTruncated>"];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
[s appendString: @"<Body xmlns=\"AirSyncBase:\">"];
|
||||||
|
[s appendFormat: @"<Type>%d</Type>", 1];
|
||||||
|
[s appendFormat: @"<EstimatedDataSize>%d</EstimatedDataSize>", (int)[o length]];
|
||||||
|
[s appendFormat: @"<Data>%@</Data>", o];
|
||||||
|
[s appendString: @"</Body>"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Sensitivity
|
// Sensitivity
|
||||||
if ([[self accessClass] isEqualToString: @"PRIVATE"])
|
if ([[self accessClass] isEqualToString: @"PRIVATE"])
|
||||||
v = 2;
|
v = 2;
|
||||||
|
@ -270,7 +298,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
[s appendString: [alarm activeSyncRepresentationInContext: context]];
|
[s appendString: [alarm activeSyncRepresentationInContext: context]];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Recurrence rules
|
// Exceptions
|
||||||
if ([self isRecurrent])
|
if ([self isRecurrent])
|
||||||
{
|
{
|
||||||
NSMutableArray *components, *exdates;
|
NSMutableArray *components, *exdates;
|
||||||
|
@ -279,8 +307,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
unsigned int count, max, i;
|
unsigned int count, max, i;
|
||||||
|
|
||||||
[s appendString: [[[self recurrenceRules] lastObject] activeSyncRepresentationInContext: context]];
|
|
||||||
|
|
||||||
components = [NSMutableArray arrayWithArray: [[self parent] events]];
|
components = [NSMutableArray arrayWithArray: [[self parent] events]];
|
||||||
max = [components count];
|
max = [components count];
|
||||||
|
|
||||||
|
@ -343,29 +369,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Comment
|
|
||||||
o = [self comment];
|
|
||||||
if ([o length])
|
|
||||||
{
|
|
||||||
// It is very important here to NOT set <Truncated>0</Truncated> in the response,
|
|
||||||
// otherwise it'll prevent WP8 phones from sync'ing. See #3028 for details.
|
|
||||||
o = [o activeSyncRepresentationInContext: context];
|
|
||||||
|
|
||||||
if ([self recurrenceId] || [[[context request] headerForKey: @"MS-ASProtocolVersion"] isEqualToString: @"2.5"])
|
|
||||||
{
|
|
||||||
[s appendFormat: @"<Body xmlns=\"Calendar:\">%@</Body>", o];
|
|
||||||
[s appendString: @"<BodyTruncated xmlns=\"Calendar:\">0</BodyTruncated>"];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
[s appendString: @"<Body xmlns=\"AirSyncBase:\">"];
|
|
||||||
[s appendFormat: @"<Type>%d</Type>", 1];
|
|
||||||
[s appendFormat: @"<EstimatedDataSize>%d</EstimatedDataSize>", (int)[o length]];
|
|
||||||
[s appendFormat: @"<Data>%@</Data>", o];
|
|
||||||
[s appendString: @"</Body>"];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (![self recurrenceId])
|
if (![self recurrenceId])
|
||||||
[s appendFormat: @"<NativeBodyType xmlns=\"AirSyncBase:\">%d</NativeBodyType>", 1];
|
[s appendFormat: @"<NativeBodyType xmlns=\"AirSyncBase:\">%d</NativeBodyType>", 1];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue