Skip to content

Commit

Permalink
Merge pull request #457 from nextcloud/backport/444/stable16
Browse files Browse the repository at this point in the history
[stable16] use UserSession for dav conn
  • Loading branch information
ArtificialOwl authored Jul 9, 2020
2 parents 515bc53 + 4fbf191 commit 9b9dc81
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/Service/CirclesService.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
use OCA\Circles\Model\Member;
use OCP\IGroupManager;
use OCP\IL10N;
use OCP\IUserSession;

class CirclesService {

Expand Down Expand Up @@ -91,6 +92,7 @@ class CirclesService {
*
* @param string $userId
* @param IL10N $l10n
* @param IUserSession $userSession
* @param IGroupManager $groupManager
* @param ConfigService $configService
* @param CirclesRequest $circlesRequest
Expand All @@ -104,6 +106,7 @@ class CirclesService {
public function __construct(
$userId,
IL10N $l10n,
IUserSession $userSession,
IGroupManager $groupManager,
ConfigService $configService,
CirclesRequest $circlesRequest,
Expand All @@ -114,6 +117,14 @@ public function __construct(
CircleProviderRequest $circleProviderRequest,
MiscService $miscService
) {

if ($userId === null) {
$user = $userSession->getUser();
if ($user !== null) {
$userId = $user->getUID();
}
}

$this->userId = $userId;
$this->l10n = $l10n;
$this->groupManager = $groupManager;
Expand Down

0 comments on commit 9b9dc81

Please sign in to comment.