diff --git a/ChangeLog b/ChangeLog index 5db8436a2..2be69a423 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,15 @@ +2009-07-01 Wolfgang Sourdeau + + * SoObjects/Appointments/SOGoAppointmentFolder.m + (-lookupName:inContext:acquire:): handle "AsTask" and + "AsAppointment" url suffix only for the default "so" handler. + 2009-07-01 Cyril Robert * SoObjects/SOGo/SOGoGCSFolder.m: Remove color from user settings on unsubscribe. + * UI/MailerUI/UIxMailFolderActions.m (_trashedURLOfFolder:withCO:): Fixed + issue when deleting a folder with the same name as one already in the Trash. 2009-06-30 Francis Lachapelle diff --git a/SOPE/sope-patchset-r1657.diff b/SOPE/sope-patchset-r1657.diff index be579afa4..043e5ff28 100644 --- a/SOPE/sope-patchset-r1657.diff +++ b/SOPE/sope-patchset-r1657.diff @@ -969,6 +969,15 @@ Index: sope-mime/NGImap4/NGImap4Connection.m #include "imCommon.h" @implementation NGImap4Connection +@@ -66,7 +67,7 @@ + self->creationTime = [[NSDate alloc] init]; + + // TODO: retrieve from IMAP4 instead of using a default +- self->separator = imap4Separator; ++ self->separator = [imap4Separator copy]; + } + return self; + } @@ -321,13 +322,15 @@ return nil; if ([folderName characterAtIndex:0] == '/') @@ -1671,7 +1680,13 @@ Index: sope-mime/NGImap4/ChangeLog =================================================================== --- sope-mime/NGImap4/ChangeLog (revision 1660) +++ sope-mime/NGImap4/ChangeLog (working copy) -@@ -1,3 +1,39 @@ +@@ -1,3 +1,45 @@ ++2009-07-01 Wolfgang Sourdeau ++ ++ * NGImap4Connection.m (-initWithClient:password:): we need to copy ++ the imap4Separator, otherwise it will be released when the connection ++ is deallocated. ++ +2009-06-15 Wolfgang Sourdeau + + * NSString+Imap4.m (-stringByEncodingImap4FolderName, @@ -4024,6 +4039,22 @@ Index: sope-appserver/NGObjWeb/GNUmakefile.postamble - $(INSTALL_ROOT_DIR)/$(GNUSTEP_MAKEFILES)/wobundle.make -endif + $(DESTDIR)/$(GNUSTEP_MAKEFILES)/wobundle.make +Index: sope-appserver/NGObjWeb/ChangeLog +=================================================================== +--- sope-appserver/NGObjWeb/ChangeLog (revision 1660) ++++ sope-appserver/NGObjWeb/ChangeLog (working copy) +@@ -1,3 +1,11 @@ ++2009-07-01 Wolfgang Sourdeau ++ ++ * WOHttpAdaptor/WOHttpTransaction.m ++ (-deliverResponse:toRequest:onStream:): we test the content-length ++ and impose a content-type of text/plain when 0. This work-arounds ++ a bug in Mozilla clients where empty responses with a content-type ++ set to X/xml will trigger an exception. ++ + 2009-06-10 Helge Hess + + * DAVPropMap.plist: mapped {DAV:}current-user-principal (v4.9.37) Index: sope-appserver/NGObjWeb/WODirectAction.m =================================================================== --- sope-appserver/NGObjWeb/WODirectAction.m (revision 1660) @@ -4274,3 +4305,36 @@ Index: sope-appserver/NGObjWeb/SoObjects/SoObject.m } } +Index: sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m +=================================================================== +--- sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m (revision 1660) ++++ sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m (working copy) +@@ -696,7 +696,7 @@ + *(&out) = nil; + + [self _httpValidateResponse:_response]; +- ++ + out = [(NGCTextStream *)[NGCTextStream alloc] initWithSource:_out]; + + NS_DURING { +@@ -705,6 +705,7 @@ + id body; + BOOL doZip; + BOOL isok = YES; ++ int length; + + doZip = [_response shouldZipResponseToRequest:_request]; + +@@ -738,7 +739,10 @@ + + /* add content length header */ + +- snprintf((char *)buf, sizeof(buf), "%d", [body length]); ++ if ((length = [body length]) == 0) { ++ [_response setHeader:@"text/plain" forKey:@"content-type"]; ++ } ++ snprintf((char *)buf, sizeof(buf), "%d", length); + t1 = [[NSString alloc] initWithCString:(char *)buf]; + [_response setHeader:t1 forKey:@"content-length"]; + [t1 release]; t1 = nil; diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.m b/SoObjects/Appointments/SOGoAppointmentFolder.m index 7a6295296..6ea25fe7d 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -64,6 +64,7 @@ #import #import #import +#import #import "iCalEntityObject+SOGo.h" #import "SOGoAppointmentObject.h" @@ -1937,6 +1938,7 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir id obj; NSString *url; BOOL handledLater; + WORequest *rq; /* first check attributes directly bound to the application */ handledLater = [self requestNamedIsHandledLater: _key]; @@ -1947,9 +1949,11 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir obj = [super lookupName:_key inContext:_ctx acquire:NO]; if (!obj) { - if ([self isValidContentName:_key]) + rq = [_ctx request]; + if ([self isValidContentName:_key] + && [rq handledByDefaultHandler]) { - url = [[[_ctx request] uri] urlWithoutParameters]; + url = [[rq uri] urlWithoutParameters]; if ([url hasSuffix: @"AsTask"]) obj = [SOGoTaskObject objectWithName: _key inContainer: self]; diff --git a/UI/Common/WODirectAction+SOGo.m b/UI/Common/WODirectAction+SOGo.m index d6395ad33..ee6338da1 100644 --- a/UI/Common/WODirectAction+SOGo.m +++ b/UI/Common/WODirectAction+SOGo.m @@ -40,7 +40,7 @@ response = [context response]; [response setStatus: status]; [response setHeader: @"text/plain; charset=utf-8" - forKey: @"Content-Type"]; + forKey: @"content-type"]; return response; } diff --git a/UI/MailerUI/UIxMailFolderActions.m b/UI/MailerUI/UIxMailFolderActions.m index 27a381d4a..81a056d1c 100644 --- a/UI/MailerUI/UIxMailFolderActions.m +++ b/UI/MailerUI/UIxMailFolderActions.m @@ -139,13 +139,33 @@ withCO: (SOGoMailFolder *) co { NSURL *destURL; - NSString *trashFolderName, *folderName, *path; + NSString *trashFolderName, *folderName, *path, *testPath; + NGImap4Connection *connection; + int i = 1; + id test; + + connection = [co imap4Connection]; folderName = [[srcURL path] lastPathComponent]; trashFolderName = [[co mailAccountFolder] trashFolderNameInContext: context]; path = [NSString stringWithFormat: @"/%@/%@", trashFolderName, folderName]; + testPath = path; + while ( i < 10 ) + { + test = [[connection client] select: testPath]; + if (test && [[test objectForKey: @"result"] boolValue]) + { + testPath = [NSString stringWithFormat: @"%@%x", path, i]; + i++; + } + else + { + path = testPath; + break; + } + } destURL = [[NSURL alloc] initWithScheme: [srcURL scheme] host: [srcURL host] path: path]; [destURL autorelease]; diff --git a/UI/SOGoUI/UIxComponent.m b/UI/SOGoUI/UIxComponent.m index 8e5a5c7d6..e34621427 100644 --- a/UI/SOGoUI/UIxComponent.m +++ b/UI/SOGoUI/UIxComponent.m @@ -602,7 +602,6 @@ static BOOL uixDebugEnabled = NO; response = [context response]; [response setStatus: status]; - [response setHeader: @"text/plain" forKey: @"Content-Type"]; return response; } diff --git a/UI/WebServerResources/ContactsUI.js b/UI/WebServerResources/ContactsUI.js index 6d9e8c8df..540167649 100644 --- a/UI/WebServerResources/ContactsUI.js +++ b/UI/WebServerResources/ContactsUI.js @@ -603,6 +603,7 @@ function appendAddressBook(name, folder) { .replace(">", ">", "g"))); setEventsOnAddressBook(li); updateAddressBooksMenus(); + configureDragAndDrop (); } return result; @@ -1066,6 +1067,8 @@ function initContacts(event) { } function configureDragAndDrop () { + Droppables.empty (); + Draggables.empty (); var mainElement = new Element ("div", {id: "dragDropVisual"}); document.body.appendChild(mainElement); mainElement.absolutize (); diff --git a/UI/WebServerResources/MailerUI.js b/UI/WebServerResources/MailerUI.js index 4ae23cb17..486ae86d8 100644 --- a/UI/WebServerResources/MailerUI.js +++ b/UI/WebServerResources/MailerUI.js @@ -660,8 +660,8 @@ function messageListCallback(http) { table = $('messageList'); configureMessageListEvents(table); TableKit.Resizable.init(table, {'trueResize' : true, 'keepWidth' : true}); - setTimeout ('configureDragAndDrop ();', 500); } + configureDragAndDrop (); configureMessageListBodyEvents(table); var selected = http.callbackData; @@ -1756,6 +1756,7 @@ function onLoadMailboxesCallback(http) { checkAjaxRequestsState(); getFoldersState(); updateStatusFolders(); + configureDragAndDrop (); } } else @@ -2231,6 +2232,9 @@ Mailbox.prototype = { function configureDragAndDrop () { + Droppables.empty (); + Draggables.empty (); + var mainElement = new Element ("div", {id: "dragDropVisual"}); document.body.appendChild(mainElement); mainElement.absolutize (); diff --git a/UI/WebServerResources/scriptaculous/dragdrop.js b/UI/WebServerResources/scriptaculous/dragdrop.js index 61b1e7bdb..9e4ac5920 100644 --- a/UI/WebServerResources/scriptaculous/dragdrop.js +++ b/UI/WebServerResources/scriptaculous/dragdrop.js @@ -12,6 +12,10 @@ if(Object.isUndefined(Effect)) var Droppables = { drops: [], + empty: function () { + this.drops = []; + }, + remove: function(element) { this.drops = this.drops.reject(function(d) { return d.element==$(element) }); }, @@ -129,6 +133,11 @@ var Draggables = { drags: [], observers: [], + empty: function () { + this.drags = []; + this.observers = []; + }, + register: function(draggable) { if(this.drags.length == 0) { this.eventMouseUp = this.endDrag.bindAsEventListener(this);