From 44584fc306130dcc4e7c5c7bd878aa4eb0c918ee Mon Sep 17 00:00:00 2001 From: Sebastian Krupinski Date: Wed, 6 May 2026 12:28:18 -0400 Subject: [PATCH] refactor: mail collections delete Signed-off-by: Sebastian Krupinski --- shared/lib/Mail/Collection/CollectionRoles.php | 2 +- shared/lib/Mail/Service/ServiceBaseInterface.php | 1 + .../lib/Mail/Service/ServiceCollectionMutableInterface.php | 5 ++--- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/shared/lib/Mail/Collection/CollectionRoles.php b/shared/lib/Mail/Collection/CollectionRoles.php index 28e9fec..fea9b9a 100644 --- a/shared/lib/Mail/Collection/CollectionRoles.php +++ b/shared/lib/Mail/Collection/CollectionRoles.php @@ -20,6 +20,7 @@ use JsonSerializable; */ enum CollectionRoles: string implements JsonSerializable { + case None = ''; case Inbox = 'inbox'; case Drafts = 'drafts'; case Sent = 'sent'; @@ -28,7 +29,6 @@ enum CollectionRoles: string implements JsonSerializable { case Archive = 'archive'; case Outbox = 'outbox'; case Queue = 'queue'; - case Custom = 'custom'; public function jsonSerialize(): string { return $this->value; diff --git a/shared/lib/Mail/Service/ServiceBaseInterface.php b/shared/lib/Mail/Service/ServiceBaseInterface.php index 9745c4b..8699e62 100644 --- a/shared/lib/Mail/Service/ServiceBaseInterface.php +++ b/shared/lib/Mail/Service/ServiceBaseInterface.php @@ -38,6 +38,7 @@ interface ServiceBaseInterface extends ResourceServiceBaseInterface { // Collection Filter public const CAPABILITY_COLLECTION_FILTER_LABEL = 'label'; public const CAPABILITY_COLLECTION_FILTER_ROLE = 'role'; + public const CAPABILITY_COLLECTION_FILTER_SUBSCRIBED = 'subscribed'; // Collection Sort public const CAPABILITY_COLLECTION_SORT_LABEL = 'label'; public const CAPABILITY_COLLECTION_SORT_RANK = 'rank'; diff --git a/shared/lib/Mail/Service/ServiceCollectionMutableInterface.php b/shared/lib/Mail/Service/ServiceCollectionMutableInterface.php index 82fd261..f341196 100644 --- a/shared/lib/Mail/Service/ServiceCollectionMutableInterface.php +++ b/shared/lib/Mail/Service/ServiceCollectionMutableInterface.php @@ -68,11 +68,10 @@ interface ServiceCollectionMutableInterface extends ServiceBaseInterface { * * @param string|int $identifier Collection ID * @param bool $force Force deletion even if not empty - * @param bool $recursive Recursively delete contents * - * @return bool True if deleted + * @return CollectionBaseInterface|true Collection object on soft delete, true on hard delete */ - public function collectionDelete(string|int $identifier, bool $force = false, bool $recursive = false): bool; + public function collectionDelete(string|int $identifier, bool $force = false): CollectionBaseInterface | true; /** * Moves a collection to a new parent -- 2.39.5