From 4713ae5baa62eacd322325fa5e0d1cfaf370abef Mon Sep 17 00:00:00 2001 From: shimon Date: Wed, 3 Dec 2025 21:39:59 +0200 Subject: [PATCH] composer format --- app/realtime.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/realtime.php b/app/realtime.php index 94ac86493d..02193f5522 100644 --- a/app/realtime.php +++ b/app/realtime.php @@ -614,7 +614,7 @@ $server->onOpen(function (int $connection, SwooleRequest $request) use ($server, $code = 500; } - + $message = $th->getMessage(); // sanitize 0 && 5xx errors @@ -722,12 +722,12 @@ $server->onMessage(function (int $connection, string $message) use ($server, $re $roles = $user->getRoles($database->getAuthorization()); $channels = Realtime::convertChannels(array_flip($realtime->connections[$connection]['channels']), $user->getId()); - + // Preserve authorization before subscribe overwrites the connection array $authorization = $realtime->connections[$connection]['authorization'] ?? null; - + $realtime->subscribe($realtime->connections[$connection]['projectId'], $connection, $roles, $channels); - + // Restore authorization after subscribe if ($authorization !== null) { $realtime->connections[$connection]['authorization'] = $authorization;