From 5db79ce218f6e95d7ba9b79fe1d983c5c6551b58 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Tue, 16 Dec 2014 11:47:10 -0500 Subject: [PATCH] Mail draft: use JSON in edit action --- UI/MailerUI/UIxMailActions.m | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/UI/MailerUI/UIxMailActions.m b/UI/MailerUI/UIxMailActions.m index bff34d821..73472445a 100644 --- a/UI/MailerUI/UIxMailActions.m +++ b/UI/MailerUI/UIxMailActions.m @@ -1,6 +1,6 @@ /* UIxMailActions.m - this file is part of SOGo * - * Copyright (C) 2007-2013 Inverse inc. + * Copyright (C) 2007-2014 Inverse inc. * * This file is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -32,6 +32,7 @@ #import #import #import +#import #import #import #import @@ -223,13 +224,14 @@ } /* SOGoDraftObject */ -- (WOResponse *) editAction +- (id ) editAction { + id response; SOGoMailAccount *account; SOGoMailObject *co; SOGoDraftsFolder *folder; SOGoDraftObject *newMail; - NSString *newLocation; + NSDictionary *data; co = [self clientObject]; account = [co mailAccountFolder]; @@ -238,10 +240,13 @@ [newMail fetchMailForEditing: co]; [newMail storeInfo]; - newLocation = [NSString stringWithFormat: @"%@/edit", - [newMail baseURLInContext: context]]; + data = [NSDictionary dictionaryWithObject: [newMail nameInContainer] + forKey: @"draftId"]; - return [self redirectToLocation: newLocation]; + response = [self responseWithStatus: 200 + andString: [data jsonRepresentation]]; + + return response; } - (id) deleteAction