aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/User/Events/UserLiveStatusEvent.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/public/User/Events/UserLiveStatusEvent.php')
-rw-r--r--lib/public/User/Events/UserLiveStatusEvent.php58
1 files changed, 24 insertions, 34 deletions
diff --git a/lib/public/User/Events/UserLiveStatusEvent.php b/lib/public/User/Events/UserLiveStatusEvent.php
index 2d85fe1f2c6..b1f4c9c1d75 100644
--- a/lib/public/User/Events/UserLiveStatusEvent.php
+++ b/lib/public/User/Events/UserLiveStatusEvent.php
@@ -3,37 +3,19 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2020, Georg Ehrke
- *
- * @author Georg Ehrke <oc.list@georgehrke.com>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
-
namespace OCP\User\Events;
use OCP\EventDispatcher\Event;
use OCP\IUser;
+use OCP\UserStatus\IUserStatus;
/**
* @since 20.0.0
*/
class UserLiveStatusEvent extends Event {
-
/**
* @var string
* @since 20.0.0
@@ -52,24 +34,17 @@ class UserLiveStatusEvent extends Event {
*/
public const STATUS_OFFLINE = 'offline';
- /** @var IUser */
- private $user;
-
- /** @var string */
- private $status;
-
- /** @var int */
- private $timestamp;
+ private IUser $user;
+ private string $status;
+ private int $timestamp;
+ private ?IUserStatus $userStatus = null;
/**
- * @param IUser $user
- * @param string $status
- * @param int $timestamp
* @since 20.0.0
*/
public function __construct(IUser $user,
- string $status,
- int $timestamp) {
+ string $status,
+ int $timestamp) {
parent::__construct();
$this->user = $user;
$this->status = $status;
@@ -99,4 +74,19 @@ class UserLiveStatusEvent extends Event {
public function getTimestamp(): int {
return $this->timestamp;
}
+
+ /**
+ * Get the user status that might be available after processing the event
+ * @since 24.0.0
+ */
+ public function getUserStatus(): ?IUserStatus {
+ return $this->userStatus;
+ }
+
+ /**
+ * @since 24.0.0
+ */
+ public function setUserStatus(IUserStatus $userStatus) {
+ $this->userStatus = $userStatus;
+ }
}