summaryrefslogtreecommitdiffstats
path: root/apps/user_status/lib
diff options
context:
space:
mode:
authorjld3103 <jld3103yt@gmail.com>2023-01-18 14:00:31 +0100
committerjld3103 <jld3103yt@gmail.com>2023-01-25 07:16:26 +0100
commit1f49a56a98ac7d08608ed895f6843caab9c0242c (patch)
treeaf8d9bf3d506c9cb7086d7ca58353d4870e0ef11 /apps/user_status/lib
parentd66bf39de5b37e6269b77c8af7865233c1a40ab2 (diff)
downloadnextcloud-server-1f49a56a98ac7d08608ed895f6843caab9c0242c.tar.gz
nextcloud-server-1f49a56a98ac7d08608ed895f6843caab9c0242c.zip
Fix user_status heartbeat response
Signed-off-by: jld3103 <jld3103yt@gmail.com>
Diffstat (limited to 'apps/user_status/lib')
-rw-r--r--apps/user_status/lib/Controller/HeartbeatController.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/apps/user_status/lib/Controller/HeartbeatController.php b/apps/user_status/lib/Controller/HeartbeatController.php
index 82978f0983a..e0b735f044f 100644
--- a/apps/user_status/lib/Controller/HeartbeatController.php
+++ b/apps/user_status/lib/Controller/HeartbeatController.php
@@ -30,7 +30,7 @@ use OCA\UserStatus\Service\StatusService;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\Http;
-use OCP\AppFramework\Http\JSONResponse;
+use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\OCSController;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\EventDispatcher\IEventDispatcher;
@@ -70,16 +70,16 @@ class HeartbeatController extends OCSController {
* @NoAdminRequired
*
* @param string $status
- * @return JSONResponse
+ * @return DataResponse
*/
- public function heartbeat(string $status): JSONResponse {
+ public function heartbeat(string $status): DataResponse {
if (!\in_array($status, [IUserStatus::ONLINE, IUserStatus::AWAY], true)) {
- return new JSONResponse([], Http::STATUS_BAD_REQUEST);
+ return new DataResponse([], Http::STATUS_BAD_REQUEST);
}
$user = $this->userSession->getUser();
if ($user === null) {
- return new JSONResponse([], Http::STATUS_INTERNAL_SERVER_ERROR);
+ return new DataResponse([], Http::STATUS_INTERNAL_SERVER_ERROR);
}
$event = new UserLiveStatusEvent(
@@ -92,11 +92,11 @@ class HeartbeatController extends OCSController {
$userStatus = $event->getUserStatus();
if (!$userStatus) {
- return new JSONResponse([], Http::STATUS_NO_CONTENT);
+ return new DataResponse([], Http::STATUS_NO_CONTENT);
}
/** @psalm-suppress UndefinedInterfaceMethod */
- return new JSONResponse($this->formatStatus($userStatus->getInternal()));
+ return new DataResponse($this->formatStatus($userStatus->getInternal()));
}
private function formatStatus(UserStatus $status): array {