mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-27 07:49:29 +00:00
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:
@@ -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]];
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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"];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user