diff options
Diffstat (limited to 'apps/user_status/lib/Service/PredefinedStatusService.php')
-rw-r--r-- | apps/user_status/lib/Service/PredefinedStatusService.php | 64 |
1 files changed, 40 insertions, 24 deletions
diff --git a/apps/user_status/lib/Service/PredefinedStatusService.php b/apps/user_status/lib/Service/PredefinedStatusService.php index 7d2f985c168..599d5b8b52f 100644 --- a/apps/user_status/lib/Service/PredefinedStatusService.php +++ b/apps/user_status/lib/Service/PredefinedStatusService.php @@ -3,25 +3,8 @@ 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 OCA\UserStatus\Service; @@ -37,6 +20,7 @@ use OCP\UserStatus\IUserStatus; * @package OCA\UserStatus\Service */ class PredefinedStatusService { + private const BE_RIGHT_BACK = 'be-right-back'; private const MEETING = 'meeting'; private const COMMUTING = 'commuting'; private const SICK_LEAVE = 'sick-leave'; @@ -46,17 +30,16 @@ class PredefinedStatusService { * @deprecated See \OCP\UserStatus\IUserStatus::MESSAGE_CALL */ public const CALL = 'call'; - - /** @var IL10N */ - private $l10n; + public const OUT_OF_OFFICE = 'out-of-office'; /** * DefaultStatusService constructor. * * @param IL10N $l10n */ - public function __construct(IL10N $l10n) { - $this->l10n = $l10n; + public function __construct( + private IL10N $l10n, + ) { } /** @@ -83,6 +66,15 @@ class PredefinedStatusService { ], ], [ + 'id' => self::BE_RIGHT_BACK, + 'icon' => '⏳', + 'message' => $this->getTranslatedStatusForId(self::BE_RIGHT_BACK), + 'clearAt' => [ + 'type' => 'period', + 'time' => 900, + ], + ], + [ 'id' => self::REMOTE_WORK, 'icon' => '🏡', 'message' => $this->getTranslatedStatusForId(self::REMOTE_WORK), @@ -113,6 +105,13 @@ class PredefinedStatusService { 'clearAt' => null, 'visible' => false, ], + [ + 'id' => self::OUT_OF_OFFICE, + 'icon' => '🛑', + 'message' => $this->getTranslatedStatusForId(self::OUT_OF_OFFICE), + 'clearAt' => null, + 'visible' => false, + ], ]; } @@ -148,9 +147,15 @@ class PredefinedStatusService { case self::VACATIONING: return '🌴'; + case self::OUT_OF_OFFICE: + return '🛑'; + case self::REMOTE_WORK: return '🏡'; + case self::BE_RIGHT_BACK: + return '⏳'; + case self::CALL: return '💬'; @@ -178,12 +183,18 @@ class PredefinedStatusService { case self::VACATIONING: return $this->l10n->t('Vacationing'); + case self::OUT_OF_OFFICE: + return $this->l10n->t('Out of office'); + case self::REMOTE_WORK: return $this->l10n->t('Working remotely'); case self::CALL: return $this->l10n->t('In a call'); + case self::BE_RIGHT_BACK: + return $this->l10n->t('Be right back'); + default: return null; } @@ -199,9 +210,14 @@ class PredefinedStatusService { self::COMMUTING, self::SICK_LEAVE, self::VACATIONING, + self::OUT_OF_OFFICE, + self::BE_RIGHT_BACK, self::REMOTE_WORK, IUserStatus::MESSAGE_CALL, IUserStatus::MESSAGE_AVAILABILITY, + IUserStatus::MESSAGE_VACATION, + IUserStatus::MESSAGE_CALENDAR_BUSY, + IUserStatus::MESSAGE_CALENDAR_BUSY_TENTATIVE, ], true); } } |