diff options
Diffstat (limited to 'lib/public/Activity')
-rw-r--r-- | lib/public/Activity/ActivitySettings.php | 4 | ||||
-rw-r--r-- | lib/public/Activity/IBulkConsumer.php | 24 | ||||
-rw-r--r-- | lib/public/Activity/IEvent.php | 16 | ||||
-rw-r--r-- | lib/public/Activity/IEventMerger.php | 1 | ||||
-rw-r--r-- | lib/public/Activity/IFilter.php | 5 | ||||
-rw-r--r-- | lib/public/Activity/IManager.php | 14 | ||||
-rw-r--r-- | lib/public/Activity/IProvider.php | 1 | ||||
-rw-r--r-- | lib/public/Activity/ISetting.php | 5 |
8 files changed, 60 insertions, 10 deletions
diff --git a/lib/public/Activity/ActivitySettings.php b/lib/public/Activity/ActivitySettings.php index 24e4681ee54..fa187164e19 100644 --- a/lib/public/Activity/ActivitySettings.php +++ b/lib/public/Activity/ActivitySettings.php @@ -38,8 +38,8 @@ abstract class ActivitySettings implements ISetting { /** * @return int whether the filter should be rather on the top or bottom of - * the admin section. The filters are arranged in ascending order of the - * priority values. It is required to return a value between 0 and 100. + * the admin section. The filters are arranged in ascending order of the + * priority values. It is required to return a value between 0 and 100. * @since 20.0.0 */ abstract public function getPriority(); diff --git a/lib/public/Activity/IBulkConsumer.php b/lib/public/Activity/IBulkConsumer.php new file mode 100644 index 00000000000..9fdf3516b9a --- /dev/null +++ b/lib/public/Activity/IBulkConsumer.php @@ -0,0 +1,24 @@ +<?php + +/** + * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later + */ + +namespace OCP\Activity; + +/** + * Interface IBulkConsumer + * + * @since 32.0.0 + */ +interface IBulkConsumer extends IConsumer { + /** + * @param IEvent $event + * @param array $affectedUserIds + * @param ISetting $setting + * @return void + * @since 32.0.0 + */ + public function bulkReceive(IEvent $event, array $affectedUserIds, ISetting $setting): void; +} diff --git a/lib/public/Activity/IEvent.php b/lib/public/Activity/IEvent.php index f204de599b9..6014b75123c 100644 --- a/lib/public/Activity/IEvent.php +++ b/lib/public/Activity/IEvent.php @@ -121,7 +121,7 @@ interface IEvent { * See https://github.com/nextcloud/server/issues/1706 for more information. * * @param string $subject - * @param array $parameters + * @param array<string, array<string, string>> $parameters * @return $this * @throws InvalidValueException if the subject or parameters are invalid * @since 11.0.0 @@ -136,7 +136,7 @@ interface IEvent { public function getRichSubject(): string; /** - * @return array[] + * @return array<string, array<string, string>> * @since 11.0.0 */ public function getRichSubjectParameters(): array; @@ -187,7 +187,7 @@ interface IEvent { * See https://github.com/nextcloud/server/issues/1706 for more information. * * @param string $message - * @param array $parameters + * @param array<string, array<string, string>> $parameters * @return $this * @throws \InvalidArgumentException if the message or parameters are invalid * @since 11.0.0 @@ -202,7 +202,7 @@ interface IEvent { public function getRichMessage(): string; /** - * @return array[] + * @return array<string, array<string, string>> * @since 11.0.0 */ public function getRichMessageParameters(): array; @@ -310,6 +310,10 @@ interface IEvent { public function getLink(): string; /** + * Set the absolute url for the icon (should be colored black or not have a color) + * + * It's automatically color inverted by clients when needed + * * @param string $icon * @return $this * @throws InvalidValueException if the icon is invalid @@ -319,6 +323,10 @@ interface IEvent { public function setIcon(string $icon): self; /** + * Get the absolute url for the icon (should be colored black or not have a color) + * + * It's automatically color inverted by clients when needed + * * @return string * @since 11.0.0 */ diff --git a/lib/public/Activity/IEventMerger.php b/lib/public/Activity/IEventMerger.php index e9355c88004..5d0f691f2d4 100644 --- a/lib/public/Activity/IEventMerger.php +++ b/lib/public/Activity/IEventMerger.php @@ -1,4 +1,5 @@ <?php + /** * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/lib/public/Activity/IFilter.php b/lib/public/Activity/IFilter.php index 2f1f4ccda80..008de6f5bca 100644 --- a/lib/public/Activity/IFilter.php +++ b/lib/public/Activity/IFilter.php @@ -1,4 +1,5 @@ <?php + /** * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later @@ -25,8 +26,8 @@ interface IFilter { /** * @return int whether the filter should be rather on the top or bottom of - * the admin section. The filters are arranged in ascending order of the - * priority values. It is required to return a value between 0 and 100. + * the admin section. The filters are arranged in ascending order of the + * priority values. It is required to return a value between 0 and 100. * @since 11.0.0 */ public function getPriority(); diff --git a/lib/public/Activity/IManager.php b/lib/public/Activity/IManager.php index 30020b6eced..d638b8b2c6b 100644 --- a/lib/public/Activity/IManager.php +++ b/lib/public/Activity/IManager.php @@ -52,6 +52,20 @@ interface IManager { public function publish(IEvent $event): void; /** + * Bulk publish an event for multiple users + * taking into account the app specific activity settings + * + * Make sure to call at least the following methods before sending an Event: + * - setApp() + * - setType() + * + * @param IEvent $event + * @throws IncompleteActivityException if required values have not been set + * @since 32.0.0 + */ + public function bulkPublish(IEvent $event, array $affectedUserIds, ISetting $setting): void; + + /** * In order to improve lazy loading a closure can be registered which will be called in case * activity consumers are actually requested * diff --git a/lib/public/Activity/IProvider.php b/lib/public/Activity/IProvider.php index 17fffbb26e2..dec4e7ade64 100644 --- a/lib/public/Activity/IProvider.php +++ b/lib/public/Activity/IProvider.php @@ -1,4 +1,5 @@ <?php + /** * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/lib/public/Activity/ISetting.php b/lib/public/Activity/ISetting.php index 306a0d85632..1304ab8c658 100644 --- a/lib/public/Activity/ISetting.php +++ b/lib/public/Activity/ISetting.php @@ -1,4 +1,5 @@ <?php + /** * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later @@ -25,8 +26,8 @@ interface ISetting { /** * @return int whether the filter should be rather on the top or bottom of - * the admin section. The filters are arranged in ascending order of the - * priority values. It is required to return a value between 0 and 100. + * the admin section. The filters are arranged in ascending order of the + * priority values. It is required to return a value between 0 and 100. * @since 11.0.0 */ public function getPriority(); |