From c6f6ed7f2dd18be57b0033940cdc91f7867c77da Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Fri, 16 May 2008 20:30:00 +0000 Subject: [PATCH] Monotone-Parent: 30f23e161fdf31dd9a5764e930ffce487bf47758 Monotone-Revision: 87a5b99c1c6050fac3ae23cc68cad8099adec7da Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-05-16T20:30:00 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 +++ UI/Common/UIxFolderActions.m | 60 +++++------------------------------- 2 files changed, 12 insertions(+), 52 deletions(-) diff --git a/ChangeLog b/ChangeLog index 372ff7cd4..dd30d9a6c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2008-05-16 Wolfgang Sourdeau + * UI/Common/UIxFolderActions.m ([UIxFolderActions -subscribeAction]) + ([UIxFolderActions -unsubscribeAction]): use the client object's + method for un-/subscribing. + * SoObjects/SOGo/SOGoObject.m ([SOGoObject -pathArrayToSOGoObject]): removed useless method. diff --git a/UI/Common/UIxFolderActions.m b/UI/Common/UIxFolderActions.m index 9fde4a2fe..fae4f02b4 100644 --- a/UI/Common/UIxFolderActions.m +++ b/UI/Common/UIxFolderActions.m @@ -45,9 +45,6 @@ @implementation UIxFolderActions -#warning some of this code could probably be moved in one of the \ - clientObject classes... - - (void) _setupContext { NSString *mailInvitationParam; @@ -75,65 +72,24 @@ isMailInvitation = [mailInvitationParam boolValue]; } -- (WOResponse *) _realSubscribe: (BOOL) reallyDo -{ - WOResponse *response; - NSMutableArray *folderSubscription; - NSString *mailInvitationURL, *subscriptionPointer; - - if ([owner isEqualToString: login]) - { - response = [self responseWithStatus: 403]; - [response appendContentString: - @"You cannot (un)subscribe to a folder that you own!"]; - } - else - { - folderSubscription - = [moduleSettings objectForKey: @"SubscribedFolders"]; - if (!(folderSubscription - && [folderSubscription isKindOfClass: [NSMutableArray class]])) - { - folderSubscription = [NSMutableArray array]; - [moduleSettings setObject: folderSubscription - forKey: @"SubscribedFolders"]; - } - subscriptionPointer = [[self clientObject] folderReference]; - if (reallyDo) - [folderSubscription addObjectUniquely: subscriptionPointer]; - else - [folderSubscription removeObject: subscriptionPointer]; - - [ud synchronize]; - - if (isMailInvitation) - { - mailInvitationURL - = [[clientObject soURLToBaseContainerForCurrentUser] - absoluteString]; - response = [self responseWithStatus: 302]; - [response setHeader: mailInvitationURL - forKey: @"location"]; - } - else - response = [self responseWith204]; - } - - return response; -} - - (WOResponse *) subscribeAction { [self _setupContext]; - return [self _realSubscribe: YES]; + return [clientObject subscribe: YES + inTheNameOf: nil + fromMailInvitation: isMailInvitation + inContext: context]; } - (WOResponse *) unsubscribeAction { [self _setupContext]; - return [self _realSubscribe: NO]; + return [clientObject subscribe: NO + inTheNameOf: nil + fromMailInvitation: isMailInvitation + inContext: context]; } - (WOResponse *) canAccessContentAction