From aafcaeff9ff8ebf84536e77a8ea614662bb79c15 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 10 Aug 2006 22:03:48 +0000 Subject: [PATCH] Monotone-Parent: 2cf3be019f697c04a2f19de8e9693b7b7a1ddf8d Monotone-Revision: a8e6d3c082060d0b8f4e1c547734baf974d5ee7c Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-08-10T22:03:48 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 7 +++++++ SoObjects/Contacts/SOGoContactGCSFolder.m | 15 ++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 461826f73..85c0e71a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-08-10 Wolfgang Sourdeau + + * SoObjects/Contacts/SOGoContactGCSFolder.m ([SOGoContactGCSFolder + -lookupName:_keyinContext:_ctxacquire:_flag]): when the HTTP + request is a PUT, always create an entry, even if we're not sure + it does exist. + 2006-08-09 Wolfgang Sourdeau * UI/WebServerResources/ContactsUI.js: implemented live-search. diff --git a/SoObjects/Contacts/SOGoContactGCSFolder.m b/SoObjects/Contacts/SOGoContactGCSFolder.m index 780d783eb..822c3f422 100644 --- a/SoObjects/Contacts/SOGoContactGCSFolder.m +++ b/SoObjects/Contacts/SOGoContactGCSFolder.m @@ -93,15 +93,24 @@ } - (id) lookupName: (NSString *) _key - inContext: (id) _ctx + inContext: (WOContext *) _ctx acquire: (BOOL) _flag { id obj; - + /* first check attributes directly bound to the application */ obj = [super lookupName:_key inContext:_ctx acquire:NO]; if (!obj) - obj = [self lookupContactWithId: _key]; + { + if ([[[_ctx request] method] isEqualToString: @"PUT"]) + { + obj = [[SOGoContactGCSEntry alloc] initWithName: _key + inContainer: self]; + [obj autorelease]; + } + else + obj = [self lookupContactWithId: _key]; + } if (!obj) obj = [NSException exceptionWithHTTPStatus:404 /* Not Found */];