mirror of
https://github.com/nextcloud/spreed.git
synced 2025-12-18 05:20:50 +01:00
fix(conversation): Fix missing return
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
e3bee25561
commit
20e676d235
3 changed files with 49 additions and 2 deletions
|
|
@ -620,7 +620,10 @@ class RoomController extends AEnvironmentAwareOCSController {
|
|||
if ($objectType === Room::OBJECT_TYPE_EXTENDED_CONVERSATION && $objectId !== '') {
|
||||
try {
|
||||
$oldRoom = $this->manager->getRoomForUserByToken($objectId, $this->userId);
|
||||
} catch (RoomNotFoundException) {
|
||||
// Don't allow to extend unjoined public conversations
|
||||
$this->participantService->getParticipant($oldRoom, $this->userId, false);
|
||||
} catch (RoomNotFoundException|ParticipantNotFoundException) {
|
||||
return new DataResponse(['error' => CreationException::REASON_OBJECT], Http::STATUS_BAD_REQUEST);
|
||||
}
|
||||
|
||||
if ($oldRoom->getType() === Room::TYPE_ONE_TO_ONE_FORMER) {
|
||||
|
|
|
|||
|
|
@ -1044,7 +1044,7 @@ class FeatureContext implements Context, SnippetAcceptingContext {
|
|||
$body['roomName'] = $identifier;
|
||||
}
|
||||
|
||||
if (isset($body['objectType'], $body['objectId']) && $body['objectType'] === 'room') {
|
||||
if (isset($body['objectType'], $body['objectId']) && in_array($body['objectType'], ['room', 'extended_conversation'], true)) {
|
||||
$result = preg_match('/ROOM\(([^)]+)\)/', $body['objectId'], $matches);
|
||||
if ($result && isset(self::$identifierToToken[$matches[1]])) {
|
||||
$body['objectId'] = self::$identifierToToken[$matches[1]];
|
||||
|
|
|
|||
|
|
@ -115,3 +115,47 @@ Feature: conversation-1/create
|
|||
Then user "participant1" is participant of the following rooms (v4)
|
||||
| id | type | participantType | description |
|
||||
| room | 3 | 1 | Lorem ipsum |
|
||||
|
||||
Scenario: Create extended conversation
|
||||
Given user "participant1" creates room "room1" (v4)
|
||||
| roomType | 3 |
|
||||
| roomName | Foo bar |
|
||||
Given user "participant2" creates room "room2" (v4)
|
||||
| roomType | 3 |
|
||||
| roomName | Not Your Public |
|
||||
Given user "participant2" creates room "room3" (v4)
|
||||
| roomType | 2 |
|
||||
| roomName | Not Your Group |
|
||||
Given user "participant2" creates room "room4" (v4)
|
||||
| roomType | 2 |
|
||||
| roomName | Not Your Open |
|
||||
| listable | 1 |
|
||||
Given user "participant1" creates room "room1-1" (v4)
|
||||
| roomType | 3 |
|
||||
| roomName | Okay |
|
||||
| objectType | extended_conversation |
|
||||
| objectId | ROOM(room1) |
|
||||
Given user "participant1" creates room "room2-1" with 400 (v4)
|
||||
| roomType | 3 |
|
||||
| roomName | Not okay Public |
|
||||
| objectType | extended_conversation |
|
||||
| objectId | ROOM(room2) |
|
||||
Given user "participant1" creates room "room3-1" with 400 (v4)
|
||||
| roomType | 3 |
|
||||
| roomName | Not okay Group |
|
||||
| objectType | extended_conversation |
|
||||
| objectId | ROOM(room3) |
|
||||
Given user "participant1" creates room "room4-1" with 400 (v4)
|
||||
| roomType | 3 |
|
||||
| roomName | Not okay Open |
|
||||
| objectType | extended_conversation |
|
||||
| objectId | ROOM(room4) |
|
||||
Given user "participant1" creates room "room5-1" with 400 (v4)
|
||||
| roomType | 3 |
|
||||
| roomName | Not okay Open |
|
||||
| objectType | extended_conversation |
|
||||
| objectId | in/valid |
|
||||
Then user "participant1" is participant of the following rooms (v4)
|
||||
| id | name | type | participantType |
|
||||
| room1 | Foo bar | 3 | 1 |
|
||||
| room1-1 | Okay | 3 | 1 |
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue