Monotone-Parent: 30f23e161fdf31dd9a5764e930ffce487bf47758
Monotone-Revision: 87a5b99c1c6050fac3ae23cc68cad8099adec7da Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-05-16T20:30:00 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
97625e7b1e
commit
c6f6ed7f2d
|
@ -1,5 +1,9 @@
|
|||
2008-05-16 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* 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.
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue