diff options
author | Vitor Mattos <vitor@php.rio> | 2022-07-01 16:25:43 +0300 |
---|---|---|
committer | Vitor Mattos <vitor@php.rio> | 2022-07-01 16:25:43 +0300 |
commit | af34125e66b3c7c2b4e8ea1e6167c8bd23b7aa32 (patch) | |
tree | 22aa93296e50a039bf8af1e2542b683586c05853 | |
parent | 5a9ca1bf26259872f86edbcd25b79c36542c50b9 (diff) |
Rename text
Signed-off-by: Vitor Mattos <vitor@php.rio>
-rw-r--r-- | appinfo/routes/routesRoomController.php | 4 | ||||
-rw-r--r-- | docs/capabilities.md | 2 | ||||
-rw-r--r-- | docs/conversation.md | 10 | ||||
-rw-r--r-- | lib/BackgroundJob/ExpireChatMessages.php (renamed from lib/BackgroundJob/ApplyExpireDate.php) | 2 | ||||
-rw-r--r-- | lib/Capabilities.php | 2 | ||||
-rw-r--r-- | lib/Chat/ChatManager.php | 10 | ||||
-rw-r--r-- | lib/Controller/RoomController.php | 8 | ||||
-rw-r--r-- | lib/Events/ChangeExpireDateEvent.php | 42 | ||||
-rw-r--r-- | lib/Manager.php | 2 | ||||
-rw-r--r-- | lib/Migration/Version15000Date20220506005058.php | 4 | ||||
-rw-r--r-- | lib/Model/SelectHelper.php | 2 | ||||
-rw-r--r-- | lib/Room.php | 18 | ||||
-rw-r--r-- | lib/Service/RoomService.php | 19 | ||||
-rw-r--r-- | lib/Share/Helper/ShareAPIController.php | 2 | ||||
-rw-r--r-- | tests/integration/features/bootstrap/FeatureContext.php | 28 | ||||
-rw-r--r-- | tests/integration/features/chat/expire-date.feature | 16 | ||||
-rw-r--r-- | tests/integration/spreedcheats/appinfo/routes.php | 2 | ||||
-rw-r--r-- | tests/integration/spreedcheats/lib/Controller/ApiController.php | 6 | ||||
-rw-r--r-- | tests/php/CapabilitiesTest.php | 4 |
19 files changed, 67 insertions, 116 deletions
diff --git a/appinfo/routes/routesRoomController.php b/appinfo/routes/routesRoomController.php index ce36e1cd1..25592ff03 100644 --- a/appinfo/routes/routesRoomController.php +++ b/appinfo/routes/routesRoomController.php @@ -102,7 +102,7 @@ return [ ['name' => 'Room#setLobby', 'url' => '/api/{apiVersion}/room/{token}/webinar/lobby', 'verb' => 'PUT', 'requirements' => $requirementsWithToken], /** @see \OCA\Talk\Controller\RoomController::setSIPEnabled() */ ['name' => 'Room#setSIPEnabled', 'url' => '/api/{apiVersion}/room/{token}/webinar/sip', 'verb' => 'PUT', 'requirements' => $requirementsWithToken], - /** @see \OCA\Talk\Controller\RoomController::setExpireInterval() */ - ['name' => 'Room#setExpireInterval', 'url' => '/api/{apiVersion}/room/{token}/message-expire-interval', 'verb' => 'POST', 'requirements' => $requirements], + /** @see \OCA\Talk\Controller\RoomController::setMessageExpiration() */ + ['name' => 'Room#setMessageExpiration', 'url' => '/api/{apiVersion}/room/{token}/message-expiration', 'verb' => 'POST', 'requirements' => $requirements], ], ]; diff --git a/docs/capabilities.md b/docs/capabilities.md index 50f7536c5..5c29bf390 100644 --- a/docs/capabilities.md +++ b/docs/capabilities.md @@ -97,7 +97,7 @@ title: Capabilities * `unified-search` - When the extended attributes of unified search results are there * `chat-permission` - When permission 128 is required to post chat messages, reaction or share items to the conversation * `silent-send` - Whether the chat API allows to send chat messages without triggering notifications -* `message-expire` - Message expiration time for a conversation +* `message-expiration` - Message expiration time for a conversation * `sip-support-nopin` - Whether SIP can be configured to not require a custom attendee PIN * `send-call-notification` - When the API allows to resend call notifications for individual users that did not join yet * `silent-call` - Allow to start calls without sending notification diff --git a/docs/conversation.md b/docs/conversation.md index 5afb8df5e..fcc9aa0fe 100644 --- a/docs/conversation.md +++ b/docs/conversation.md @@ -51,7 +51,7 @@ `participantFlags` | int | v1 | | "In call" flags of the user's session making the request (only available with `in-call-flags` capability) `readOnly` | int | v1 | | Read-only state for the current user (only available with `read-only-rooms` capability) `listable` | int | v3 | | Listable scope for the room (only available with `listable-rooms` capability) - `expireDate` | int | v4 | | The expire date time in seconds in this chat. Zero if disabled. (only available with `message-expire` capability) + `messageExpiration` | int | v4 | | The message expiration time in seconds in this chat. Zero if disabled. (only available with `message-expiration` capability) `count` | int | v1 | v2 | **Removed:** Count the users on the [Get list of participants in a conversation](participant.md#get-list-of-participants-in-a-conversation) endpoint `numGuests` | int | v1 | v2 | **Removed:** Count the guests on the [Get list of participants in a conversation](participant.md#get-list-of-participants-in-a-conversation) endpoin `lastPing` | int | v1 | | Timestamp of the user's session making the request @@ -337,16 +337,16 @@ + `401 Unauthorized` When the participant is a guest + `404 Not Found` When the conversation could not be found for the participant -## Set expire date for messages in a conversation +## Set message expiration -* Required capability: `message-expire` +* Required capability: `message-expiration` * Method: `POST` -* Endpoint: `/room/{token}/message-expire` +* Endpoint: `/room/{token}/message-expiration` * Data: field | type | Description ---|---|--- - `seconds` | int | The messages expire time in seconds. If is zero, messages will not be deleted automatically. + `seconds` | int | The messages expiration in seconds. If is zero, messages will not be deleted automatically. * Response: - Status code: diff --git a/lib/BackgroundJob/ApplyExpireDate.php b/lib/BackgroundJob/ExpireChatMessages.php index 65ba410b4..b64e3aee0 100644 --- a/lib/BackgroundJob/ApplyExpireDate.php +++ b/lib/BackgroundJob/ExpireChatMessages.php @@ -30,7 +30,7 @@ use OCP\AppFramework\Utility\ITimeFactory; use OCP\BackgroundJob\IJob; use OCP\BackgroundJob\TimedJob; -class ApplyExpireDate extends TimedJob { +class ExpireChatMessages extends TimedJob { private ChatManager $chatManager; public function __construct(ITimeFactory $timeFactory, diff --git a/lib/Capabilities.php b/lib/Capabilities.php index 10a1c730b..6948a3b4a 100644 --- a/lib/Capabilities.php +++ b/lib/Capabilities.php @@ -135,7 +135,7 @@ class Capabilities implements IPublicCapability { ]; if ($this->serverConfig->getAppValue('core', 'backgroundjobs_mode', 'ajax') === 'cron') { - $capabilities['features'][] = 'message-expire'; + $capabilities['features'][] = 'message-expiration'; } if ($this->commentsManager->supportReactions()) { diff --git a/lib/Chat/ChatManager.php b/lib/Chat/ChatManager.php index 826f0e7fa..de2bdcf66 100644 --- a/lib/Chat/ChatManager.php +++ b/lib/Chat/ChatManager.php @@ -263,7 +263,7 @@ class ChatManager { if ($referenceId !== '') { $comment->setReferenceId($referenceId); } - $this->setExpireDate($chat, $comment); + $this->setMessageExpiration($chat, $comment); $event = new ChatParticipantEvent($chat, $comment, $participant, $silent); $this->dispatcher->dispatch(self::EVENT_BEFORE_MESSAGE_SEND, $event); @@ -309,14 +309,14 @@ class ChatManager { return $comment; } - private function setExpireDate(Room $room, IComment $comment): void { - $expireInterval = $room->getExpireInterval(); - if (!$expireInterval) { + private function setMessageExpiration(Room $room, IComment $comment): void { + $messageExpiration = $room->getMessageExpiration(); + if (!$messageExpiration) { return; } $dateTime = $this->timeFactory->getDateTime(); - $dateTime->add(DateInterval::createFromDateString($expireInterval . ' seconds')); + $dateTime->add(DateInterval::createFromDateString($messageExpiration . ' seconds')); $comment->setExpireDate($dateTime); } diff --git a/lib/Controller/RoomController.php b/lib/Controller/RoomController.php index ad7cbfe30..e0a430f7c 100644 --- a/lib/Controller/RoomController.php +++ b/lib/Controller/RoomController.php @@ -400,7 +400,7 @@ class RoomController extends AEnvironmentAwareController { 'lastCommonReadMessage' => 0, 'listable' => Room::LISTABLE_NONE, 'callFlag' => Participant::FLAG_DISCONNECTED, - 'expireDate' => 0, + 'messageExpiration' => 0, ]; $lastActivity = $room->getLastActivity(); @@ -467,7 +467,7 @@ class RoomController extends AEnvironmentAwareController { 'defaultPermissions' => $room->getDefaultPermissions(), 'description' => $room->getDescription(), 'listable' => $room->getListable(), - 'expireInterval' => $this->roomService->getExpireInterval($room), + 'messageExpiration' => $this->roomService->getMessageExpiration($room), ]); if ($currentParticipant->getAttendee()->getReadPrivacy() === Participant::PRIVACY_PUBLIC) { @@ -1713,11 +1713,11 @@ class RoomController extends AEnvironmentAwareController { * @PublicPage * @RequireModeratorParticipant */ - public function setExpireInterval(int $seconds): DataResponse { + public function setMessageExpiration(int $seconds): DataResponse { if ($seconds < 0) { return new DataResponse([], Http::STATUS_BAD_REQUEST); } - $this->roomService->setExpireInterval($this->room, $this->getParticipant(), $seconds); + $this->roomService->setMessageExpiration($this->room, $this->getParticipant(), $seconds); return new DataResponse(); } } diff --git a/lib/Events/ChangeExpireDateEvent.php b/lib/Events/ChangeExpireDateEvent.php deleted file mode 100644 index 918c7bb60..000000000 --- a/lib/Events/ChangeExpireDateEvent.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php - -declare(strict_types=1); -/** - * @copyright Copyright (c) 2022 Vitor Mattos <vitor@php.rio> - * - * @author Vitor Mattos <vitor@php.rio> - * - * @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/>. - * - */ - -namespace OCA\Talk\Events; - -use OCA\Talk\Room; - -class ChangeExpireDateEvent extends RoomEvent { - private int $seconds; - public function __construct(Room $room, - int $seconds - ) { - parent::__construct($room); - $this->seconds = $seconds; - } - - public function getExpireDateSeconds(): int { - return $this->seconds; - } -} diff --git a/lib/Manager.php b/lib/Manager.php index 023c7e702..7742992f1 100644 --- a/lib/Manager.php +++ b/lib/Manager.php @@ -165,7 +165,7 @@ class Manager { (int) $row['type'], (int) $row['read_only'], (int) $row['listable'], - (int) $row['message_expire'], + (int) $row['message_expiration'], (int) $row['lobby_state'], (int) $row['sip_enabled'], $assignedSignalingServer, diff --git a/lib/Migration/Version15000Date20220506005058.php b/lib/Migration/Version15000Date20220506005058.php index 33413cf7b..6868c06fd 100644 --- a/lib/Migration/Version15000Date20220506005058.php +++ b/lib/Migration/Version15000Date20220506005058.php @@ -45,8 +45,8 @@ class Version15000Date20220506005058 extends SimpleMigrationStep { $schema = $schemaClosure(); $table = $schema->getTable('talk_rooms'); - if (!$table->hasColumn('message_expire')) { - $table->addColumn('message_expire', Types::INTEGER, [ + if (!$table->hasColumn('message_expiration')) { + $table->addColumn('message_expiration', Types::INTEGER, [ 'default' => 0, ]); return $schema; diff --git a/lib/Model/SelectHelper.php b/lib/Model/SelectHelper.php index 28a426e24..9ad2b5f09 100644 --- a/lib/Model/SelectHelper.php +++ b/lib/Model/SelectHelper.php @@ -51,7 +51,7 @@ class SelectHelper { ->addSelect($alias . 'object_type') ->addSelect($alias . 'object_id') ->addSelect($alias . 'listable') - ->addSelect($alias . 'message_expire') + ->addSelect($alias . 'message_expiration') ->addSelect($alias . 'remote_server') ->addSelect($alias . 'remote_token') ->selectAlias($alias . 'id', 'r_id'); diff --git a/lib/Room.php b/lib/Room.php index 14b71edc4..d2d8f19fc 100644 --- a/lib/Room.php +++ b/lib/Room.php @@ -147,8 +147,8 @@ class Room { public const EVENT_BEFORE_SESSION_LEAVE_CALL = self::class . '::preSessionLeaveCall'; public const EVENT_AFTER_SESSION_LEAVE_CALL = self::class . '::postSessionLeaveCall'; public const EVENT_BEFORE_SIGNALING_PROPERTIES = self::class . '::beforeSignalingProperties'; - public const EVENT_BEFORE_SET_EXPIRE_DATE = self::class . '::beforeSetExpireInterval'; - public const EVENT_AFTER_SET_EXPIRE_DATE = self::class . '::afterSetExpireInterval'; + public const EVENT_BEFORE_SET_EXPIRE_DATE = self::class . '::beforeSetMessageExpiration'; + public const EVENT_AFTER_SET_EXPIRE_DATE = self::class . '::afterSetMessageExpiration'; public const DESCRIPTION_MAXIMUM_LENGTH = 500; @@ -162,7 +162,7 @@ class Room { private int $type; private int $readOnly; private int $listable; - private int $expireInterval; + private int $messageExpiration; private int $lobbyState; private int $sipEnabled; private ?int $assignedSignalingServer; @@ -196,7 +196,7 @@ class Room { int $type, int $readOnly, int $listable, - int $expireInterval, + int $messageExpiration, int $lobbyState, int $sipEnabled, ?int $assignedSignalingServer, @@ -226,7 +226,7 @@ class Room { $this->type = $type; $this->readOnly = $readOnly; $this->listable = $listable; - $this->expireInterval = $expireInterval; + $this->messageExpiration = $messageExpiration; $this->lobbyState = $lobbyState; $this->sipEnabled = $sipEnabled; $this->assignedSignalingServer = $assignedSignalingServer; @@ -288,12 +288,12 @@ class Room { $this->listable = $newState; } - public function getExpireInterval(): int { - return $this->expireInterval; + public function getMessageExpiration(): int { + return $this->messageExpiration; } - public function setExpireInterval(int $expireInterval): void { - $this->expireInterval = $expireInterval; + public function setMessageExpiration(int $messageExpiration): void { + $this->messageExpiration = $messageExpiration; } public function getLobbyState(): int { diff --git a/lib/Service/RoomService.php b/lib/Service/RoomService.php index 4606ce15a..c53c654f0 100644 --- a/lib/Service/RoomService.php +++ b/lib/Service/RoomService.php @@ -24,10 +24,9 @@ declare(strict_types=1); namespace OCA\Talk\Service; use InvalidArgumentException; -use OCA\Talk\BackgroundJob\ApplyExpireDate; +use OCA\Talk\BackgroundJob\ExpireChatMessages; use OCA\Talk\Chat\ChatManager; use OCA\Talk\Chat\CommentsManager; -use OCA\Talk\Events\ChangeExpireDateEvent; use OCA\Talk\Events\ModifyLobbyEvent; use OCA\Talk\Events\ModifyRoomEvent; use OCA\Talk\Events\VerifyRoomPasswordEvent; @@ -543,21 +542,21 @@ class RoomService { ]; } - public function setExpireInterval(Room $room, Participant $participant, int $seconds): void { - $event = new ChangeExpireDateEvent($room, $seconds); + public function setMessageExpiration(Room $room, Participant $participant, int $seconds): void { + $event = new ModifyRoomEvent($room, 'messageExpiration', $seconds, null, $participant); $this->dispatcher->dispatch(Room::EVENT_BEFORE_SET_EXPIRE_DATE, $event); $update = $this->db->getQueryBuilder(); $update->update('talk_rooms') - ->set('message_expire', $update->createNamedParameter($seconds, IQueryBuilder::PARAM_INT)) + ->set('message_expiration', $update->createNamedParameter($seconds, IQueryBuilder::PARAM_INT)) ->where($update->expr()->eq('id', $update->createNamedParameter($room->getId(), IQueryBuilder::PARAM_INT))); $update->executeStatement(); - $room->setExpireInterval($seconds); + $room->setMessageExpiration($seconds); if ($seconds > 0) { - $this->jobList->add(ApplyExpireDate::class, ['room_id' => $room->getId()]); + $this->jobList->add(ExpireChatMessages::class, ['room_id' => $room->getId()]); $this->expireDateSystemMessage($room, $participant, $seconds, 'message_expire_enabled'); } else { - $this->jobList->remove(ApplyExpireDate::class, ['room_id' => $room->getId()]); + $this->jobList->remove(ExpireChatMessages::class, ['room_id' => $room->getId()]); $this->expireDateSystemMessage($room, $participant, $seconds, 'message_expire_disabled'); } @@ -578,7 +577,7 @@ class RoomService { ); } - public function getExpireInterval(Room $room): int { - return $room->getExpireInterval(); + public function getMessageExpiration(Room $room): int { + return $room->getMessageExpiration(); } } diff --git a/lib/Share/Helper/ShareAPIController.php b/lib/Share/Helper/ShareAPIController.php index dd5989907..aebcee1f7 100644 --- a/lib/Share/Helper/ShareAPIController.php +++ b/lib/Share/Helper/ShareAPIController.php @@ -102,7 +102,7 @@ class ShareAPIController { * @param IShare $share * @param string $shareWith * @param int $permissions - * @param string $expireDate + * @param string $messageExpiration * @throws OCSNotFoundException */ public function createShare(IShare $share, string $shareWith, int $permissions, string $expireDate): void { diff --git a/tests/integration/features/bootstrap/FeatureContext.php b/tests/integration/features/bootstrap/FeatureContext.php index 0456c926b..9392c1685 100644 --- a/tests/integration/features/bootstrap/FeatureContext.php +++ b/tests/integration/features/bootstrap/FeatureContext.php @@ -339,6 +339,9 @@ class FeatureContext implements Context, SnippetAcceptingContext { if (isset($expectedRoom['unreadMentionDirect'])) { $data['unreadMentionDirect'] = (int) $room['unreadMentionDirect']; } + if (isset($expectedRoom['messageExpiration'])) { + $data['messageExpiration'] = (int) $room['messageExpiration']; + } if (isset($expectedRoom['participants'])) { throw new \Exception('participants key needs to be checked via participants endpoint'); } @@ -2568,28 +2571,17 @@ class FeatureContext implements Context, SnippetAcceptingContext { } /** - * @Given user :user set the expire interval to :expireInterval of room :identifier with :statusCode (:apiVersion) + * @Given user :user set the message expiration to :messageExpiration of room :identifier with :statusCode (:apiVersion) */ - public function userSetTheExpireIntervalToWith(string $user, int $expireInterval, string $identifier, int $statusCode, string $apiVersion = 'v4'): void { + public function userSetTheMessageExpirationToXWithStatusCode(string $user, int $messageExpiration, string $identifier, int $statusCode, string $apiVersion = 'v4'): void { $this->setCurrentUser($user); - $this->sendRequest('POST', '/apps/spreed/api/' . $apiVersion . '/room/' . self::$identifierToToken[$identifier] . '/message-expire-interval', [ - 'seconds' => $expireInterval + $this->sendRequest('POST', '/apps/spreed/api/' . $apiVersion . '/room/' . self::$identifierToToken[$identifier] . '/message-expiration', [ + 'seconds' => $messageExpiration, ]); $this->assertStatusCode($this->response, $statusCode); } /** - * @Given user :user check if expire interval of room :identifier is :expireInterval (:apiVersion) - */ - public function userCheckIfExpireIntervalOfRoomIsX(string $user, string $identifier, int $expireInterval, string $apiVersion = 'v4') { - $this->setCurrentUser($user); - $this->sendRequest('GET', '/apps/spreed/api/' . $apiVersion . '/room/' . self::$identifierToToken[$identifier]); - $room = $this->getDataFromResponse($this->response); - - Assert::assertEquals($expireInterval, $room['expireInterval']); - } - - /** * @When wait for :seconds seconds */ public function waitForXSeconds($seconds): void { @@ -2597,12 +2589,12 @@ class FeatureContext implements Context, SnippetAcceptingContext { } /** - * @When apply expire date job to room :identifier + * @When apply message expiration job to room :identifier */ - public function applyExpireDateJobToRoom($identifier): void { + public function applyMessageExpirationJobToRoom($identifier): void { $currentUser = $this->currentUser; $this->setCurrentUser('admin'); - $this->sendRequest('GET', '/apps/spreedcheats/get_message_expire_job/' . self::$identifierToToken[$identifier]); + $this->sendRequest('GET', '/apps/spreedcheats/get_message_expiration_job/' . self::$identifierToToken[$identifier]); $response = $this->getDataFromResponse($this->response); Assert::assertIsArray($response, 'Room ' . $identifier . 'not found'); Assert::assertArrayHasKey('id', $response, 'Job not found by identifier "' . $identifier . '"'); diff --git a/tests/integration/features/chat/expire-date.feature b/tests/integration/features/chat/expire-date.feature index 24ceb297f..ae4fb0acf 100644 --- a/tests/integration/features/chat/expire-date.feature +++ b/tests/integration/features/chat/expire-date.feature @@ -4,20 +4,22 @@ Feature: room/expire-date Given user "participant2" exists Given user "participant3" exists - Scenario: Enable expire date and check after expire + Scenario: Enable message expiration and check after expire Given user "participant1" creates room "room" (v4) | roomType | 3 | | roomName | room | And user "participant1" adds user "participant2" to room "room" with 200 (v4) And user "participant1" sends message "Message 1" to room "room" with 201 - And user "participant1" set the expire interval to -1 of room "room" with 400 (v4) - And user "participant2" set the expire interval to 3 of room "room" with 403 (v4) - And user "participant3" set the expire interval to 3 of room "room" with 404 (v4) - And user "participant1" set the expire interval to 3 of room "room" with 200 (v4) + And user "participant1" set the message expiration to -1 of room "room" with 400 (v4) + And user "participant2" set the message expiration to 3 of room "room" with 403 (v4) + And user "participant3" set the message expiration to 3 of room "room" with 404 (v4) + And user "participant1" set the message expiration to 3 of room "room" with 200 (v4) And user "participant1" sends message "Message 2" to room "room" with 201 - And user "participant1" check if expire interval of room "room" is 3 (v4) + Then user "participant1" is participant of the following rooms (v4) + | id | type | messageExpiration | + | room | 3 | 3 | And wait for 3 seconds - And apply expire date job to room "room" + And apply message expiration job to room "room" Then user "participant1" sees the following messages in room "room" with 200 | room | actorType | actorId | actorDisplayName | message | messageParameters | parentMessage | | room | users | participant1 | participant1-displayname | Message 1 | [] | | diff --git a/tests/integration/spreedcheats/appinfo/routes.php b/tests/integration/spreedcheats/appinfo/routes.php index 058fa1590..a1109066d 100644 --- a/tests/integration/spreedcheats/appinfo/routes.php +++ b/tests/integration/spreedcheats/appinfo/routes.php @@ -26,6 +26,6 @@ declare(strict_types=1); return [ 'ocs' => [ ['name' => 'Api#resetSpreed', 'url' => '/', 'verb' => 'DELETE'], - ['name' => 'Api#getExpireDateJob', 'url' => '/get_message_expire_job/{token}', 'verb' => 'GET'], + ['name' => 'Api#getMessageExpirationJob', 'url' => '/get_message_expiration_job/{token}', 'verb' => 'GET'], ], ]; diff --git a/tests/integration/spreedcheats/lib/Controller/ApiController.php b/tests/integration/spreedcheats/lib/Controller/ApiController.php index 52a6e068f..fbaab0cf1 100644 --- a/tests/integration/spreedcheats/lib/Controller/ApiController.php +++ b/tests/integration/spreedcheats/lib/Controller/ApiController.php @@ -25,7 +25,7 @@ declare(strict_types=1); namespace OCA\SpreedCheats\Controller; -use OCA\Talk\BackgroundJob\ApplyExpireDate; +use OCA\Talk\BackgroundJob\ExpireChatMessages; use OCP\AppFramework\Http; use OCP\AppFramework\OCSController; use OCP\AppFramework\Http\DataResponse; @@ -110,7 +110,7 @@ class ApiController extends OCSController { * * @return DataResponse */ - public function getExpireDateJob($token): DataResponse { + public function getMessageExpirationJob($token): DataResponse { $roomId = $this->getRoomIdByToken($token); if (!$roomId) { return new DataResponse([], Http::STATUS_NOT_FOUND); @@ -120,7 +120,7 @@ class ApiController extends OCSController { ->from('jobs') ->where( $query->expr()->andX( - $query->expr()->eq('class', $query->createNamedParameter(ApplyExpireDate::class)), + $query->expr()->eq('class', $query->createNamedParameter(ExpireChatMessages::class)), $query->expr()->eq('argument', $query->createNamedParameter(json_encode(['room_id' => (int) $roomId]))) ) ); diff --git a/tests/php/CapabilitiesTest.php b/tests/php/CapabilitiesTest.php index 31afe3992..65fbe67d2 100644 --- a/tests/php/CapabilitiesTest.php +++ b/tests/php/CapabilitiesTest.php @@ -59,7 +59,7 @@ class CapabilitiesTest extends TestCase { $this->commentsManager = $this->createMock(CommentsManager::class); $this->userSession = $this->createMock(IUserSession::class); $this->appManager = $this->createMock(IAppManager::class); - + $this->commentsManager->expects($this->any()) ->method('supportReactions') ->willReturn(true); @@ -121,7 +121,7 @@ class CapabilitiesTest extends TestCase { 'silent-send', 'silent-call', 'send-call-notification', - 'message-expire', + 'message-expiration', 'reactions', ]; } |