mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-30 07:35:39 +00:00
(fix) keep UID during MOVE
This commit is contained in:
@@ -1237,12 +1237,31 @@
|
||||
|
||||
- (NSException *) moveToFolder: (SOGoGCSFolder *) newFolder
|
||||
{
|
||||
SOGoCalendarComponent *newComponent;
|
||||
NSException *ex;
|
||||
id o;
|
||||
|
||||
ex = [self copyToFolder: newFolder];
|
||||
// Lookup to see if the event exists in the target calendar. During a MOVE, we do
|
||||
// keep the ID of the event intact.
|
||||
o = [newFolder lookupName: [self nameInContainer]
|
||||
inContext: context
|
||||
acquire: NO];
|
||||
|
||||
if (!ex)
|
||||
ex = [self delete];
|
||||
if ([o isKindOfClass: [NSException class]])
|
||||
{
|
||||
newComponent = [[self class] objectWithName: [self nameInContainer]
|
||||
inContainer: newFolder];
|
||||
|
||||
ex = [newComponent saveCalendar: [self calendar: NO secure: NO]];
|
||||
|
||||
if (!ex)
|
||||
ex = [self delete];
|
||||
}
|
||||
else
|
||||
{
|
||||
ex = [NSException exceptionWithHTTPStatus: 409
|
||||
reason: @"Target exists - MOVE disallowed."];
|
||||
}
|
||||
|
||||
return ex;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user