Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2021-02-12 00:13:06 +0300
committerJoas Schilling <coding@schilljs.com>2021-02-12 12:46:35 +0300
commitc39f2c7ce93ffc0b6de2c72fc84094eff738d0f8 (patch)
tree49a3667aca4727f77ff243447c51375e0aa3dbd6 /lib
parent3606f14153d956d5513c2646d45a172bc0517376 (diff)
Don't recalculate the actorId of guest attendees
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/Controller/ChatController.php18
1 files changed, 3 insertions, 15 deletions
diff --git a/lib/Controller/ChatController.php b/lib/Controller/ChatController.php
index 49257cbca..4be98b359 100644
--- a/lib/Controller/ChatController.php
+++ b/lib/Controller/ChatController.php
@@ -37,7 +37,6 @@ use OCA\Talk\Participant;
use OCA\Talk\Room;
use OCA\Talk\Service\ParticipantService;
use OCA\Talk\Service\SessionService;
-use OCA\Talk\TalkSession;
use OCP\App\IAppManager;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
@@ -65,9 +64,6 @@ class ChatController extends AEnvironmentAwareController {
/** @var IUserManager */
private $userManager;
- /** @var TalkSession */
- private $session;
-
/** @var IAppManager */
private $appManager;
@@ -120,7 +116,6 @@ class ChatController extends AEnvironmentAwareController {
?string $UserId,
IRequest $request,
IUserManager $userManager,
- TalkSession $session,
IAppManager $appManager,
ChatManager $chatManager,
ParticipantService $participantService,
@@ -140,7 +135,6 @@ class ChatController extends AEnvironmentAwareController {
$this->userId = $UserId;
$this->userManager = $userManager;
- $this->session = $session;
$this->appManager = $appManager;
$this->chatManager = $chatManager;
$this->participantService = $participantService;
@@ -161,15 +155,9 @@ class ChatController extends AEnvironmentAwareController {
protected function getActorInfo(string $actorDisplayName = ''): array {
if ($this->userId === null) {
$actorType = Attendee::ACTOR_GUESTS;
- $sessionId = $this->session->getSessionForRoom($this->room->getToken());
- // The character limit for actorId is 64, but the spreed-session is
- // 256 characters long, so it has to be hashed to get an ID that
- // fits (except if there is no session, as the actorId should be
- // empty in that case but sha1('') would generate a hash too
- // instead of returning an empty string).
- $actorId = $sessionId ? sha1($sessionId) : 'failed-to-get-session';
-
- if ($sessionId && $actorDisplayName) {
+ $actorId = $this->participant->getAttendee()->getActorId();
+
+ if ($actorDisplayName) {
$this->guestManager->updateName($this->room, $this->participant, $actorDisplayName);
}
} else {