aboutsummaryrefslogtreecommitdiffstats
path: root/apps/user_status
diff options
context:
space:
mode:
authorAnna Larch <anna@nextcloud.com>2023-12-15 11:07:09 +0100
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>2023-12-18 12:06:57 +0000
commitdeb4bef923f7ce6f98efc07974a3a6cd0b86abb6 (patch)
treeae04866195bf53c375fedf4a82d2ffc10b5aacbf /apps/user_status
parent36f91063a1ad0a3d499f48c03d73ed07f4a253de (diff)
downloadnextcloud-server-deb4bef923f7ce6f98efc07974a3a6cd0b86abb6.tar.gz
nextcloud-server-deb4bef923f7ce6f98efc07974a3a6cd0b86abb6.zip
fix(ooo): add new ooo status with new emoji
Signed-off-by: Anna Larch <anna@nextcloud.com>
Diffstat (limited to 'apps/user_status')
-rw-r--r--apps/user_status/lib/Listener/OutOfOfficeStatusListener.php2
-rw-r--r--apps/user_status/lib/Service/PredefinedStatusService.php15
-rw-r--r--apps/user_status/tests/Unit/Service/PredefinedStatusServiceTest.php11
3 files changed, 25 insertions, 3 deletions
diff --git a/apps/user_status/lib/Listener/OutOfOfficeStatusListener.php b/apps/user_status/lib/Listener/OutOfOfficeStatusListener.php
index 0d793c3f306..087446d94a7 100644
--- a/apps/user_status/lib/Listener/OutOfOfficeStatusListener.php
+++ b/apps/user_status/lib/Listener/OutOfOfficeStatusListener.php
@@ -53,7 +53,7 @@ class OutOfOfficeStatusListener implements IEventListener {
*/
public function handle(Event $event): void {
if($event instanceof OutOfOfficeClearedEvent) {
- $this->manager->revertUserStatus($event->getData()->getUser()->getUID(), IUserStatus::MESSAGE_VACATION, IUserStatus::DND);
+ $this->manager->revertUserStatus($event->getData()->getUser()->getUID(), IUserStatus::MESSAGE_OUT_OF_OFFICE, IUserStatus::DND);
$this->jobsList->scheduleAfter(UserStatusAutomation::class, $this->time->getTime(), ['userId' => $event->getData()->getUser()->getUID()]);
return;
}
diff --git a/apps/user_status/lib/Service/PredefinedStatusService.php b/apps/user_status/lib/Service/PredefinedStatusService.php
index c77ca588ebb..a80f5230001 100644
--- a/apps/user_status/lib/Service/PredefinedStatusService.php
+++ b/apps/user_status/lib/Service/PredefinedStatusService.php
@@ -46,6 +46,7 @@ class PredefinedStatusService {
* @deprecated See \OCP\UserStatus\IUserStatus::MESSAGE_CALL
*/
public const CALL = 'call';
+ public const OUT_OF_OFFICE = 'out-of-office';
/** @var IL10N */
private $l10n;
@@ -113,6 +114,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,6 +156,9 @@ class PredefinedStatusService {
case self::VACATIONING:
return '🌴';
+ case self::OUT_OF_OFFICE:
+ return '🛑';
+
case self::REMOTE_WORK:
return '🏡';
@@ -178,6 +189,9 @@ 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');
@@ -199,6 +213,7 @@ class PredefinedStatusService {
self::COMMUTING,
self::SICK_LEAVE,
self::VACATIONING,
+ self::OUT_OF_OFFICE,
self::REMOTE_WORK,
IUserStatus::MESSAGE_CALL,
IUserStatus::MESSAGE_AVAILABILITY,
diff --git a/apps/user_status/tests/Unit/Service/PredefinedStatusServiceTest.php b/apps/user_status/tests/Unit/Service/PredefinedStatusServiceTest.php
index 0a65256bfac..c6850621dd8 100644
--- a/apps/user_status/tests/Unit/Service/PredefinedStatusServiceTest.php
+++ b/apps/user_status/tests/Unit/Service/PredefinedStatusServiceTest.php
@@ -47,7 +47,7 @@ class PredefinedStatusServiceTest extends TestCase {
}
public function testGetDefaultStatuses(): void {
- $this->l10n->expects($this->exactly(6))
+ $this->l10n->expects($this->exactly(7))
->method('t')
->withConsecutive(
['In a meeting'],
@@ -110,6 +110,13 @@ class PredefinedStatusServiceTest extends TestCase {
'clearAt' => null,
'visible' => false,
],
+ [
+ 'id' => 'out-of-office',
+ 'icon' => '🛑',
+ 'message' => 'Out of office',
+ 'clearAt' => null,
+ 'visible' => false,
+ ],
], $actual);
}
@@ -195,7 +202,7 @@ class PredefinedStatusServiceTest extends TestCase {
}
public function testGetDefaultStatusById(): void {
- $this->l10n->expects($this->exactly(6))
+ $this->l10n->expects($this->exactly(7))
->method('t')
->withConsecutive(
['In a meeting'],