diff --git a/lib/Activity/Provider/Base.php b/lib/Activity/Provider/Base.php index 346ebe815c7..c76f1bb8ed9 100644 --- a/lib/Activity/Provider/Base.php +++ b/lib/Activity/Provider/Base.php @@ -126,7 +126,7 @@ protected function getRoom(IL10N $l, Room $room) { return [ 'type' => 'call', 'id' => $room->getId(), - 'name' => $room->getName() ?: $l->t('a call'), + 'name' => $room->getName() ?: $l->t('a conversation'), 'call-type' => $stringType, ]; } @@ -140,7 +140,7 @@ protected function getFormerRoom(IL10N $l, $roomId) { return [ 'type' => 'call', 'id' => $roomId, - 'name' => $l->t('a call'), + 'name' => $l->t('a conversation'), 'call-type' => Room::UNKNOWN_CALL, ]; } diff --git a/lib/Notification/Notifier.php b/lib/Notification/Notifier.php index 8cd9a7a24a2..b988000191d 100644 --- a/lib/Notification/Notifier.php +++ b/lib/Notification/Notifier.php @@ -162,10 +162,10 @@ protected function parseMention(INotification $notification, Room $room, IL10N $ if ($room->getType() === Room::ONE_TO_ONE_CALL) { $notification ->setParsedSubject( - $l->t('%s mentioned you in a private chat', [$user->getDisplayName()]) + $l->t('%s mentioned you in a private conversation', [$user->getDisplayName()]) ) ->setRichSubject( - $l->t('{user} mentioned you in a private chat'), [ + $l->t('{user} mentioned you in a private conversation'), [ 'user' => $richSubjectUser ] ); @@ -174,10 +174,10 @@ protected function parseMention(INotification $notification, Room $room, IL10N $ if ($richSubjectUser && $richSubjectCall) { $notification ->setParsedSubject( - $l->t('%s mentioned you in a group chat: %s', [$user->getDisplayName(), $room->getName()]) + $l->t('%s mentioned you in a group conversation: %s', [$user->getDisplayName(), $room->getName()]) ) ->setRichSubject( - $l->t('{user} mentioned you in a group chat: {call}'), [ + $l->t('{user} mentioned you in a group conversation: {call}'), [ 'user' => $richSubjectUser, 'call' => $richSubjectCall ] @@ -185,48 +185,48 @@ protected function parseMention(INotification $notification, Room $room, IL10N $ } else if ($richSubjectUser && !$richSubjectCall) { $notification ->setParsedSubject( - $l->t('%s mentioned you in a group chat', [$user->getDisplayName()]) + $l->t('%s mentioned you in a group conversation', [$user->getDisplayName()]) ) ->setRichSubject( - $l->t('{user} mentioned you in a group chat'), [ + $l->t('{user} mentioned you in a group conversation'), [ 'user' => $richSubjectUser ] ); } else if (!$richSubjectUser && !$isGuest && $richSubjectCall) { $notification ->setParsedSubject( - $l->t('You were mentioned in a group chat by a user that has since been deleted: %s', [$room->getName()]) + $l->t('You were mentioned in a group conversation by a user that has since been deleted: %s', [$room->getName()]) ) ->setRichSubject( - $l->t('You were mentioned in a group chat by a user that has since been deleted: {call}'), [ + $l->t('You were mentioned in a group conversation by a user that has since been deleted: {call}'), [ 'call' => $richSubjectCall ] ); } else if (!$richSubjectUser && !$isGuest && !$richSubjectCall) { $notification ->setParsedSubject( - $l->t('You were mentioned in a group chat by a user that has since been deleted') + $l->t('You were mentioned in a group conversation by a user that has since been deleted') ) ->setRichSubject( - $l->t('You were mentioned in a group chat by a user that has since been deleted') + $l->t('You were mentioned in a group conversation by a user that has since been deleted') ); } else if (!$richSubjectUser && $isGuest && $richSubjectCall) { $notification ->setParsedSubject( - $l->t('A guest mentioned you in a group chat: %s', [$room->getName()]) + $l->t('A guest mentioned you in a group conversation: %s', [$room->getName()]) ) ->setRichSubject( - $l->t('A guest mentioned you in a group chat: {call}'), [ + $l->t('A guest mentioned you in a group conversation: {call}'), [ 'call' => $richSubjectCall ] ); } else if (!$richSubjectUser && $isGuest && !$richSubjectCall) { $notification ->setParsedSubject( - $l->t('A guest mentioned you in a group chat') + $l->t('A guest mentioned you in a group conversation') ) ->setRichSubject( - $l->t('A guest mentioned you in a group chat') + $l->t('A guest mentioned you in a group conversation') ); } } else { @@ -277,10 +277,10 @@ protected function parseInvitation(INotification $notification, Room $room, IL10 if ($room->getType() === Room::ONE_TO_ONE_CALL) { $notification ->setParsedSubject( - $l->t('%s invited you to a private call', [$user->getDisplayName()]) + $l->t('%s invited you to a private conversation', [$user->getDisplayName()]) ) ->setRichSubject( - $l->t('{user} invited you to a private call'), [ + $l->t('{user} invited you to a private conversation'), [ 'user' => [ 'type' => 'user', 'id' => $uid, @@ -293,10 +293,10 @@ protected function parseInvitation(INotification $notification, Room $room, IL10 if ($room->getName() !== '') { $notification ->setParsedSubject( - $l->t('%s invited you to a group call: %s', [$user->getDisplayName(), $room->getName()]) + $l->t('%s invited you to a group conversation: %s', [$user->getDisplayName(), $room->getName()]) ) ->setRichSubject( - $l->t('{user} invited you to a group call: {call}'), [ + $l->t('{user} invited you to a group conversation: {call}'), [ 'user' => [ 'type' => 'user', 'id' => $uid, @@ -313,10 +313,10 @@ protected function parseInvitation(INotification $notification, Room $room, IL10 } else { $notification ->setParsedSubject( - $l->t('%s invited you to a group call', [$user->getDisplayName()]) + $l->t('%s invited you to a group conversation', [$user->getDisplayName()]) ) ->setRichSubject( - $l->t('{user} invited you to a group call'), [ + $l->t('{user} invited you to a group conversation'), [ 'user' => [ 'type' => 'user', 'id' => $uid, diff --git a/tests/php/Activity/Provider/BaseTest.php b/tests/php/Activity/Provider/BaseTest.php index ed04e984552..b46270a9d60 100644 --- a/tests/php/Activity/Provider/BaseTest.php +++ b/tests/php/Activity/Provider/BaseTest.php @@ -170,9 +170,9 @@ public function dataGetRoom() { [Room::ONE_TO_ONE_CALL, 23, 'private-call', 'private-call', 'one2one'], [Room::GROUP_CALL, 42, 'group-call', 'group-call', 'group'], [Room::PUBLIC_CALL, 128, 'public-call', 'public-call', 'public'], - [Room::ONE_TO_ONE_CALL, 23, '', 'a call', 'one2one'], - [Room::GROUP_CALL, 42, '', 'a call', 'group'], - [Room::PUBLIC_CALL, 128, '', 'a call', 'public'], + [Room::ONE_TO_ONE_CALL, 23, '', 'a conversation', 'one2one'], + [Room::GROUP_CALL, 42, '', 'a conversation', 'group'], + [Room::PUBLIC_CALL, 128, '', 'a conversation', 'public'], ]; } diff --git a/tests/php/Notification/NotifierTest.php b/tests/php/Notification/NotifierTest.php index 2782e4ade13..bf5dc1ba16e 100644 --- a/tests/php/Notification/NotifierTest.php +++ b/tests/php/Notification/NotifierTest.php @@ -68,8 +68,8 @@ public function setUp() { public function dataPrepareOne2One() { return [ - ['admin', 'Admin', 'Admin invited you to a private call'], - ['test', 'Test user', 'Test user invited you to a private call'], + ['admin', 'Admin', 'Admin invited you to a private conversation'], + ['test', 'Test user', 'Test user invited you to a private conversation'], ]; } @@ -122,7 +122,7 @@ public function testPrepareOne2One($uid, $displayName, $parsedSubject) { ->willReturnSelf(); $n->expects($this->once()) ->method('setRichSubject') - ->with('{user} invited you to a private call',[ + ->with('{user} invited you to a private conversation',[ 'user' => [ 'type' => 'user', 'id' => $uid, @@ -149,8 +149,8 @@ public function testPrepareOne2One($uid, $displayName, $parsedSubject) { public function dataPrepareGroup() { return [ - [Room::GROUP_CALL, 'admin', 'Admin', '', 'Admin invited you to a group call'], - [Room::PUBLIC_CALL, 'test', 'Test user', 'Name', 'Test user invited you to a group call: Name'], + [Room::GROUP_CALL, 'admin', 'Admin', '', 'Admin invited you to a group conversation'], + [Room::PUBLIC_CALL, 'test', 'Test user', 'Name', 'Test user invited you to a group conversation: Name'], ]; } @@ -213,7 +213,7 @@ public function testPrepareGroup($type, $uid, $displayName, $name, $parsedSubjec ->method('getId'); $n->expects($this->once()) ->method('setRichSubject') - ->with('{user} invited you to a group call',[ + ->with('{user} invited you to a group conversation',[ 'user' => [ 'type' => 'user', 'id' => $uid, @@ -227,7 +227,7 @@ public function testPrepareGroup($type, $uid, $displayName, $name, $parsedSubjec ->willReturn($roomId); $n->expects($this->once()) ->method('setRichSubject') - ->with('{user} invited you to a group call: {call}', [ + ->with('{user} invited you to a group conversation: {call}', [ 'user' => [ 'type' => 'user', 'id' => $uid, @@ -263,34 +263,34 @@ public function dataPrepareMention() { return [ [ Room::ONE_TO_ONE_CALL, ['userType' => 'users', 'userId' => 'testUser'], ['ellipsisStart', 'ellipsisEnd'], 'Test user', '', - 'Test user mentioned you in a private chat', - ['{user} mentioned you in a private chat', + 'Test user mentioned you in a private conversation', + ['{user} mentioned you in a private conversation', ['user' => ['type' => 'user', 'id' => 'testUser', 'name' => 'Test user']] ], '… message …' ], - // If the user is deleted in a one to one chat the chat is also + // If the user is deleted in a one to one conversation the conversation is also // deleted, and that in turn would delete the pending notification. [ Room::GROUP_CALL, ['userType' => 'users', 'userId' => 'testUser'], [], 'Test user', '', - 'Test user mentioned you in a group chat', - ['{user} mentioned you in a group chat', + 'Test user mentioned you in a group conversation', + ['{user} mentioned you in a group conversation', ['user' => ['type' => 'user', 'id' => 'testUser', 'name' => 'Test user']] ], 'message' ], [ Room::GROUP_CALL, ['userType' => 'users', 'userId' => 'testUser'], ['ellipsisStart'], null, '', - 'You were mentioned in a group chat by a user that has since been deleted', - ['You were mentioned in a group chat by a user that has since been deleted', + 'You were mentioned in a group conversation by a user that has since been deleted', + ['You were mentioned in a group conversation by a user that has since been deleted', [] ], '… message', true], [ Room::GROUP_CALL, ['userType' => 'users', 'userId' => 'testUser'], ['ellipsisEnd'], 'Test user', 'Room name', - 'Test user mentioned you in a group chat: Room name', - ['{user} mentioned you in a group chat: {call}', + 'Test user mentioned you in a group conversation: Room name', + ['{user} mentioned you in a group conversation: {call}', [ 'user' => ['type' => 'user', 'id' => 'testUser', 'name' => 'Test user'], 'call' => ['type' => 'call', 'id' => 'testRoomId', 'name' => 'Room name', 'call-type' => 'group'] @@ -300,8 +300,8 @@ public function dataPrepareMention() { ], [ Room::GROUP_CALL, ['userType' => 'users', 'userId' => 'testUser'], ['ellipsisStart', 'ellipsisEnd'], null, 'Room name', - 'You were mentioned in a group chat by a user that has since been deleted: Room name', - ['You were mentioned in a group chat by a user that has since been deleted: {call}', + 'You were mentioned in a group conversation by a user that has since been deleted: Room name', + ['You were mentioned in a group conversation by a user that has since been deleted: {call}', [ 'call' => ['type' => 'call', 'id' => 'testRoomId', 'name' => 'Room name', 'call-type' => 'group'] ] @@ -310,32 +310,32 @@ public function dataPrepareMention() { true], [ Room::PUBLIC_CALL, ['userType' => 'users', 'userId' => 'testUser'], [], 'Test user', '', - 'Test user mentioned you in a group chat', - ['{user} mentioned you in a group chat', + 'Test user mentioned you in a group conversation', + ['{user} mentioned you in a group conversation', ['user' => ['type' => 'user', 'id' => 'testUser', 'name' => 'Test user']] ], 'message' ], [ Room::PUBLIC_CALL, ['userType' => 'users', 'userId' => 'testUser'], ['ellipsisStart'], null, '', - 'You were mentioned in a group chat by a user that has since been deleted', - ['You were mentioned in a group chat by a user that has since been deleted', + 'You were mentioned in a group conversation by a user that has since been deleted', + ['You were mentioned in a group conversation by a user that has since been deleted', [] ], '… message', true], [ Room::PUBLIC_CALL, ['userType' => 'guests', 'userId' => 'testSpreedSession'], ['ellipsisEnd'], null, '', - 'A guest mentioned you in a group chat', - ['A guest mentioned you in a group chat', + 'A guest mentioned you in a group conversation', + ['A guest mentioned you in a group conversation', [] ], 'message …' ], [ Room::PUBLIC_CALL, ['userType' => 'users', 'userId' => 'testUser'], ['ellipsisStart', 'ellipsisEnd'], 'Test user', 'Room name', - 'Test user mentioned you in a group chat: Room name', - ['{user} mentioned you in a group chat: {call}', + 'Test user mentioned you in a group conversation: Room name', + ['{user} mentioned you in a group conversation: {call}', [ 'user' => ['type' => 'user', 'id' => 'testUser', 'name' => 'Test user'], 'call' => ['type' => 'call', 'id' => 'testRoomId', 'name' => 'Room name', 'call-type' => 'public'] @@ -345,8 +345,8 @@ public function dataPrepareMention() { ], [ Room::PUBLIC_CALL, ['userType' => 'users', 'userId' => 'testUser'], [], null, 'Room name', - 'You were mentioned in a group chat by a user that has since been deleted: Room name', - ['You were mentioned in a group chat by a user that has since been deleted: {call}', + 'You were mentioned in a group conversation by a user that has since been deleted: Room name', + ['You were mentioned in a group conversation by a user that has since been deleted: {call}', [ 'call' => ['type' => 'call', 'id' => 'testRoomId', 'name' => 'Room name', 'call-type' => 'public'] ] @@ -355,8 +355,8 @@ public function dataPrepareMention() { true], [ Room::PUBLIC_CALL, ['userType' => 'guests', 'userId' => 'testSpreedSession'], ['ellipsisStart', 'ellipsisEnd'], null, 'Room name', - 'A guest mentioned you in a group chat: Room name', - ['A guest mentioned you in a group chat: {call}', + 'A guest mentioned you in a group conversation: Room name', + ['A guest mentioned you in a group conversation: {call}', ['call' => ['type' => 'call', 'id' => 'testRoomId', 'name' => 'Room name', 'call-type' => 'public']] ], '… message …'