Monotone-Parent: 355e6e150effcfc0fdb8c4139071a1a734173bda

Monotone-Revision: de8a628ccf75e9a2e0e0a0ce276c536a91eeb716

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2012-08-07T15:35:31
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau 2012-08-07 15:35:31 +00:00
parent 5093fb964e
commit f2e72f108f
2 changed files with 36 additions and 22 deletions

View file

@ -1,5 +1,9 @@
2012-08-07 Wolfgang Sourdeau <wsourdeau@inverse.ca> 2012-08-07 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/Appointments/SOGoAptMailNotification.m (-setupValues):
test whether each value is non-nil before adding it to the
dictionary.
* OpenChange/MAPIStoreMailVolatileMessage.m (-save): restored * OpenChange/MAPIStoreMailVolatileMessage.m (-save): restored
registration of message url when saved. registration of message url when saved.

View file

@ -173,8 +173,8 @@
- (void) setupValues - (void) setupValues
{ {
NSString *sentBy, *sentByText, *description; NSString *sentByText;
NSCalendarDate *date; id value;
NSDictionary *sentByValues; NSDictionary *sentByValues;
SOGoUser *user; SOGoUser *user;
SOGoDateFormatter *dateFormatter; SOGoDateFormatter *dateFormatter;
@ -184,15 +184,18 @@
[viewTZ retain]; [viewTZ retain];
values = [NSMutableDictionary new]; values = [NSMutableDictionary new];
[values setObject: [self summary] forKey: @"Summary"]; value = [self summary];
if (!value)
value = @"";
[values setObject: value forKey: @"Summary"];
if (organizerName) if (organizerName)
{ {
[values setObject: organizerName forKey: @"Organizer"]; [values setObject: organizerName forKey: @"Organizer"];
sentBy = [[apt organizer] sentBy]; value = [[apt organizer] sentBy];
if ([sentBy length]) if (value)
{ {
sentByValues = [NSDictionary dictionaryWithObject: sentBy sentByValues = [NSDictionary dictionaryWithObject: value
forKey: @"SentBy"]; forKey: @"SentBy"];
sentByText sentByText
= [sentByValues keysWithFormat: [self = [sentByValues keysWithFormat: [self
@ -201,29 +204,36 @@
} }
else else
sentByText = @""; sentByText = @"";
[values setObject: sentByText forKey: @"SentByText"]; [values setObject: sentByText forKey: @"SentByText"];
} }
dateFormatter = [[context activeUser] dateFormatterInContext: context]; dateFormatter = [[context activeUser] dateFormatterInContext: context];
date = [self newStartDate]; value = [self newStartDate];
[values setObject: [dateFormatter shortFormattedDate: date] if (value)
{
[values setObject: [dateFormatter shortFormattedDate: value]
forKey: @"StartDate"]; forKey: @"StartDate"];
if (![apt isAllDay]) if (![apt isAllDay])
[values setObject: [dateFormatter formattedTime: date] [values setObject: [dateFormatter formattedTime: value]
forKey: @"StartTime"]; forKey: @"StartTime"];
}
date = [self newEndDate]; value = [self newEndDate];
[values setObject: [dateFormatter shortFormattedDate: date] if (value)
{
[values setObject: [dateFormatter shortFormattedDate: value]
forKey: @"EndDate"]; forKey: @"EndDate"];
if (![apt isAllDay]) if (![apt isAllDay])
[values setObject: [dateFormatter formattedTime: date] [values setObject: [dateFormatter formattedTime: value]
forKey: @"EndTime"]; forKey: @"EndTime"];
}
description = [[self apt] comment]; value = [[self apt] comment];
[values setObject: (description ? description : @"") if (!value)
forKey: @"Description"]; value = @"";
[values setObject: value forKey: @"Description"];
} }
@end @end