summaryrefslogtreecommitdiffstats
path: root/lib/Controller/PublicShareAuthController.php
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2019-02-20 17:48:05 +0100
committerJoas Schilling <coding@schilljs.com>2019-02-27 15:26:50 +0100
commit7e54634fb53e5a51ab36212b0945d086f1a1573f (patch)
treeebc61fe4b4561bf99a4ad5ece770e32a960de0a1 /lib/Controller/PublicShareAuthController.php
parent1a4f96436a88e6f0a6b4fe4a599721ca1f166f0b (diff)
Make room names non-optional
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Controller/PublicShareAuthController.php')
-rw-r--r--lib/Controller/PublicShareAuthController.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Controller/PublicShareAuthController.php b/lib/Controller/PublicShareAuthController.php
index 8a3c73fe9..07f0e614d 100644
--- a/lib/Controller/PublicShareAuthController.php
+++ b/lib/Controller/PublicShareAuthController.php
@@ -31,6 +31,7 @@ use OCP\AppFramework\OCSController;
use OCP\IRequest;
use OCP\IUser;
use OCP\IUserManager;
+use OCP\IUserSession;
use OCP\Share;
use OCP\Share\IManager as IShareManager;
use OCP\Share\Exceptions\ShareNotFound;
@@ -41,6 +42,8 @@ class PublicShareAuthController extends OCSController {
private $userManager;
/** @var IShareManager */
private $shareManager;
+ /** @var IUserSession */
+ private $userSession;
/** @var Manager */
private $manager;
@@ -49,11 +52,13 @@ class PublicShareAuthController extends OCSController {
IRequest $request,
IUserManager $userManager,
IShareManager $shareManager,
+ IUserSession $userSession,
Manager $manager
) {
parent::__construct($appName, $request);
$this->userManager = $userManager;
$this->shareManager = $shareManager;
+ $this->userSession = $userSession;
$this->manager = $manager;
}
@@ -106,10 +111,13 @@ class PublicShareAuthController extends OCSController {
'participantType' => Participant::OWNER,
]);
+ $user = $this->userSession->getUser();
+ $userId = $user instanceof IUser ? $user->getUID() : '';
+
return new DataResponse([
'token' => $room->getToken(),
'name' => $room->getName(),
- 'displayName' => $room->getName(),
+ 'displayName' => $room->getDisplayName($userId),
], Http::STATUS_CREATED);
}
}