diff options
author | Maxence Lange <maxence@nextcloud.com> | 2017-06-27 16:54:09 +0300 |
---|---|---|
committer | Maxence Lange <maxence@nextcloud.com> | 2017-06-27 16:54:09 +0300 |
commit | bdbeef8f14cf2eaff01ad15fd7f6dd75f2e95861 (patch) | |
tree | 387b37a591949868af24ba764db3c16032df3303 | |
parent | ec27dd3421b463033608f9beeef63abb95a46c31 (diff) |
few changes to the API
Signed-off-by: Maxence Lange <maxence@nextcloud.com>
-rw-r--r-- | lib/Api/v1/Circles.php | 14 | ||||
-rw-r--r-- | lib/IBroadcaster.php | 57 | ||||
-rw-r--r-- | lib/Service/BroadcastService.php | 3 |
3 files changed, 71 insertions, 3 deletions
diff --git a/lib/Api/v1/Circles.php b/lib/Api/v1/Circles.php index 262b0780..85618aa4 100644 --- a/lib/Api/v1/Circles.php +++ b/lib/Api/v1/Circles.php @@ -140,6 +140,20 @@ class Circles { /** + * Circles::joinedCircles(); + * + * Return all the circle the current user is a member. + * + * @return Circle[] + */ + public static function joinedCircles() + { + return self::listCircles(Circle::CIRCLES_ALL, '', Member::LEVEL_MEMBER); + } + + + + /** * Circles::detailsCircle(); * * WARNING - This function is called by the core - WARNING diff --git a/lib/IBroadcaster.php b/lib/IBroadcaster.php index b022a546..80f3239a 100644 --- a/lib/IBroadcaster.php +++ b/lib/IBroadcaster.php @@ -14,13 +14,66 @@ interface IBroadcaster { public function init(); /** - * broadcast $share to $userId. + * broadcast a creation of $share to $userId. * * @param string $userId * @param SharingFrame $frame * * @return */ - public function broadcast($userId, SharingFrame $frame); + public function createShareToUser($userId, SharingFrame $frame); + + + + /** + * broadcast a creation of $share to $circleId. + * + * @param SharingFrame $frame + * + * @return + */ + public function createShareToCircle(SharingFrame $frame); + + + /** + * broadcast a destruction of $share to $userId. + * + * @param string $userId + * @param SharingFrame $frame + * + * @return + */ + public function deleteShareToUser($userId, SharingFrame $frame); + + + /** + * broadcast a destruction of $share to $circleId. + * + * @param SharingFrame $frame + * + * @return + */ + public function deleteShareToCircle(SharingFrame $frame); + + + /** + * broadcast an edition of $share to $userId. + * + * @param string $userId + * @param SharingFrame $frame + * + * @return + */ + public function editShareToUser($userId, SharingFrame $frame); + + + /** + * broadcast an edition of $share to $circleId. + * + * @param SharingFrame $frame + * + * @return + */ + public function editShareToCircle(SharingFrame $frame); }
\ No newline at end of file diff --git a/lib/Service/BroadcastService.php b/lib/Service/BroadcastService.php index bceca478..cbd39900 100644 --- a/lib/Service/BroadcastService.php +++ b/lib/Service/BroadcastService.php @@ -92,9 +92,10 @@ class BroadcastService { } $broadcaster->init(); + $broadcaster->createShareToCircle($frame); $users = $this->circlesRequest->getMembers($frame->getCircleId(), Member::LEVEL_MEMBER); foreach ($users AS $user) { - $broadcaster->broadcast($user->getUserId(), $frame); + $broadcaster->createShareToUser($user->getUserId(), $frame); } } |