mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-09-21 13:18:34 +00:00
Monotone-Parent: ea72255819157346b8579f8e17c6e9fb6c5c0d34
Monotone-Revision: a1294497e9f6ed0ee90d2f695f0735f2eb1ced11 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-08-10T21:44:25 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -750,18 +750,39 @@ _occurenceHasID (iCalRepeatableEntityObject *occurence, NSString *recID)
|
||||
uids = [NSMutableArray array];
|
||||
|
||||
persons = [iCalPersons objectEnumerator];
|
||||
currentPerson = [persons nextObject];
|
||||
while (currentPerson)
|
||||
while ((currentPerson = [persons nextObject]))
|
||||
{
|
||||
uid = [currentPerson uid];
|
||||
if (uid)
|
||||
[uids addObject: uid];
|
||||
currentPerson = [persons nextObject];
|
||||
}
|
||||
|
||||
return uids;
|
||||
}
|
||||
|
||||
- (NSException *) copyToFolder: (SOGoGCSFolder *) newFolder
|
||||
{
|
||||
NSArray *elements;
|
||||
NSString *newUID;
|
||||
unsigned int count, max;
|
||||
iCalCalendar *calendar;
|
||||
SOGoCalendarComponent *newComponent;
|
||||
|
||||
newUID = [self globallyUniqueObjectId];
|
||||
calendar = [self calendar: NO secure: NO];
|
||||
|
||||
elements = [calendar allObjects];
|
||||
max = [elements count];
|
||||
for (count = 0; count < max; count++)
|
||||
[[elements objectAtIndex: count] setUid: newUID];
|
||||
|
||||
newComponent = [[self class] objectWithName:
|
||||
[NSString stringWithFormat: @"%@.ics", newUID]
|
||||
inContainer: newFolder];
|
||||
|
||||
return [newComponent saveContentString: [calendar versitString]];
|
||||
}
|
||||
|
||||
- (NSString *) _roleOfOwner: (iCalRepeatableEntityObject *) component
|
||||
{
|
||||
NSString *role;
|
||||
|
||||
@@ -60,6 +60,27 @@
|
||||
return card;
|
||||
}
|
||||
|
||||
/* actions */
|
||||
|
||||
- (NSException *) copyToFolder: (SOGoGCSFolder *) newFolder
|
||||
{
|
||||
NGVCard *newCard;
|
||||
NSString *newUID;
|
||||
SOGoContactGCSEntry *newContact;
|
||||
|
||||
// Change the contact UID
|
||||
newUID = [self globallyUniqueObjectId];
|
||||
newCard = [self vCard];
|
||||
|
||||
[newCard setUid: newUID];
|
||||
|
||||
newContact = [[self class] objectWithName:
|
||||
[NSString stringWithFormat: @"%@.vcf", newUID]
|
||||
inContainer: newFolder];
|
||||
|
||||
return [newContact saveContentString: [newCard versitString]];
|
||||
}
|
||||
|
||||
/* DAV */
|
||||
|
||||
- (NSString *) davContentType
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#import <NGCards/NGVCard.h>
|
||||
#import <NGCards/CardVersitRenderer.h>
|
||||
|
||||
#import "SOGoContactGCSEntry.h"
|
||||
#import "SOGoContactLDIFEntry.h"
|
||||
|
||||
@implementation SOGoContactLDIFEntry
|
||||
@@ -200,6 +201,26 @@
|
||||
{
|
||||
}
|
||||
|
||||
/* DAV */
|
||||
- (NSException *) copyToFolder: (SOGoGCSFolder *) newFolder
|
||||
{
|
||||
NGVCard *newCard;
|
||||
NSString *newUID;
|
||||
SOGoContactGCSEntry *newContact;
|
||||
|
||||
// Change the contact UID
|
||||
newUID = [self globallyUniqueObjectId];
|
||||
newCard = [self vCard];
|
||||
|
||||
[newCard setUid: newUID];
|
||||
|
||||
newContact = [SOGoContactGCSEntry objectWithName:
|
||||
[NSString stringWithFormat: @"%@.vcf", newUID]
|
||||
inContainer: newFolder];
|
||||
|
||||
return [newContact saveContentString: [newCard versitString]];
|
||||
}
|
||||
|
||||
/* message type */
|
||||
|
||||
- (NSString *) outlookMessageClass
|
||||
|
||||
@@ -59,9 +59,13 @@
|
||||
- (NSException *) saveContentString: (NSString *) _str
|
||||
baseVersion: (unsigned int) _baseVersion;
|
||||
- (NSException *) saveContentString: (NSString *)_str;
|
||||
|
||||
/* actions */
|
||||
- (NSException *) copyToFolder: (SOGoGCSFolder *) newFolder;
|
||||
- (NSException *) moveToFolder: (SOGoGCSFolder *) newFolder;
|
||||
- (NSException *) delete;
|
||||
|
||||
/* etag support */
|
||||
/* DAV support */
|
||||
|
||||
- (id) davEntityTag;
|
||||
- (NSString *) davCreationDate;
|
||||
|
||||
@@ -198,6 +198,30 @@
|
||||
return [self saveContentString: newContent baseVersion: 0];
|
||||
}
|
||||
|
||||
/* actions */
|
||||
|
||||
- (NSException *) copyToFolder: (SOGoGCSFolder *) newFolder
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (NSException *) moveToFolder: (SOGoGCSFolder *) newFolder
|
||||
{
|
||||
SOGoContentObject *newObject;
|
||||
NSException *ex;
|
||||
|
||||
newObject = [[self class] objectWithName: nameInContainer
|
||||
inContainer: newFolder];
|
||||
[newObject setIsNew: YES];
|
||||
ex = [newObject saveContentString: content];
|
||||
if (!ex)
|
||||
ex = [self delete];
|
||||
|
||||
return ex;
|
||||
}
|
||||
|
||||
- (NSException *) delete
|
||||
{
|
||||
/* Note: "iCal multifolder saves" are implemented in the apt subclass! */
|
||||
|
||||
Reference in New Issue
Block a user