From f488f655efa2096216d4596684aadf84bd3491a3 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 30 May 2007 20:21:54 +0000 Subject: [PATCH] Monotone-Parent: f52396704f73dfc96a00df9959e4d9cb043d72fe Monotone-Revision: f3663656115d10ecd6bde3134ecce315d9e7b6f2 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-30T20:21:54 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 5 +++++ UI/Common/UIxFolderActions.h | 1 + UI/Common/UIxFolderActions.m | 21 +++++++++++++++++++-- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index c57aaebec..e1b4161a8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2007-05-30 Wolfgang Sourdeau + * UI/Common/UIxFolderActions.m ([UIxFolderActions + -_realActionWithFolderName:folderDict]): handle the possible + presence of the "mail-invitation" url parameter. If present, the + user will be redirected to the relevant folder. + * SoObjects/SOGo/SOGoUser.m ([SOGoUser -fullEmail]): new proxy method. ([SOGoUser -language]): new method that returns the user's preferred language, or the system's if none has been set yet. diff --git a/UI/Common/UIxFolderActions.h b/UI/Common/UIxFolderActions.h index 88126ad38..b74a20a30 100644 --- a/UI/Common/UIxFolderActions.h +++ b/UI/Common/UIxFolderActions.h @@ -43,6 +43,7 @@ NSString *baseFolder; NSMutableString *subscriptionPointer; NSMutableDictionary *moduleSettings; + BOOL isMailInvitation; } - (WOResponse *) subscribeAction; diff --git a/UI/Common/UIxFolderActions.m b/UI/Common/UIxFolderActions.m index fdd9f8017..94edaea4a 100644 --- a/UI/Common/UIxFolderActions.m +++ b/UI/Common/UIxFolderActions.m @@ -23,6 +23,7 @@ #import #import #import +#import #import #import @@ -45,7 +46,7 @@ - (void) _setupContext { - NSString *clientClass; + NSString *clientClass, *mailInvitationParam; SOGoUser *activeUser; activeUser = [context activeUser]; @@ -76,12 +77,17 @@ if ([baseFolder isEqualToString: @"Contacts"]) [subscriptionPointer appendFormat: @"/%@", [clientObject nameInContainer]]; + + mailInvitationParam + = [[context request] formValueForKey: @"mail-invitation"]; + isMailInvitation = [mailInvitationParam boolValue]; } - (WOResponse *) _realActionWithFolderName: (NSDictionary *) folderDict { WOResponse *response; NSMutableDictionary *folderSubscription; + NSString *mailInvitationURL; response = [context response]; if ([owner isEqualToString: login]) @@ -107,7 +113,18 @@ [folderSubscription removeObjectForKey: subscriptionPointer]; [ud synchronize]; - [response setStatus: 204]; + + if (isMailInvitation) + { + mailInvitationURL + = [[clientObject soURLToBaseContainerForCurrentUser] + absoluteString]; + [response setStatus: 302]; + [response setHeader: mailInvitationURL + forKey: @"location"]; + } + else + [response setStatus: 204]; } return response;