From 8c50b84d8d5d5a265d7c34ec122227b5481e8e29 Mon Sep 17 00:00:00 2001 From: Hivert Quentin Date: Tue, 27 Oct 2026 15:50:08 +0100 Subject: [PATCH] fix(tool): fix name of subscribe folder by setting the context --- SoObjects/SOGo/SOGoGCSFolder.h | 1 + SoObjects/SOGo/SOGoGCSFolder.m | 8 ++++++-- Tools/SOGoToolManageACL.m | 3 ++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/SoObjects/SOGo/SOGoGCSFolder.h b/SoObjects/SOGo/SOGoGCSFolder.h index a5d0c7a13..9023031c3 100644 --- a/SoObjects/SOGo/SOGoGCSFolder.h +++ b/SoObjects/SOGo/SOGoGCSFolder.h @@ -103,6 +103,7 @@ - (void) removeFolderSettings: (NSMutableDictionary *) moduleSettings withReference: (NSString *) reference; +- (void) setContext: (WOContext*) ctx; - (BOOL) subscribeUserOrGroup: (NSString *) theIdentifier reallyDo: (BOOL) reallyDo response: (WOResponse *) theResponse; diff --git a/SoObjects/SOGo/SOGoGCSFolder.m b/SoObjects/SOGo/SOGoGCSFolder.m index 8b0010f01..fe62f5f79 100644 --- a/SoObjects/SOGo/SOGoGCSFolder.m +++ b/SoObjects/SOGo/SOGoGCSFolder.m @@ -375,9 +375,8 @@ static NSArray *childRecordFields = nil; // Use a format only if it was defined by the user if (displayNameFormat) - name = [folderSubscriptionValues keysWithFormat: displayNameFormat]; + name = [folderSubscriptionValues keysWithFormat: displayNameFormat]; } - return name; } @@ -932,6 +931,11 @@ static NSArray *childRecordFields = nil; return [folderSubscription containsObject: [self folderReference]]; } +- (void) setContext: (WOContext*) ctx +{ + context = ctx; +} + - (BOOL) subscribeUserOrGroup: (NSString *) theIdentifier reallyDo: (BOOL) reallyDo response: (WOResponse *) theResponse diff --git a/Tools/SOGoToolManageACL.m b/Tools/SOGoToolManageACL.m index a9de6d62e..c89c515e0 100644 --- a/Tools/SOGoToolManageACL.m +++ b/Tools/SOGoToolManageACL.m @@ -391,7 +391,7 @@ typedef enum NSArray *components; localContext = [WOContext context]; - [localContext setActiveUser: [SOGoUser userWithLogin: owner]]; + [localContext setActiveUser: [SOGoUser userWithLogin: user]]; userFolder = [SOGoUserFolder objectWithName: owner inContainer: nil]; components = [folder componentsSeparatedByString: @"/"]; parentFolder = [userFolder lookupName: [components objectAtIndex: 0] @@ -401,6 +401,7 @@ typedef enum gcsFolder = [parentFolder lookupPersonalFolder: [components objectAtIndex: 1] ignoringRights: YES]; + [gcsFolder setContext: localContext]; [gcsFolder subscribeUserOrGroup: user reallyDo: reallyDo response: nil]; }