mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-18 01:45:25 +00:00
Monotone-Parent: 4147bb1d4b55d6458b5f11fe840ccc1671d4f45e
Monotone-Revision: e93fdeaa76b1e9c3f341133f6683d32e2788bdab Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-06-13T20:18:03 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1,5 +1,14 @@
|
||||
2008-06-13 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* SoObjects/Contacts/SOGoContactGCSEntry.m ([SOGoContactGCSEntry
|
||||
-vCard]): use the new "content" ivar.
|
||||
|
||||
* SoObjects/Contacts/SOGoContactGCSFolder.m
|
||||
([-deduceObjectForName:inContext:]): removed method since the
|
||||
object type is now deduced in the parent class.
|
||||
([SOGoContactGCSFolder -objectClassForResourceNamed:name]): new
|
||||
overriden method.
|
||||
|
||||
* SoObjects/SOGo/SOGoGCSFolder.m
|
||||
([-fetchContentStringsAndNamesOfAllObjects]): removed useless method.
|
||||
([SOGoGCSFolder
|
||||
|
||||
@@ -48,11 +48,8 @@
|
||||
|
||||
- (NGVCard *) vCard
|
||||
{
|
||||
NSString *content;
|
||||
|
||||
if (!card)
|
||||
{
|
||||
content = [record objectForKey: @"c_content"];
|
||||
if ([[content uppercaseString] hasPrefix: @"BEGIN:VCARD"])
|
||||
card = [NGVCard parseSingleFromSource: content];
|
||||
else
|
||||
|
||||
@@ -87,6 +87,20 @@
|
||||
return objectClass;
|
||||
}
|
||||
|
||||
- (Class) objectClassForComponentName: (NSString *) componentName
|
||||
{
|
||||
Class objectClass;
|
||||
|
||||
if ([componentName isEqualToString: @"vcard"])
|
||||
objectClass = [SOGoContactGCSEntry class];
|
||||
else if ([componentName isEqualToString: @"vlist"])
|
||||
objectClass = [SOGoContactGCSList class];
|
||||
else
|
||||
objectClass = Nil;
|
||||
|
||||
return objectClass;
|
||||
}
|
||||
|
||||
- (Class) objectClassForResourceNamed: (NSString *) name
|
||||
{
|
||||
EOQualifier *qualifier;
|
||||
@@ -101,12 +115,7 @@
|
||||
if ([records count])
|
||||
{
|
||||
component = [[records objectAtIndex: 0] valueForKey: @"c_component"];
|
||||
if ([component isEqualToString: @"vcard"])
|
||||
objectClass = [SOGoContactGCSEntry class];
|
||||
else if ([component isEqualToString: @"vlist"])
|
||||
objectClass = [SOGoContactGCSList class];
|
||||
else
|
||||
objectClass = Nil;
|
||||
objectClass = [self objectClassForComponentName: component];
|
||||
}
|
||||
else
|
||||
objectClass = Nil;
|
||||
@@ -114,29 +123,6 @@
|
||||
return objectClass;
|
||||
}
|
||||
|
||||
- (id) deduceObjectForName: (NSString *)_key
|
||||
inContext: (id)_ctx
|
||||
{
|
||||
WORequest *request;
|
||||
NSString *method;
|
||||
Class objectClass;
|
||||
id obj;
|
||||
|
||||
request = [_ctx request];
|
||||
method = [request method];
|
||||
if ([method isEqualToString: @"PUT"])
|
||||
objectClass = [self objectClassForContent: [request contentAsString]];
|
||||
else
|
||||
objectClass = [self objectClassForResourceNamed: _key];
|
||||
|
||||
if (objectClass)
|
||||
obj = [objectClass objectWithName: _key inContainer: self];
|
||||
else
|
||||
obj = nil;
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
- (BOOL) requestNamedIsHandledLater: (NSString *) name
|
||||
{
|
||||
return [name isEqualToString: @"OPTIONS"];
|
||||
@@ -168,9 +154,6 @@
|
||||
else if ([url hasSuffix: @"AsList"])
|
||||
obj = [SOGoContactGCSList objectWithName: _key
|
||||
inContainer: self];
|
||||
else
|
||||
obj = [self deduceObjectForName: _key
|
||||
inContext: _ctx];
|
||||
}
|
||||
}
|
||||
if (!obj)
|
||||
|
||||
@@ -49,11 +49,8 @@
|
||||
|
||||
- (NGVList *) vList
|
||||
{
|
||||
NSString *content;
|
||||
|
||||
if (!list)
|
||||
{
|
||||
content = [record objectForKey: @"c_content"];
|
||||
if ([[content uppercaseString] hasPrefix: @"BEGIN:VLIST"])
|
||||
list = [NGVList parseSingleFromSource: content];
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user