diff options
author | Maxence Lange <maxence@nextcloud.com> | 2017-07-24 11:25:02 +0300 |
---|---|---|
committer | Maxence Lange <maxence@nextcloud.com> | 2017-07-24 11:25:02 +0300 |
commit | c027b758d237b4fbb6380cf04902c641e83a1766 (patch) | |
tree | 3688e5e70d1069ac65ed1afd55023f211e0963be | |
parent | 3f30b63347efe08feec8fff26c48184e56ebea03 (diff) |
switching circleId (int) to circleUniqueId (string)
Signed-off-by: Maxence Lange <maxence@nextcloud.com>
-rw-r--r-- | appinfo/database.xml | 19 | ||||
-rw-r--r-- | appinfo/info.xml | 2 | ||||
-rw-r--r-- | js/circles.app.results.circles.js | 4 | ||||
-rw-r--r-- | lib/Activity/Provider.php | 2 | ||||
-rw-r--r-- | lib/Api/Sharees.php | 2 | ||||
-rw-r--r-- | lib/Api/v1/Circles.php | 12 | ||||
-rw-r--r-- | lib/Controller/CirclesController.php | 22 | ||||
-rw-r--r-- | lib/Controller/SharesController.php | 8 | ||||
-rw-r--r-- | lib/Db/CircleProviderRequestBuilder.php | 19 | ||||
-rw-r--r-- | lib/Db/CirclesRequest.php | 52 | ||||
-rw-r--r-- | lib/Db/CirclesRequestBuilder.php | 42 | ||||
-rw-r--r-- | lib/Db/CoreRequestBuilder.php | 8 | ||||
-rw-r--r-- | lib/Db/FederatedLinksRequest.php | 12 | ||||
-rw-r--r-- | lib/Db/MembersRequest.php | 46 | ||||
-rw-r--r-- | lib/Model/BaseMember.php | 32 | ||||
-rw-r--r-- | lib/Model/FederatedLink.php | 12 | ||||
-rw-r--r-- | lib/Model/SharingFrame.php | 12 | ||||
-rw-r--r-- | lib/Service/BroadcastService.php | 1 | ||||
-rw-r--r-- | lib/Service/CirclesService.php | 24 | ||||
-rw-r--r-- | lib/Service/EventsService.php | 26 | ||||
-rw-r--r-- | lib/Service/FederatedService.php | 46 | ||||
-rw-r--r-- | lib/Service/GroupsService.php | 8 | ||||
-rw-r--r-- | lib/Service/MembersService.php | 10 | ||||
-rw-r--r-- | lib/Service/SharesService.php | 2 |
24 files changed, 217 insertions, 206 deletions
diff --git a/appinfo/database.xml b/appinfo/database.xml index 483e5771..d664d66e 100644 --- a/appinfo/database.xml +++ b/appinfo/database.xml @@ -93,10 +93,9 @@ <declaration> <field> <name>circle_id</name> - <type>integer</type> + <type>text</type> <notnull>true</notnull> - <unsigned>true</unsigned> - <length>4</length> + <length>64</length> </field> <field> @@ -153,10 +152,9 @@ <declaration> <field> <name>circle_id</name> - <type>integer</type> + <type>text</type> <notnull>true</notnull> - <unsigned>true</unsigned> - <length>4</length> + <length>64</length> </field> <field> @@ -222,10 +220,9 @@ <field> <name>circle_id</name> - <type>integer</type> + <type>text</type> <notnull>true</notnull> - <unsigned>true</unsigned> - <length>4</length> + <length>64</length> </field> <field> @@ -300,9 +297,9 @@ <field> <name>circle_id</name> - <type>integer</type> + <type>text</type> <notnull>true</notnull> - <length>4</length> + <length>64</length> </field> <field> diff --git a/appinfo/info.xml b/appinfo/info.xml index 2126541e..5807b4ce 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -18,7 +18,7 @@ This is the right circle if you are looking for privacy when sharing your files - A public circle is an open group visible to anyone willing to join. Your circle will be visible to everyone and everyone will be able to join the circle.]]> </description> - <version>0.11.2</version> + <version>0.11.3</version> <licence>AGPL</licence> <author>Maxence Lange</author> <documentation> diff --git a/js/circles.app.results.circles.js b/js/circles.app.results.circles.js index c9dedd1f..521ddf0f 100644 --- a/js/circles.app.results.circles.js +++ b/js/circles.app.results.circles.js @@ -103,7 +103,7 @@ var resultCircles = { })); elements.emptyCircleCreation(); nav.displayCirclesList(result.circle.type); - actions.selectCircle(result.circle.id); + actions.selectCircle(result.circle.unique_id); return; } @@ -158,7 +158,7 @@ var resultCircles = { for (var i = 0; i < data.length; i++) { var tmpl = elements.generateTmplCircle(data[i]); elements.navigation.append( - '<div class="circle" circle-id="' + data[i].id + '">' + tmpl + '</div>'); + '<div class="circle" circle-id="' + data[i].unique_id + '">' + tmpl + '</div>'); } elements.navigation.children('.circle').on('click', function () { diff --git a/lib/Activity/Provider.php b/lib/Activity/Provider.php index 5296df86..ea3aca21 100644 --- a/lib/Activity/Provider.php +++ b/lib/Activity/Provider.php @@ -534,7 +534,7 @@ class Provider implements IProvider { 'id' => $circle->getId(), 'name' => $circle->getName(), 'parsed' => $circle->getName(), - 'link' => Circles::generateLink($circle->getId()) + 'link' => Circles::generateLink($circle->getUniqueId()) ]; } diff --git a/lib/Api/Sharees.php b/lib/Api/Sharees.php index 4360905f..940ca5c4 100644 --- a/lib/Api/Sharees.php +++ b/lib/Api/Sharees.php @@ -81,7 +81,7 @@ class Sharees { 'label' => $entry->getName(), 'value' => [ 'shareType' => Share::SHARE_TYPE_CIRCLE, - 'shareWith' => $entry->getId(), + 'shareWith' => $entry->getUniqueId(), 'circleInfo' => $entry->getInfo(), 'circleOwner' => \OC::$server->getUserManager() ->get( diff --git a/lib/Api/v1/Circles.php b/lib/Api/v1/Circles.php index 85618aa4..3421865b 100644 --- a/lib/Api/v1/Circles.php +++ b/lib/Api/v1/Circles.php @@ -295,7 +295,7 @@ class Circles { * Source is the app that is sharing the item and type can be used by the app to identified the * payload. * - * @param $circleId + * @param string $circleUniqueId * @param $source * @param $type * @param array $payload @@ -304,12 +304,12 @@ class Circles { * @return mixed */ public static function shareToCircle( - $circleId, $source, $type, array $payload, $broadcaster + $circleUniqueId, $source, $type, array $payload, $broadcaster ) { $c = self::getContainer(); $frame = new SharingFrame((string)$source, (string)$type); - $frame->setCircleId((int)$circleId); + $frame->setCircleId($circleUniqueId); $frame->setPayload($payload); return $c->query('SharesService') @@ -342,13 +342,13 @@ class Circles { * * Returns the link to get access to a local circle. * - * @param int $circleId + * @param string $circleUniqueId * * @return string */ - public static function generateLink($circleId) { + public static function generateLink($circleUniqueId) { return \OC::$server->getURLGenerator() - ->linkToRoute('circles.Navigation.navigate') . '#' . $circleId; + ->linkToRoute('circles.Navigation.navigate') . '#' . $circleUniqueId; } diff --git a/lib/Controller/CirclesController.php b/lib/Controller/CirclesController.php index 7428d04c..25b65737 100644 --- a/lib/Controller/CirclesController.php +++ b/lib/Controller/CirclesController.php @@ -131,18 +131,18 @@ class CirclesController extends BaseController { * @NoAdminRequired * @NoSubAdminRequired * - * @param $id + * @param string $circleUniqueId * * @return DataResponse */ - public function join($id) { + public function join($circleUniqueId) { try { - $data = $this->circlesService->joinCircle($id); + $data = $this->circlesService->joinCircle($circleUniqueId); - return $this->success(['circle_id' => $id, 'member' => $data]); + return $this->success(['circle_id' => $circleUniqueId, 'member' => $data]); } catch (\Exception $e) { - return $this->fail(['circle_id' => $id, 'error' => $e->getMessage()]); + return $this->fail(['circle_id' => $circleUniqueId, 'error' => $e->getMessage()]); } } @@ -196,23 +196,23 @@ class CirclesController extends BaseController { * @NoAdminRequired * @NoSubAdminRequired * - * @param int $circleId + * @param string $circleUniqueId * @param string $remote * * @return DataResponse */ - public function link($circleId, $remote) { + public function link($circleUniqueId, $remote) { try { - $link = $this->federatedService->linkCircle($circleId, $remote); - $links = $this->circlesService->detailsCircle($circleId) + $link = $this->federatedService->linkCircle($circleUniqueId, $remote); + $links = $this->circlesService->detailsCircle($circleUniqueId) ->getLinks(); return $this->success( - ['circle_id' => $circleId, 'remote' => $remote, 'link' => $link, 'links' => $links] + ['circle_id' => $circleUniqueId, 'remote' => $remote, 'link' => $link, 'links' => $links] ); } catch (\Exception $e) { return $this->fail( - ['circle_id' => $circleId, 'remote' => $remote, 'error' => $e->getMessage()] + ['circle_id' => $circleUniqueId, 'remote' => $remote, 'error' => $e->getMessage()] ); } } diff --git a/lib/Controller/SharesController.php b/lib/Controller/SharesController.php index bcfeee68..4e8b5ada 100644 --- a/lib/Controller/SharesController.php +++ b/lib/Controller/SharesController.php @@ -39,25 +39,25 @@ class SharesController extends BaseController { * @NoAdminRequired * @NoSubAdminRequired * - * @param $id + * @param string $circleUniqueId * @param $source * @param $type * @param $payload * * @return DataResponse */ - public function create($id, $source, $type, $payload) { + public function create($circleUniqueId, $source, $type, $payload) { try { $share = new SharingFrame($source, $type); - $share->setCircleId($id); + $share->setCircleId($circleUniqueId); $share->setPayload($payload); $this->sharesService->createFrame($share); } catch (\Exception $e) { return $this->fail( [ - 'circle_id' => $id, + 'circle_id' => $circleUniqueId, 'source' => $source, 'type' => $type, 'payload' => $payload, diff --git a/lib/Db/CircleProviderRequestBuilder.php b/lib/Db/CircleProviderRequestBuilder.php index 460fcff8..9f4d3904 100644 --- a/lib/Db/CircleProviderRequestBuilder.php +++ b/lib/Db/CircleProviderRequestBuilder.php @@ -217,18 +217,10 @@ class CircleProviderRequestBuilder { protected function linkCircleField(& $qb, $shareId = -1) { $expr = $qb->expr(); - // TODO - Remove this in 12.0.1 - if ($qb->getConnection() - ->getDatabasePlatform() instanceof PostgreSqlPlatform - ) { - $tmpOrX = $expr->eq('s.share_with', $qb->createFunction('CAST(c.id AS TEXT)')); - } else { - $tmpOrX = - $expr->eq('s.share_with', $expr->castColumn('c.id', IQueryBuilder::PARAM_STR)); - } - $qb->from(CoreRequestBuilder::TABLE_CIRCLES, 'c'); + $tmpOrX = $expr->eq('s.share_with', 'c.unique_id'); + if ($shareId === -1) { $qb->andWhere($tmpOrX); @@ -242,7 +234,6 @@ class CircleProviderRequestBuilder { $expr->eq('s.parent', $qb->createNamedParameter($shareId)) ) ); - //->orderBy('c.circle_name'); } @@ -255,7 +246,7 @@ class CircleProviderRequestBuilder { /** @noinspection PhpMethodParametersCountMismatchInspection */ $qb->leftJoin( 'c', 'circles_members', 'mo', $expr->andX( - $expr->eq('c.id', 'mo.circle_id'), + $expr->eq('c.unique_id', 'mo.circle_id'), $expr->eq('mo.level', $qb->createNamedParameter(Member::LEVEL_OWNER)) ) ); @@ -280,13 +271,13 @@ class CircleProviderRequestBuilder { // We check if user is members of the circle with the right level $expr->andX( $expr->eq('m.user_id', $qb->createNamedParameter($userId)), - $expr->eq('m.circle_id', 'c.id'), + $expr->eq('m.circle_id', 'c.unique_id'), $expr->gte('m.level', $qb->createNamedParameter(Member::LEVEL_MEMBER)) ), // Or if user is member of one of the group linked to the circle with the right level $expr->andX( - $expr->eq('g.circle_id', 'c.id'), + $expr->eq('g.circle_id', 'c.unique_id'), $expr->gte('g.level', $qb->createNamedParameter(Member::LEVEL_MEMBER)), $expr->eq('ncgu.gid', 'g.group_id'), $expr->eq('ncgu.uid', $qb->createNamedParameter($userId)) diff --git a/lib/Db/CirclesRequest.php b/lib/Db/CirclesRequest.php index 5a592ec8..f5b23293 100644 --- a/lib/Db/CirclesRequest.php +++ b/lib/Db/CirclesRequest.php @@ -28,7 +28,6 @@ namespace OCA\Circles\Db; -use OC\L10N\L10N; use OCA\Circles\Exceptions\CircleAlreadyExistsException; use OCA\Circles\Exceptions\CircleDoesNotExistException; use OCA\Circles\Exceptions\FederatedLinkDoesNotExistException; @@ -37,8 +36,6 @@ use OCA\Circles\Model\Circle; use OCA\Circles\Model\FederatedLink; use OCA\Circles\Model\Member; use OCA\Circles\Model\SharingFrame; -use OCA\Circles\Service\MiscService; -use OCP\IDBConnection; class CirclesRequest extends CirclesRequestBuilder { @@ -51,15 +48,15 @@ class CirclesRequest extends CirclesRequestBuilder { * WARNING: This function does not filters data regarding the current user/viewer. * In case of interaction with users, Please use getCircle() instead. * - * @param int $circleId + * @param string $circleUniqueId * * @return Circle * @throws CircleDoesNotExistException */ - public function forceGetCircle($circleId) { + public function forceGetCircle($circleUniqueId) { $qb = $this->getCirclesSelectSql(); - $this->limitToId($qb, $circleId); + $this->limitToUniqueId($qb, $circleUniqueId); $cursor = $qb->execute(); $data = $cursor->fetch(); @@ -116,7 +113,7 @@ class CirclesRequest extends CirclesRequestBuilder { $qb = $this->getCirclesSelectSql(); $this->leftJoinUserIdAsViewer($qb, $userId); $this->leftJoinOwner($qb); - $this->leftJoinNCGroupAndUser($qb, $userId, 'c.id'); + $this->leftJoinNCGroupAndUser($qb, $userId, 'c.unique_id'); if ($level > 0) { $this->limitToLevel($qb, $level, ['u', 'g']); @@ -138,22 +135,22 @@ class CirclesRequest extends CirclesRequestBuilder { /** * - * @param int $circleId + * @param string $circleUniqueId * @param string $viewerId * * @return Circle * @throws CircleDoesNotExistException */ - public function getCircle($circleId, $viewerId) { + public function getCircle($circleUniqueId, $viewerId) { $qb = $this->getCirclesSelectSql(); - $this->limitToId($qb, $circleId); + $this->limitToUniqueId($qb, $circleUniqueId); $this->leftJoinUserIdAsViewer($qb, $viewerId); $this->leftJoinOwner($qb); - $this->leftJoinNCGroupAndUser($qb, $viewerId, 'c.id'); + $this->leftJoinNCGroupAndUser($qb, $viewerId, 'c.unique_id'); - $this->limitRegardingCircleType($qb, $viewerId, $circleId, Circle::CIRCLES_ALL, ''); + $this->limitRegardingCircleType($qb, $viewerId, $circleUniqueId, Circle::CIRCLES_ALL, ''); $cursor = $qb->execute(); $data = $cursor->fetch(); @@ -165,7 +162,7 @@ class CirclesRequest extends CirclesRequestBuilder { $circle = $this->parseCirclesSelectSql($data); $circle->setGroupViewer( - $this->membersRequest->forceGetHigherLevelGroupFromUser($circleId, $viewerId) + $this->membersRequest->forceGetHigherLevelGroupFromUser($circleUniqueId, $viewerId) ); return $circle; @@ -203,7 +200,7 @@ class CirclesRequest extends CirclesRequestBuilder { $circle->setId($qb->getLastInsertId()); $owner = new Member($this->l10n, $userId); - $owner->setCircleId($circle->getId()) + $owner->setCircleId($circle->getUniqueId()) ->setLevel(Member::LEVEL_OWNER) ->setStatus(Member::STATUS_MEMBER); $circle->setOwner($owner) @@ -214,16 +211,11 @@ class CirclesRequest extends CirclesRequestBuilder { /** * remove a circle * - * @param int $circleId + * @param string $circleUniqueId */ - public function destroyCircle($circleId) { - $qb = $this->getCirclesDeleteSql(); - $qb->where( - $qb->expr() - ->eq( - 'id', $qb->createNamedParameter($circleId) - ) - ); + public function destroyCircle($circleUniqueId) { + $qb = $this->getCirclesDeleteSql($circleUniqueId); + $qb->execute(); } @@ -322,7 +314,7 @@ class CirclesRequest extends CirclesRequestBuilder { public function updateCircle(Circle $circle) { - $qb = $this->getCirclesUpdateSql($circle->getId()); + $qb = $this->getCirclesUpdateSql($circle->getUniqueId(true)); $qb->set('name', $qb->createNamedParameter($circle->getName())) ->set('description', $qb->createNamedParameter($circle->getDescription())) ->set('settings', $qb->createNamedParameter($circle->getSettings(true))); @@ -356,16 +348,16 @@ class CirclesRequest extends CirclesRequestBuilder { /** - * @param int $circleId + * @param string $circleUniqueId * @param string $uniqueId * * @return SharingFrame * @throws SharingFrameDoesNotEXist */ - public function getFrame($circleId, $uniqueId) { + public function getFrame($circleUniqueId, $uniqueId) { $qb = $this->getSharesSelectSql(); $this->limitToUniqueId($qb, (string)$uniqueId); - $this->limitToCircleId($qb, (int)$circleId); + $this->limitToCircleId($qb, (string)$circleUniqueId); $cursor = $qb->execute(); $data = $cursor->fetch(); @@ -442,13 +434,13 @@ class CirclesRequest extends CirclesRequestBuilder { /** * returns all FederatedLink from a circle * - * @param int $circleId + * @param string $circleUniqueId * * @return FederatedLink[] */ - public function getLinksFromCircle($circleId) { + public function getLinksFromCircle($circleUniqueId) { $qb = $this->getLinksSelectSql(); - $this->limitToCircleId($qb, $circleId); + $this->limitToCircleId($qb, $circleUniqueId); $links = []; $cursor = $qb->execute(); diff --git a/lib/Db/CirclesRequestBuilder.php b/lib/Db/CirclesRequestBuilder.php index f11abd22..6a478e43 100644 --- a/lib/Db/CirclesRequestBuilder.php +++ b/lib/Db/CirclesRequestBuilder.php @@ -91,16 +91,17 @@ class CirclesRequestBuilder extends CoreRequestBuilder { /** * @param IQueryBuilder $qb - * @param $circleId + * @param string $circleUniqueId * @param $userId * @param $type * @param $name * * @throws ConfigNoCircleAvailable */ - protected function limitRegardingCircleType(IQueryBuilder &$qb, $userId, $circleId, $type, $name + protected function limitRegardingCircleType( + IQueryBuilder &$qb, $userId, $circleUniqueId, $type, $name ) { - $orTypes = $this->generateLimit($qb, $circleId, $userId, $type, $name); + $orTypes = $this->generateLimit($qb, $circleUniqueId, $userId, $type, $name); if (sizeof($orTypes) === 0) { throw new ConfigNoCircleAvailable( $this->l10n->t( @@ -121,17 +122,17 @@ class CirclesRequestBuilder extends CoreRequestBuilder { /** * @param IQueryBuilder $qb - * @param $circleId + * @param string $circleUniqueId * @param $userId * @param $type * @param $name * * @return array */ - private function generateLimit(IQueryBuilder &$qb, $circleId, $userId, $type, $name) { + private function generateLimit(IQueryBuilder &$qb, $circleUniqueId, $userId, $type, $name) { $orTypes = []; array_push($orTypes, $this->generateLimitPersonal($qb, $userId, $type)); - array_push($orTypes, $this->generateLimitHidden($qb, $circleId, $type, $name)); + array_push($orTypes, $this->generateLimitHidden($qb, $circleUniqueId, $type, $name)); array_push($orTypes, $this->generateLimitPrivate($qb, $type)); array_push($orTypes, $this->generateLimitPublic($qb, $type)); @@ -162,13 +163,13 @@ class CirclesRequestBuilder extends CoreRequestBuilder { /** * @param IQueryBuilder $qb - * @param int $circleId + * @param string $circleUniqueId * @param int $type * @param string $name * * @return string */ - private function generateLimitHidden(IQueryBuilder $qb, $circleId, $type, $name) { + private function generateLimitHidden(IQueryBuilder $qb, $circleUniqueId, $type, $name) { if (!(Circle::CIRCLES_HIDDEN & (int)$type)) { return null; } @@ -184,8 +185,7 @@ class CirclesRequestBuilder extends CoreRequestBuilder { $expr->gte( 'g.level', $qb->createNamedParameter(Member::LEVEL_MEMBER) ), - // TODO: Replace search on CircleID By a search on UniqueID - $expr->eq('c.id', $qb->createNamedParameter($circleId)), + $expr->eq('c.unique_id', $qb->createNamedParameter($circleUniqueId)), $expr->eq('c.name', $qb->createNamedParameter($name)) ) ); @@ -378,16 +378,16 @@ class CirclesRequestBuilder extends CoreRequestBuilder { /** * Base of the Sql Update request for Shares * - * @param int $circleId + * @param int $uniqueId * * @return IQueryBuilder */ - protected function getCirclesUpdateSql($circleId) { + protected function getCirclesUpdateSql($uniqueId) { $qb = $this->dbConnection->getQueryBuilder(); $qb->update(self::TABLE_CIRCLES) ->where( $qb->expr() - ->eq('id', $qb->createNamedParameter($circleId)) + ->eq('unique_id', $qb->createNamedParameter($uniqueId)) ); return $qb; @@ -397,11 +397,19 @@ class CirclesRequestBuilder extends CoreRequestBuilder { /** * Base of the Sql Delete request * + * @param string $circleUniqueId + * * @return IQueryBuilder */ - protected function getCirclesDeleteSql() { + protected function getCirclesDeleteSql($circleUniqueId) { $qb = $this->dbConnection->getQueryBuilder(); - $qb->delete(self::TABLE_CIRCLES); + $qb->delete(self::TABLE_CIRCLES) + ->where( + $qb->expr() + ->eq( + 'unique_id', $qb->createNamedParameter($circleUniqueId) + ) + ); return $qb; } @@ -445,7 +453,7 @@ class CirclesRequestBuilder extends CoreRequestBuilder { if (key_exists('viewer_level', $data)) { $user = new Member($this->l10n); $user->setStatus($data['viewer_status']); - $user->setCircleId($circle->getId()); + $user->setCircleId($circle->getUniqueId()); $user->setUserId($data['viewer_userid']); $user->setLevel($data['viewer_level']); $circle->setViewer($user); @@ -454,7 +462,7 @@ class CirclesRequestBuilder extends CoreRequestBuilder { if (key_exists('owner_level', $data)) { $owner = new Member($this->l10n); $owner->setStatus($data['owner_status']); - $owner->setCircleId($circle->getId()); + $owner->setCircleId($circle->getUniqueId()); $owner->setUserId($data['owner_userid']); $owner->setLevel($data['owner_level']); $circle->setOwner($owner); diff --git a/lib/Db/CoreRequestBuilder.php b/lib/Db/CoreRequestBuilder.php index 9738225e..c372f9a4 100644 --- a/lib/Db/CoreRequestBuilder.php +++ b/lib/Db/CoreRequestBuilder.php @@ -102,10 +102,10 @@ class CoreRequestBuilder { * Limit the request to the Circle by its Id. * * @param IQueryBuilder $qb - * @param int $circleId + * @param string $circleUniqueId */ - protected function limitToCircleId(IQueryBuilder &$qb, $circleId) { - $this->limitToDBField($qb, 'circle_id', $circleId); + protected function limitToCircleId(IQueryBuilder &$qb, $circleUniqueId) { + $this->limitToDBField($qb, 'circle_id', $circleUniqueId); } @@ -208,7 +208,7 @@ class CoreRequestBuilder { $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->default_select_alias . '.' : ''; $qb->from(self::TABLE_CIRCLES, 'c') - ->andWhere($expr->eq('c.id', $pf . 'circle_id')); + ->andWhere($expr->eq('c.unique_id', $pf . 'circle_id')); } diff --git a/lib/Db/FederatedLinksRequest.php b/lib/Db/FederatedLinksRequest.php index c7d6490a..6ead6c12 100644 --- a/lib/Db/FederatedLinksRequest.php +++ b/lib/Db/FederatedLinksRequest.php @@ -89,17 +89,17 @@ class FederatedLinksRequest extends FederatedLinksRequestBuilder { /** - * @param int $circleId + * @param string $circleUniqueId * * @return FederatedLink[] */ - public function getLinked($circleId) { + public function getLinked($circleUniqueId) { $qb = $this->getLinksSelectSql(); $expr = $qb->expr(); $qb->andWhere( $expr->andX( - $expr->eq('f.circle_id', $qb->createNamedParameter((int)$circleId)), + $expr->eq('f.circle_id', $qb->createNamedParameter($circleUniqueId)), $expr->eq('f.status', $qb->createNamedParameter(9)) ) ); @@ -117,18 +117,18 @@ class FederatedLinksRequest extends FederatedLinksRequestBuilder { /** - * @param int $circleId + * @param string $circleUniqueId * @param string $uniqueId * * @return FederatedLink */ - public function getFromUniqueId($circleId, $uniqueId) { + public function getFromUniqueId($circleUniqueId, $uniqueId) { $qb = $this->getLinksSelectSql(); $expr = $qb->expr(); $qb->andWhere( $expr->andX( - $expr->eq('f.circle_id', $qb->createNamedParameter((int)$circleId)), + $expr->eq('f.circle_id', $qb->createNamedParameter((int)$circleUniqueId)), $expr->eq('f.unique_id', $qb->createNamedParameter((string)$uniqueId)) ) ); diff --git a/lib/Db/MembersRequest.php b/lib/Db/MembersRequest.php index 6c7a5117..41d600a7 100644 --- a/lib/Db/MembersRequest.php +++ b/lib/Db/MembersRequest.php @@ -42,17 +42,17 @@ class MembersRequest extends MembersRequestBuilder { * WARNING: This function does not filters data regarding the current user/viewer. * In case of interaction with users, Please use MembersService->getMember() instead. * - * @param $circleId + * @param string $circleUniqueId * @param $userId * * @return Member * @throws MemberDoesNotExistException */ - public function forceGetMember($circleId, $userId) { + public function forceGetMember($circleUniqueId, $userId) { $qb = $this->getMembersSelectSql(); $this->limitToUserId($qb, $userId); - $this->limitToCircleId($qb, $circleId); + $this->limitToCircleId($qb, $circleUniqueId); $cursor = $qb->execute(); $data = $cursor->fetch(); @@ -74,20 +74,20 @@ class MembersRequest extends MembersRequestBuilder { * WARNING: This function does not filters data regarding the current user/viewer. * In case of interaction with users, Please use getMembers() instead. * - * @param int $circleId + * @param string $circleUniqueId * @param int $level * @param bool $includeGroupMembers * * @return Member[] */ public function forceGetMembers( - $circleId, $level = Member::LEVEL_MEMBER, $includeGroupMembers = false + $circleUniqueId, $level = Member::LEVEL_MEMBER, $includeGroupMembers = false ) { $qb = $this->getMembersSelectSql(); $this->limitToLevel($qb, $level); - $this->limitToCircleId($qb, $circleId); + $this->limitToCircleId($qb, $circleUniqueId); $members = []; $cursor = $qb->execute(); @@ -97,7 +97,7 @@ class MembersRequest extends MembersRequestBuilder { $cursor->closeCursor(); if ($includeGroupMembers === true) { - $this->includeGroupMembers($members, $circleId, $level); + $this->includeGroupMembers($members, $circleUniqueId, $level); } return $members; @@ -105,17 +105,17 @@ class MembersRequest extends MembersRequestBuilder { /** - * @param int $circleId + * @param string $circleUniqueId * @param Member $viewer * * @return Member[] * @throws \Exception */ - public function getMembers($circleId, Member $viewer) { + public function getMembers($circleUniqueId, Member $viewer) { try { $viewer->hasToBeMember(); - $members = $this->forceGetMembers($circleId, Member::LEVEL_MEMBER); + $members = $this->forceGetMembers($circleUniqueId, Member::LEVEL_MEMBER); if (!$viewer->isLevel(Member::LEVEL_MODERATOR)) { array_map( function(Member $m) { @@ -139,7 +139,7 @@ class MembersRequest extends MembersRequestBuilder { * WARNING: This function does not filters data regarding the current user/viewer. * In case of interaction with users, Please use getGroup() instead. * - * @param int $circleId + * @param string $circleId * @param string $groupId * * @return Member @@ -171,12 +171,12 @@ class MembersRequest extends MembersRequestBuilder { * Members List. In case of duplicate, higher level will be kept. * * @param Member[] $members - * @param int $circleId + * @param string $circleUniqueId * @param int $level */ - private function includeGroupMembers(array &$members, $circleId, $level) { + private function includeGroupMembers(array &$members, $circleUniqueId, $level) { - $groupMembers = $this->forceGetGroupMembers($circleId, $level); + $groupMembers = $this->forceGetGroupMembers($circleUniqueId, $level); foreach ($groupMembers as $member) { $index = $this->indexOfMember($members, $member->getUserId()); if ($index === -1) { @@ -217,16 +217,16 @@ class MembersRequest extends MembersRequestBuilder { * WARNING: This function does not filters data regarding the current user/viewer. * Do not use in case of direct interaction with users. * - * @param int $circleId + * @param string $circleUniqueId * @param int $level * * @return Member[] */ - public function forceGetGroupMembers($circleId, $level = Member::LEVEL_MEMBER) { + public function forceGetGroupMembers($circleUniqueId, $level = Member::LEVEL_MEMBER) { $qb = $this->getGroupsSelectSql(); $this->limitToLevel($qb, $level); - $this->limitToCircleId($qb, $circleId); + $this->limitToCircleId($qb, $circleUniqueId); $this->limitToNCGroupUser($qb); $members = []; @@ -246,15 +246,15 @@ class MembersRequest extends MembersRequestBuilder { * WARNING: This function does not filters data regarding the current user/viewer. * In case of direct interaction with users, Please don't use this. * - * @param int $circleId + * @param string $circleUniqueId * @param string $userId * * @return Member */ - public function forceGetHigherLevelGroupFromUser($circleId, $userId) { + public function forceGetHigherLevelGroupFromUser($circleUniqueId, $userId) { $qb = $this->getGroupsSelectSql(); - $this->limitToCircleId($qb, $circleId); + $this->limitToCircleId($qb, $circleUniqueId); $this->limitToNCGroupUser($qb, $userId); /** @var Member $group */ @@ -300,20 +300,20 @@ class MembersRequest extends MembersRequestBuilder { /** - * @param int $circleId + * @param string $circleUniqueId * @param Member $viewer * * @return Member[] * @throws MemberDoesNotExistException */ - public function getGroups($circleId, Member $viewer) { + public function getGroupsFromCircle($circleUniqueId, Member $viewer) { if ($viewer->getLevel() < Member::LEVEL_MEMBER) { return []; } $qb = $this->getGroupsSelectSql(); - $this->limitToCircleId($qb, $circleId); + $this->limitToCircleId($qb, $circleUniqueId); $this->limitToLevel($qb, Member::LEVEL_MEMBER); $cursor = $qb->execute(); diff --git a/lib/Model/BaseMember.php b/lib/Model/BaseMember.php index a65718d3..25d361a6 100644 --- a/lib/Model/BaseMember.php +++ b/lib/Model/BaseMember.php @@ -43,8 +43,8 @@ class BaseMember implements \JsonSerializable { const STATUS_BLOCKED = 'Blocked'; const STATUS_KICKED = 'Kicked'; - /** @var int */ - private $circleId; + /** @var string */ + private $circleUniqueId; /** @var L10N */ protected $l10n; @@ -70,30 +70,46 @@ class BaseMember implements \JsonSerializable { /** @var string */ private $joined; - public function __construct($l10n, $userId = '', $circleId = -1) { + /** + * BaseMember constructor. + * + * @param $l10n + * @param string $userId + * @param string $circleUniqueId + */ + public function __construct($l10n, $userId = '', $circleUniqueId = '') { $this->l10n = $l10n; if ($userId !== '') { $this->setUserId($userId); } - if ($circleId > -1) { - $this->setCircleId($circleId); + if ($circleUniqueId > -1) { + $this->setCircleId($circleUniqueId); } $this->setLevel(Member::LEVEL_NONE); $this->setStatus(Member::STATUS_NONMEMBER); } - public function setCircleId($circleId) { - $this->circleId = (int)$circleId; + /** + * @param string $circleUniqueId + * + * @return $this + */ + public function setCircleId($circleUniqueId) { + $this->circleUniqueId = (int)$circleUniqueId; return $this; } + /** + * @return string + */ public function getCircleId() { - return $this->circleId; + return $this->circleUniqueId; } + /** * @param string $groupId */ diff --git a/lib/Model/FederatedLink.php b/lib/Model/FederatedLink.php index 9c7e0b23..9a471d48 100644 --- a/lib/Model/FederatedLink.php +++ b/lib/Model/FederatedLink.php @@ -59,7 +59,7 @@ class FederatedLink implements \JsonSerializable { private $creation; /** @var int */ - private $circleId; + private $circleUniqueId; /** @var string */ private $uniqueId = ''; @@ -171,21 +171,21 @@ class FederatedLink implements \JsonSerializable { /** - * @param int $circleId + * @param string $circleUniqueId * * @return FederatedLink */ - public function setCircleId($circleId) { - $this->circleId = (int)$circleId; + public function setCircleId($circleUniqueId) { + $this->circleUniqueId = $circleUniqueId; return $this; } /** - * @return int + * @return string */ public function getCircleId() { - return $this->circleId; + return $this->circleUniqueId; } diff --git a/lib/Model/SharingFrame.php b/lib/Model/SharingFrame.php index 0d8122bf..d16ccfb0 100644 --- a/lib/Model/SharingFrame.php +++ b/lib/Model/SharingFrame.php @@ -37,7 +37,7 @@ class SharingFrame implements \JsonSerializable { private $type; /** @var int */ - private $circleId; + private $circleUniqueId; /** @var string */ private $circleName; @@ -81,17 +81,17 @@ class SharingFrame implements \JsonSerializable { } /** - * @param int $circleId + * @param string $circleUniqueId */ - public function setCircleId($circleId) { - $this->circleId = (int)$circleId; + public function setCircleId($circleUniqueId) { + $this->circleUniqueId = (int)$circleUniqueId; } /** - * @return int + * @return string */ public function getCircleId() { - return $this->circleId; + return $this->circleUniqueId; } diff --git a/lib/Service/BroadcastService.php b/lib/Service/BroadcastService.php index 68c68f05..e2abfab3 100644 --- a/lib/Service/BroadcastService.php +++ b/lib/Service/BroadcastService.php @@ -103,7 +103,6 @@ class BroadcastService { foreach ($users AS $user) { $broadcaster->createShareToUser($frame, $user->getUserId()); } - } diff --git a/lib/Service/CirclesService.php b/lib/Service/CirclesService.php index 96c73614..ed10414f 100644 --- a/lib/Service/CirclesService.php +++ b/lib/Service/CirclesService.php @@ -122,7 +122,7 @@ class CirclesService { $this->circlesRequest->createCircle($circle, $this->userId); $this->membersRequest->createMember($circle->getOwner()); } catch (\Exception $e) { - $this->circlesRequest->destroyCircle($circle->getId()); + $this->circlesRequest->destroyCircle($circle->getUniqueId(true)); throw $e; } @@ -164,15 +164,15 @@ class CirclesService { /** * returns details on circle and its members if this->userId is a member itself. * - * @param $circleId + * @param string $circleUniqueId * * @return Circle * @throws \Exception ] */ - public function detailsCircle($circleId) { + public function detailsCircle($circleUniqueId) { try { - $circle = $this->circlesRequest->getCircle($circleId, $this->userId); + $circle = $this->circlesRequest->getCircle($circleUniqueId, $this->userId); if ($circle->getHigherViewer() ->isLevel(Member::LEVEL_MEMBER) ) { @@ -195,7 +195,7 @@ class CirclesService { */ private function detailsCircleMembers(Circle &$circle) { $members = - $this->membersRequest->getMembers($circle->getId(), $circle->getHigherViewer()); + $this->membersRequest->getMembers($circle->getUniqueId(), $circle->getHigherViewer()); $circle->setMembers($members); } @@ -210,7 +210,7 @@ class CirclesService { $groups = []; if ($this->configService->isLinkedGroupsAllowed()) { $groups = - $this->membersRequest->getGroups($circle->getId(), $circle->getHigherViewer()); + $this->membersRequest->getGroupsFromCircle($circle->getUniqueId(), $circle->getHigherViewer()); } $circle->setGroups($groups); @@ -228,7 +228,7 @@ class CirclesService { try { if ($this->configService->isFederatedCirclesAllowed()) { $circle->hasToBeFederated(); - $links = $this->circlesRequest->getLinksFromCircle($circle->getId()); + $links = $this->circlesRequest->getLinksFromCircle($circle->getUniqueId()); } } catch (FederatedCircleNotAllowedException $e) { } @@ -270,20 +270,20 @@ class CirclesService { /** * Join a circle. * - * @param $circleId + * @param string $circleUniqueId * * @return null|Member * @throws \Exception */ - public function joinCircle($circleId) { + public function joinCircle($circleUniqueId) { try { - $circle = $this->circlesRequest->getCircle($circleId, $this->userId); + $circle = $this->circlesRequest->getCircle($circleUniqueId, $this->userId); try { - $member = $this->membersRequest->forceGetMember($circle->getId(), $this->userId); + $member = $this->membersRequest->forceGetMember($circle->getUniqueId(), $this->userId); } catch (MemberDoesNotExistException $m) { - $member = new Member($this->l10n, $this->userId, $circle->getId()); + $member = new Member($this->l10n, $this->userId, $circle->getUniqueId()); $this->membersRequest->createMember($member); } diff --git a/lib/Service/EventsService.php b/lib/Service/EventsService.php index 464cae34..5e2a4f2d 100644 --- a/lib/Service/EventsService.php +++ b/lib/Service/EventsService.php @@ -126,7 +126,8 @@ class EventsService { $event = $this->generateEvent('circles_as_member'); $event->setSubject('circle_delete', ['circle' => json_encode($circle)]); $this->publishEvent( - $event, $this->membersRequest->forceGetMembers($circle->getId(), Member::LEVEL_MEMBER) + $event, + $this->membersRequest->forceGetMembers($circle->getUniqueId(), Member::LEVEL_MEMBER) ); } @@ -164,7 +165,8 @@ class EventsService { ); $this->publishEvent( - $event, $this->membersRequest->forceGetMembers($circle->getId(), Member::LEVEL_MEMBER) + $event, + $this->membersRequest->forceGetMembers($circle->getUniqueId(), Member::LEVEL_MEMBER) ); } @@ -216,7 +218,9 @@ class EventsService { $this->publishEvent( $event, array_merge( [$member], - $this->membersRequest->forceGetMembers($circle->getId(), Member::LEVEL_MODERATOR) + $this->membersRequest->forceGetMembers( + $circle->getUniqueId(), Member::LEVEL_MODERATOR + ) ) ); } @@ -245,7 +249,9 @@ class EventsService { $this->publishEvent( $event, array_merge( [$member], - $this->membersRequest->forceGetMembers($circle->getId(), Member::LEVEL_MODERATOR) + $this->membersRequest->forceGetMembers( + $circle->getUniqueId(), Member::LEVEL_MODERATOR + ) ) ); @@ -276,7 +282,9 @@ class EventsService { $this->publishEvent( $event, array_merge( [$member], - $this->membersRequest->forceGetMembers($circle->getId(), Member::LEVEL_MEMBER) + $this->membersRequest->forceGetMembers( + $circle->getUniqueId(), Member::LEVEL_MEMBER + ) ) ); @@ -311,7 +319,8 @@ class EventsService { ['circle' => json_encode($circle), 'member' => json_encode($member)] ); - $mods = $this->membersRequest->forceGetMembers($circle->getId(), Member::LEVEL_MODERATOR); + $mods = + $this->membersRequest->forceGetMembers($circle->getUniqueId(), Member::LEVEL_MODERATOR); if ($member->getLevel() < Member::LEVEL_MODERATOR) { array_push($mods, $member); } @@ -336,9 +345,8 @@ class EventsService { ); $this->publishEvent( - $event, $this->membersRequest->forceGetMembers( - $circle->getId(), Member::LEVEL_MEMBER - ) + $event, + $this->membersRequest->forceGetMembers($circle->getUniqueId(), Member::LEVEL_MEMBER) ); } diff --git a/lib/Service/FederatedService.php b/lib/Service/FederatedService.php index 457ac14c..3c1ff117 100644 --- a/lib/Service/FederatedService.php +++ b/lib/Service/FederatedService.php @@ -140,7 +140,7 @@ class FederatedService { * * $remote format: <circle_name>@<remote_host> * - * @param int $circleId + * @param string $circleUniqueId * @param string $remote * * @throws Exception @@ -149,7 +149,7 @@ class FederatedService { * * @return FederatedLink */ - public function linkCircle($circleId, $remote) { + public function linkCircle($circleUniqueId, $remote) { if (!$this->configService->isFederatedCirclesAllowed()) { throw new FederatedCircleNotAllowedException( @@ -164,7 +164,7 @@ class FederatedService { } try { - return $this->requestLinkWithCircle($circleId, $remote); + return $this->requestLinkWithCircle($circleUniqueId, $remote); } catch (Exception $e) { throw $e; } @@ -202,7 +202,7 @@ class FederatedService { $link->hasToBeValidStatusUpdate($status); if (!$this->eventOnLinkStatus($circle, $link, $status)) { - return $this->circlesRequest->getLinksFromCircle($circle->getId()); + return $this->circlesRequest->getLinksFromCircle($circle->getUniqueId()); } $link->setStatus($status); @@ -218,7 +218,7 @@ class FederatedService { } catch (Exception $e) { } - return $this->circlesRequest->getLinksFromCircle($circle->getId()); + return $this->circlesRequest->getLinksFromCircle($circle->getUniqueId()); } @@ -260,26 +260,26 @@ class FederatedService { * in the database and send a request to the remote circle using requestLink() * If any issue, entry is removed from the database. * - * @param int $circleId + * @param string $circleUniqueId * @param string $remote * * @return FederatedLink * @throws Exception */ - private function requestLinkWithCircle($circleId, $remote) { + private function requestLinkWithCircle($circleUniqueId, $remote) { $link = null; try { list($remoteCircle, $remoteAddress) = explode('@', $remote, 2); - $circle = $this->circlesService->detailsCircle($circleId); + $circle = $this->circlesService->detailsCircle($circleUniqueId); $circle->getHigherViewer() ->hasToBeAdmin(); $circle->hasToBeFederated(); $circle->cantBePersonal(); $link = new FederatedLink(); - $link->setCircleId($circleId) + $link->setCircleId($circleUniqueId) ->setLocalAddress($this->serverHost) ->setAddress($remoteAddress) ->setRemoteCircleName($remoteCircle) @@ -637,7 +637,7 @@ class FederatedService { try { $this->checkLinkRequestValidity($circle, $link); - $link->setCircleId($circle->getId()); + $link->setCircleId($circle->getUniqueId()); if ($circle->getSetting('allow_links_auto') === 'true') { $link->setStatus(FederatedLink::STATUS_LINK_UP); @@ -665,7 +665,7 @@ class FederatedService { throw new LinkCreationException('duplicate_unique_id'); } - if ($this->getLink($circle->getId(), $link->getUniqueId(true)) !== null) { + if ($this->getLink($circle->getUniqueId(), $link->getUniqueId(true)) !== null) { throw new LinkCreationException('duplicate_link'); } @@ -712,43 +712,43 @@ class FederatedService { } /** - * @param int $circleId + * @param string $circleUniqueId * @param string $uniqueId * * @return FederatedLink */ - public function getLink($circleId, $uniqueId) { - return $this->federatedLinksRequest->getFromUniqueId($circleId, $uniqueId); + public function getLink($circleUniqueId, $uniqueId) { + return $this->federatedLinksRequest->getFromUniqueId($circleUniqueId, $uniqueId); } /** - * @param int $circleId + * @param string $circleUniqueId * * @return FederatedLink[] */ - public function getLinks($circleId) { - return $this->federatedLinksRequest->getLinked($circleId); + public function getLinksFromCircle($circleUniqueId) { + return $this->federatedLinksRequest->getLinked($circleUniqueId); } /** - * @param int $circleId + * @param string $circleUniqueId * @param string $uniqueId * * @return bool * @throws Exception */ - public function initiateRemoteShare($circleId, $uniqueId) { + public function initiateRemoteShare($circleUniqueId, $uniqueId) { $args = [ 'apiVersion' => Circles::API_VERSION, - 'circleId' => (int)$circleId, + 'circleId' => (string)$circleUniqueId, 'uniqueId' => (string)$uniqueId ]; $client = $this->clientService->newClient(); try { - $request = $client->post( + $client->post( $this->generatePayloadDeliveryURL($this->serverHost), [ 'body' => $args, 'timeout' => 10, @@ -756,7 +756,7 @@ class FederatedService { ] ); - $result = json_decode($request->getBody(), true); +// $result = json_decode($request->getBody(), true); // $this->miscService->log( // "initiateRemoteShare result: " . $uniqueId . ' ---- ' . var_export($result, true) // ); @@ -780,7 +780,7 @@ class FederatedService { throw new Exception('unknown_circle'); } - $links = $this->getLinks($frame->getCircleId()); + $links = $this->getLinksFromCircle($frame->getCircleId()); foreach ($links AS $link) { $args = [ diff --git a/lib/Service/GroupsService.php b/lib/Service/GroupsService.php index 2d4e15b3..7f299f31 100644 --- a/lib/Service/GroupsService.php +++ b/lib/Service/GroupsService.php @@ -105,7 +105,7 @@ class GroupsService { $this->membersRequest->updateGroup($group); // $this->eventsService->onMemberNew($circle, $group); - return $this->membersRequest->getGroups($circleId, $circle->getHigherViewer()); + return $this->membersRequest->getGroupsFromCircle($circleId, $circle->getHigherViewer()); } @@ -162,7 +162,7 @@ class GroupsService { ); } - $group = $this->membersRequest->forceGetGroup($circle->getId(), $groupId); + $group = $this->membersRequest->forceGetGroup($circle->getUniqueId(), $groupId); if ($group->getLevel() !== $level) { if ($level === Member::LEVEL_OWNER) { throw new GroupCannotBeOwnerException( @@ -175,7 +175,7 @@ class GroupsService { // $this->eventsService->onMemberLevel($circle, $member); } - return $this->membersRequest->getGroups($circle->getId(), $circle->getHigherViewer()); + return $this->membersRequest->getGroupsFromCircle($circle->getUniqueId(), $circle->getHigherViewer()); } catch (\Exception $e) { throw $e; } @@ -237,7 +237,7 @@ class GroupsService { throw $e; } - return $this->membersRequest->getGroups($circle->getId(), $circle->getHigherViewer()); + return $this->membersRequest->getGroupsFromCircle($circle->getUniqueId(), $circle->getHigherViewer()); } diff --git a/lib/Service/MembersService.php b/lib/Service/MembersService.php index 45a7614f..5407fe10 100644 --- a/lib/Service/MembersService.php +++ b/lib/Service/MembersService.php @@ -126,7 +126,7 @@ class MembersService { $this->eventsService->onMemberNew($circle, $member); - return $this->membersRequest->getMembers($circle->getId(), $circle->getHigherViewer()); + return $this->membersRequest->getMembers($circle->getUniqueId(), $circle->getHigherViewer()); } @@ -167,7 +167,7 @@ class MembersService { } } - return $this->membersRequest->getMembers($circle->getId(), $circle->getHigherViewer()); + return $this->membersRequest->getMembers($circle->getUniqueId(), $circle->getHigherViewer()); } @@ -287,7 +287,7 @@ class MembersService { ); } - $member = $this->membersRequest->forceGetMember($circle->getId(), $name); + $member = $this->membersRequest->forceGetMember($circle->getUniqueId(), $name); if ($member->getLevel() !== $level) { if ($level === Member::LEVEL_OWNER) { $this->switchOwner($circle, $member); @@ -298,7 +298,7 @@ class MembersService { $this->eventsService->onMemberLevel($circle, $member); } - return $this->membersRequest->getMembers($circle->getId(), $circle->getHigherViewer()); + return $this->membersRequest->getMembers($circle->getUniqueId(), $circle->getHigherViewer()); } catch (\Exception $e) { throw $e; } @@ -385,7 +385,7 @@ class MembersService { $this->eventsService->onMemberLeaving($circle, $member); - return $this->membersRequest->getMembers($circle->getId(), $circle->getHigherViewer()); + return $this->membersRequest->getMembers($circle->getUniqueId(), $circle->getHigherViewer()); } diff --git a/lib/Service/SharesService.php b/lib/Service/SharesService.php index fa91965e..8e47c79b 100644 --- a/lib/Service/SharesService.php +++ b/lib/Service/SharesService.php @@ -114,7 +114,7 @@ class SharesService { if ($this->configService->isFederatedCirclesAllowed()) { $this->federatedService->initiateRemoteShare( - $circle->getId(), $frame->getUniqueId() + $circle->getUniqueId(), $frame->getUniqueId() ); } } catch (Exception $e) { |