Monotone-Parent: 66fc4d9ee925358de80c05092a80e0b39ae6c95d

Monotone-Revision: c5a12fa92d4b395d0d89e97ca85e5ad92a5b087f

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-09-11T19:42:41
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2007-09-11 19:42:41 +00:00
parent f2e7a70a2c
commit fa1106ed42
3 changed files with 18 additions and 27 deletions

View File

@@ -108,8 +108,7 @@
rawFolders = [co allFolderPaths];
folders = [self _jsonFolders: [rawFolders objectEnumerator]];
response = [context response];
[response setStatus: 200];
response = [self responseWithStatus: 200];
[response setHeader: @"text/plain; charset=utf-8"
forKey: @"content-type"];
[response appendContentString: [folders jsonRepresentation]];

View File

@@ -404,10 +404,7 @@ static NSArray *infoKeys = nil;
{
result = [[self clientObject] save];
if (!result)
{
result = [context response];
[result setStatus: 204];
}
result = [self responseWith204];
}
else
result = [self failedToSaveFormResponse];

View File

@@ -36,6 +36,8 @@
#import <SoObjects/Mailer/SOGoMailAccount.h>
#import <SoObjects/SOGo/NSObject+Utilities.h>
#import <UI/Common/WODirectAction+SOGo.h>
#import "UIxMailFolderActions.h"
@implementation UIxMailFolderActions
@@ -49,7 +51,6 @@
NSString *folderName;
co = [self clientObject];
response = [context response];
folderName = [[context request] formValueForKey: @"name"];
if ([folderName length] > 0)
@@ -58,15 +59,15 @@
error = [connection createMailbox: folderName atURL: [co imap4URL]];
if (error)
{
[response setStatus: 500];
response = [self responseWithStatus: 500];
[response appendContentString: @"Unable to create folder."];
}
else
[response setStatus: 204];
response = [self responseWith204];
}
else
{
[response setStatus: 500];
response = [self responseWithStatus: 500];
[response appendContentString: @"Missing 'name' parameter."];
}
@@ -100,7 +101,6 @@
NSURL *srcURL, *destURL;
co = [self clientObject];
response = [context response];
folderName = [[context request] formValueForKey: @"name"];
if ([folderName length] > 0)
@@ -112,15 +112,15 @@
toURL: destURL];
if (error)
{
[response setStatus: 500];
response = [self responseWithStatus: 500];
[response appendContentString: @"Unable to rename folder."];
}
else
[response setStatus: 204];
response = [self responseWith204];
}
else
{
[response setStatus: 500];
response = [self responseWithStatus: 500];
[response appendContentString: @"Missing 'name' parameter."];
}
@@ -154,7 +154,6 @@
NSURL *srcURL, *destURL;
co = [self clientObject];
response = [context response];
connection = [co imap4Connection];
srcURL = [co imap4URL];
destURL = [self _trashedURLOfFolder: srcURL
@@ -164,11 +163,11 @@
toURL: destURL];
if (error)
{
[response setStatus: 500];
response = [self responseWithStatus: 500];
[response appendContentString: @"Unable to move folder."];
}
else
[response setStatus: 204];
response = [self responseWith204];
return response;
}
@@ -180,18 +179,17 @@
WOResponse *response;
co = [self clientObject];
response = [context response];
error = [co expunge];
if (error)
{
[response setStatus: 500];
response = [self responseWithStatus: 500];
[response appendContentString: @"Unable to expunge folder."];
}
else
{
[co flushMailCaches];
[response setStatus: 204];
response = [self responseWith204];
}
return response;
@@ -207,7 +205,6 @@
NSURL *currentURL;
co = [self clientObject];
response = [context response];
error = [co addFlagsToAllMessages: @"deleted"];
if (!error)
@@ -226,11 +223,11 @@
}
if (error)
{
[response setStatus: 500];
response = [self responseWithStatus: 500];
[response appendContentString: @"Unable to empty the trash folder."];
}
else
[response setStatus: 204];
response = [self responseWith204];
return response;
}
@@ -242,7 +239,6 @@
WOResponse *response;
SOGoMailFolder *clientObject;
response = [context response];
mailInvitationParam
= [[context request] formValueForKey: @"mail-invitation"];
if ([mailInvitationParam boolValue])
@@ -257,7 +253,7 @@
}
else
{
[response setStatus: 500];
response = [self responseWithStatus: 500];
[response appendContentString: @"How did you end up here?"];
}
@@ -283,8 +279,7 @@
NGImap4Client *client;
NSString *responseString;
response = [context response];
[response setStatus: 200];
response = [self responseWithStatus: 200];
[response setHeader: @"text/plain; charset=UTF-8"
forKey: @"content-type"];