Skip to content

Commit

Permalink
use UserSession for dav conn
Browse files Browse the repository at this point in the history
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
  • Loading branch information
ArtificialOwl committed Jul 1, 2020
1 parent 81aee53 commit de66cb7
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 @@ -52,6 +52,7 @@
use OCA\Circles\Model\Member;
use OCP\IGroupManager;
use OCP\IL10N;
use OCP\IUserSession;

class CirclesService {

Expand Down Expand Up @@ -97,6 +98,7 @@ class CirclesService {
*
* @param string $userId
* @param IL10N $l10n
* @param IUserSession $userSession
* @param IGroupManager $groupManager
* @param ConfigService $configService
* @param CirclesRequest $circlesRequest
Expand All @@ -111,6 +113,7 @@ class CirclesService {
public function __construct(
$userId,
IL10N $l10n,
IUserSession $userSession,
IGroupManager $groupManager,
ConfigService $configService,
CirclesRequest $circlesRequest,
Expand All @@ -122,6 +125,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 de66cb7

Please sign in to comment.