123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- <?php
- declare(strict_types=1);
- namespace OCP\User\Events;
- use OCP\EventDispatcher\Event;
- use OCP\IUser;
- use OCP\UserStatus\IUserStatus;
- class UserLiveStatusEvent extends Event {
-
- public const STATUS_ONLINE = 'online';
-
- public const STATUS_AWAY = 'away';
-
- public const STATUS_OFFLINE = 'offline';
- private IUser $user;
- private string $status;
- private int $timestamp;
- private ?IUserStatus $userStatus = null;
-
- public function __construct(IUser $user,
- string $status,
- int $timestamp) {
- parent::__construct();
- $this->user = $user;
- $this->status = $status;
- $this->timestamp = $timestamp;
- }
-
- public function getUser(): IUser {
- return $this->user;
- }
-
- public function getStatus(): string {
- return $this->status;
- }
-
- public function getTimestamp(): int {
- return $this->timestamp;
- }
-
- public function getUserStatus(): ?IUserStatus {
- return $this->userStatus;
- }
-
- public function setUserStatus(IUserStatus $userStatus) {
- $this->userStatus = $userStatus;
- }
- }
|