summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/composer/composer/autoload_classmap.php1
-rw-r--r--lib/composer/composer/autoload_static.php1
-rw-r--r--lib/private/NavigationManager.php8
-rw-r--r--lib/public/User/Events/UserLiveStatusEvent.php101
4 files changed, 107 insertions, 4 deletions
diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php
index ae8d6349dc2..854ef66f23a 100644
--- a/lib/composer/composer/autoload_classmap.php
+++ b/lib/composer/composer/autoload_classmap.php
@@ -519,6 +519,7 @@ return array(
'OCP\\User\\Events\\UserChangedEvent' => $baseDir . '/lib/public/User/Events/UserChangedEvent.php',
'OCP\\User\\Events\\UserCreatedEvent' => $baseDir . '/lib/public/User/Events/UserCreatedEvent.php',
'OCP\\User\\Events\\UserDeletedEvent' => $baseDir . '/lib/public/User/Events/UserDeletedEvent.php',
+ 'OCP\\User\\Events\\UserLiveStatusEvent' => $baseDir . '/lib/public/User/Events/UserLiveStatusEvent.php',
'OCP\\User\\Events\\UserLoggedInEvent' => $baseDir . '/lib/public/User/Events/UserLoggedInEvent.php',
'OCP\\User\\Events\\UserLoggedInWithCookieEvent' => $baseDir . '/lib/public/User/Events/UserLoggedInWithCookieEvent.php',
'OCP\\User\\Events\\UserLoggedOutEvent' => $baseDir . '/lib/public/User/Events/UserLoggedOutEvent.php',
diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php
index 37771cafa78..4a857abae35 100644
--- a/lib/composer/composer/autoload_static.php
+++ b/lib/composer/composer/autoload_static.php
@@ -548,6 +548,7 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c
'OCP\\User\\Events\\UserChangedEvent' => __DIR__ . '/../../..' . '/lib/public/User/Events/UserChangedEvent.php',
'OCP\\User\\Events\\UserCreatedEvent' => __DIR__ . '/../../..' . '/lib/public/User/Events/UserCreatedEvent.php',
'OCP\\User\\Events\\UserDeletedEvent' => __DIR__ . '/../../..' . '/lib/public/User/Events/UserDeletedEvent.php',
+ 'OCP\\User\\Events\\UserLiveStatusEvent' => __DIR__ . '/../../..' . '/lib/public/User/Events/UserLiveStatusEvent.php',
'OCP\\User\\Events\\UserLoggedInEvent' => __DIR__ . '/../../..' . '/lib/public/User/Events/UserLoggedInEvent.php',
'OCP\\User\\Events\\UserLoggedInWithCookieEvent' => __DIR__ . '/../../..' . '/lib/public/User/Events/UserLoggedInWithCookieEvent.php',
'OCP\\User\\Events\\UserLoggedOutEvent' => __DIR__ . '/../../..' . '/lib/public/User/Events/UserLoggedOutEvent.php',
diff --git a/lib/private/NavigationManager.php b/lib/private/NavigationManager.php
index b40f403c056..81642fac234 100644
--- a/lib/private/NavigationManager.php
+++ b/lib/private/NavigationManager.php
@@ -200,7 +200,7 @@ class NavigationManager implements INavigationManager {
$this->add([
'type' => 'settings',
'id' => 'help',
- 'order' => 5,
+ 'order' => 6,
'href' => $this->urlGenerator->linkToRoute('settings.Help.help'),
'name' => $l->t('Help'),
'icon' => $this->urlGenerator->imagePath('settings', 'help.svg'),
@@ -213,7 +213,7 @@ class NavigationManager implements INavigationManager {
$this->add([
'type' => 'settings',
'id' => 'core_apps',
- 'order' => 3,
+ 'order' => 4,
'href' => $this->urlGenerator->linkToRoute('settings.AppSettings.viewApps'),
'icon' => $this->urlGenerator->imagePath('settings', 'apps.svg'),
'name' => $l->t('Apps'),
@@ -224,7 +224,7 @@ class NavigationManager implements INavigationManager {
$this->add([
'type' => 'settings',
'id' => 'settings',
- 'order' => 1,
+ 'order' => 2,
'href' => $this->urlGenerator->linkToRoute('settings.PersonalSettings.index'),
'name' => $l->t('Settings'),
'icon' => $this->urlGenerator->imagePath('settings', 'admin.svg'),
@@ -248,7 +248,7 @@ class NavigationManager implements INavigationManager {
$this->add([
'type' => 'settings',
'id' => 'core_users',
- 'order' => 4,
+ 'order' => 5,
'href' => $this->urlGenerator->linkToRoute('settings.Users.usersList'),
'name' => $l->t('Users'),
'icon' => $this->urlGenerator->imagePath('settings', 'users.svg'),
diff --git a/lib/public/User/Events/UserLiveStatusEvent.php b/lib/public/User/Events/UserLiveStatusEvent.php
new file mode 100644
index 00000000000..6c836a28ddf
--- /dev/null
+++ b/lib/public/User/Events/UserLiveStatusEvent.php
@@ -0,0 +1,101 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * @copyright Copyright (c) 2020, Georg Ehrke
+ *
+ * @author Georg Ehrke <oc.list@georgehrke.com>
+ *
+ * @license AGPL-3.0
+ *
+ * This code is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3,
+ * as published by the Free Software Foundation.
+ *
+ * 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, version 3,
+ * along with this program. If not, see <http://www.gnu.org/licenses/>
+ *
+ */
+
+namespace OCP\User\Events;
+
+use OCP\EventDispatcher\Event;
+use OCP\IUser;
+
+/**
+ * @since 20.0.0
+ */
+class UserLiveStatusEvent extends Event {
+
+ /**
+ * @var string
+ * @since 20.0.0
+ */
+ public const STATUS_ONLINE = 'online';
+
+ /**
+ * @var string
+ * @since 20.0.0
+ */
+ public const STATUS_AWAY = 'away';
+
+ /**
+ * @var string
+ * @since 20.0.0
+ */
+ public const STATUS_OFFLINE = 'offline';
+
+ /** @var IUser */
+ private $user;
+
+ /** @var string */
+ private $status;
+
+ /** @var int */
+ private $timestamp;
+
+ /**
+ * @param IUser $user
+ * @param string $status
+ * @param int $timestamp
+ * @since 20.0.0
+ */
+ public function __construct(IUser $user,
+ string $status,
+ int $timestamp) {
+ parent::__construct();
+ $this->user = $user;
+ $this->status = $status;
+ $this->timestamp = $timestamp;
+ }
+
+ /**
+ * @return IUser
+ * @since 20.0.0
+ */
+ public function getUser(): IUser {
+ return $this->user;
+ }
+
+ /**
+ * @return string
+ * @since 20.0.0
+ */
+ public function getStatus(): string {
+ return $this->status;
+ }
+
+ /**
+ * @return int
+ * @since 20.0.0
+ */
+ public function getTimestamp(): int {
+ return $this->timestamp;
+ }
+}