diff options
author | Carl Schwan <carl@carlschwan.eu> | 2022-04-05 20:21:02 +0200 |
---|---|---|
committer | Carl Schwan <carl@carlschwan.eu> | 2022-04-07 15:16:34 +0200 |
commit | 1dbe7dafe26f4a11af610f3ce0dea59c31227d78 (patch) | |
tree | d3d23bb86d3b4434c19dd925a97a53db704c8871 /apps/user_status/lib/Connector | |
parent | 9c84aa5870204a871024ca18b4994ed40defdd9b (diff) | |
download | nextcloud-server-1dbe7dafe26f4a11af610f3ce0dea59c31227d78.tar.gz nextcloud-server-1dbe7dafe26f4a11af610f3ce0dea59c31227d78.zip |
Fetch status in heartbeat controller only once
Store the user status inside the event instead of fetching it again
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'apps/user_status/lib/Connector')
-rw-r--r-- | apps/user_status/lib/Connector/UserStatus.php | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/apps/user_status/lib/Connector/UserStatus.php b/apps/user_status/lib/Connector/UserStatus.php index 26dc2be7e93..ff05ded9e2b 100644 --- a/apps/user_status/lib/Connector/UserStatus.php +++ b/apps/user_status/lib/Connector/UserStatus.php @@ -46,12 +46,11 @@ class UserStatus implements IUserStatus { /** @var DateTimeImmutable|null */ private $clearAt; - /** - * UserStatus constructor. - * - * @param Db\UserStatus $status - */ + /** @var Db\UserStatus */ + private $internalStatus; + public function __construct(Db\UserStatus $status) { + $this->internalStatus = $status; $this->userId = $status->getUserId(); $this->status = $status->getStatus(); $this->message = $status->getCustomMessage(); @@ -99,4 +98,8 @@ class UserStatus implements IUserStatus { public function getClearAt(): ?DateTimeImmutable { return $this->clearAt; } + + public function getInternal(): Db\UserStatus { + return $this->internalStatus; + } } |