diff options
author | Joas Schilling <coding@schilljs.com> | 2023-05-01 22:00:42 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2023-05-01 22:08:04 +0200 |
commit | 2445eb98686a52cb31c53c4a7946ca666f91ef85 (patch) | |
tree | 14c2109421b4e5a74c0a63695bd3c8df2bf60b06 /lib | |
parent | 3491ba27b335b4fc668403c800fb6496ea7ebeb7 (diff) |
fix(user-status): Fix type and missing docs of user status clearAt
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Controller/RoomController.php | 3 | ||||
-rw-r--r-- | lib/Service/RoomFormatter.php | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/Controller/RoomController.php b/lib/Controller/RoomController.php index b5ebf1b69..2ab85d91d 100644 --- a/lib/Controller/RoomController.php +++ b/lib/Controller/RoomController.php @@ -818,10 +818,11 @@ class RoomController extends AEnvironmentAwareController { } if (isset($statuses[$userId])) { + $clearAt = $statuses[$userId]->getClearAt(); $result['status'] = $statuses[$userId]->getStatus(); $result['statusIcon'] = $statuses[$userId]->getIcon(); $result['statusMessage'] = $statuses[$userId]->getMessage(); - $result['statusClearAt'] = $statuses[$userId]->getClearAt(); + $result['statusClearAt'] = $clearAt ? $clearAt->getTimestamp() : null; } elseif (isset($headers['X-Nextcloud-Has-User-Statuses'])) { $result['status'] = IUserStatus::OFFLINE; $result['statusIcon'] = null; diff --git a/lib/Service/RoomFormatter.php b/lib/Service/RoomFormatter.php index 104473a5d..cf8a17267 100644 --- a/lib/Service/RoomFormatter.php +++ b/lib/Service/RoomFormatter.php @@ -324,10 +324,11 @@ class RoomFormatter { } if (isset($statuses[$participant])) { + $clearAt = $statuses[$participant]->getClearAt(); $roomData['status'] = $statuses[$participant]->getStatus(); $roomData['statusIcon'] = $statuses[$participant]->getIcon(); $roomData['statusMessage'] = $statuses[$participant]->getMessage(); - $roomData['statusClearAt'] = $statuses[$participant]->getClearAt(); + $roomData['statusClearAt'] = $clearAt ? $clearAt->getTimestamp() : null; } elseif (!empty($statuses)) { $roomData['status'] = IUserStatus::OFFLINE; $roomData['statusIcon'] = null; |