diff options
author | Joas Schilling <coding@schilljs.com> | 2023-05-02 13:15:24 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2023-05-02 13:15:24 +0200 |
commit | 5c2471866a7a8a3ecda3ae57b126c3514a513059 (patch) | |
tree | 44d982c6b58914d7fbc5857a80e8d946fdf3175c /lib | |
parent | eac2b0c50031857c8239a1f3222a59c5b10d9f82 (diff) |
chore(api): Use nullsafe operator
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, 2 insertions, 4 deletions
diff --git a/lib/Controller/RoomController.php b/lib/Controller/RoomController.php index 2ab85d91d..787a2d63d 100644 --- a/lib/Controller/RoomController.php +++ b/lib/Controller/RoomController.php @@ -818,11 +818,10 @@ 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'] = $clearAt ? $clearAt->getTimestamp() : null; + $result['statusClearAt'] = $statuses[$userId]->getClearAt()?->getTimestamp(); } 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 cf8a17267..1b8f4ecda 100644 --- a/lib/Service/RoomFormatter.php +++ b/lib/Service/RoomFormatter.php @@ -324,11 +324,10 @@ 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'] = $clearAt ? $clearAt->getTimestamp() : null; + $roomData['statusClearAt'] = $statuses[$participant]->getClearAt()?->getTimestamp(); } elseif (!empty($statuses)) { $roomData['status'] = IUserStatus::OFFLINE; $roomData['statusIcon'] = null; |