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;