Monotone-Parent: ae2f3622e019b557af4f9dd642911dec3afe7ba1

Monotone-Revision: 86fd1ace33a761145516f77910d46684fbe4f423

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2012-08-08T19:10:28
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2012-08-08 19:10:28 +00:00
parent 7a05ec77de
commit 4940c2ba48
2 changed files with 26 additions and 4 deletions

View File

@@ -445,10 +445,11 @@
{
// iCalCalendar *vCalendar;
// NSCalendarDate *now;
NSString *uid;
NSString *uid, *nameInContainer;
// iCalEvent *newEvent;
// iCalPerson *userPerson;
SOGoUser *activeUser;
NSRange rangeOfDot;
if (isNew)
{
@@ -463,10 +464,27 @@
[self _fixupAppointmentObjectWithUID: uid];
}
else
uid = [SOGoObject globallyUniqueObjectId];
{
/* We create a UID from the nameInContainer, or the reverse if the
latter is already set... */
nameInContainer = [sogoObject nameInContainer];
if (nameInContainer)
{
rangeOfDot = [nameInContainer rangeOfString: @"."
options: NSBackwardsSearch];
if (rangeOfDot.location == NSNotFound)
uid = nameInContainer;
else
uid = [nameInContainer substringToIndex: rangeOfDot.location];
}
else
{
uid = [SOGoObject globallyUniqueObjectId];
nameInContainer = [NSString stringWithFormat: @"%@.ics", uid];
[sogoObject setNameInContainer: nameInContainer];
}
}
[masterEvent setUid: uid];
[sogoObject setNameInContainer:
[NSString stringWithFormat: @"%@.ics", uid]];
}
// [self logWithFormat: @"-save, event props:"];