summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Controller/RecordingController.php20
-rw-r--r--lib/Manager.php57
-rw-r--r--lib/Service/RecordingService.php20
3 files changed, 66 insertions, 31 deletions
diff --git a/lib/Controller/RecordingController.php b/lib/Controller/RecordingController.php
index b91370639..0948fe538 100644
--- a/lib/Controller/RecordingController.php
+++ b/lib/Controller/RecordingController.php
@@ -35,20 +35,14 @@ use OCP\AppFramework\Http\DataResponse;
use OCP\IRequest;
class RecordingController extends AEnvironmentAwareController {
- private Config $talkConfig;
- private SIPBridgeService $SIPBridgeService;
- private RecordingService $recordingService;
-
-
- public function __construct(string $appName,
- IRequest $request,
- Config $talkConfig,
- SIPBridgeService $SIPBridgeService,
- RecordingService $recordingService) {
+ public function __construct(
+ string $appName,
+ IRequest $request,
+ private Config $talkConfig,
+ private SIPBridgeService $SIPBridgeService,
+ private RecordingService $recordingService
+ ) {
parent::__construct($appName, $request);
- $this->talkConfig = $talkConfig;
- $this->SIPBridgeService = $SIPBridgeService;
- $this->recordingService = $recordingService;
}
/**
diff --git a/lib/Manager.php b/lib/Manager.php
index dfd0b630e..6f68ab02d 100644
--- a/lib/Manager.php
+++ b/lib/Manager.php
@@ -126,6 +126,44 @@ class Manager {
}
/**
+ * @param array $data
+ * @return Room
+ */
+ public function createRoomObjectFromData(array $data): Room {
+ return $this->createRoomObject(array_merge([
+ 'r_id' => 0,
+ 'type' => 0,
+ 'read_only' => 0,
+ 'listable' => 0,
+ 'message_expiration' => 0,
+ 'lobby_state' => 0,
+ 'sip_enabled' => 0,
+ 'assigned_hpb' => null,
+ 'token' => '',
+ 'name' => '',
+ 'description' => '',
+ 'password' => '',
+ 'avatar' => '',
+ 'remote_server' => '',
+ 'remote_token' => '',
+ 'active_guests' => 0,
+ 'default_permissions' => 0,
+ 'call_permissions' => 0,
+ 'call_flag' => 0,
+ 'active_since' => null,
+ 'last_activity' => null,
+ 'last_message' => 0,
+ 'comment_id' => null,
+ 'lobby_timer' => null,
+ 'object_type' => '',
+ 'object_id' => '',
+ 'breakout_room_mode' => 0,
+ 'breakout_room_status' => 0,
+ 'call_recording' => 0,
+ ], $data));
+ }
+
+ /**
* @param array $row
* @return Room
*/
@@ -956,8 +994,14 @@ class Manager {
$insert->executeStatement();
$roomId = $insert->getLastInsertId();
-
- $room = $this->getRoomById($roomId);
+ $room = $this->createRoomObjectFromData([
+ 'r_id' => $roomId,
+ 'name' => $name,
+ 'type' => $type,
+ 'token' => $token,
+ 'object_type' => $objectType,
+ 'object_id' => $objectId,
+ ]);
$event = new RoomEvent($room);
$this->dispatcher->dispatch(Room::EVENT_AFTER_ROOM_CREATE, $event);
@@ -988,7 +1032,14 @@ class Manager {
$qb->executeStatement();
$roomId = $qb->getLastInsertId();
- return $this->getRoomById($roomId);
+ return $this->createRoomObjectFromData([
+ 'r_id' => $roomId,
+ 'name' => $name,
+ 'type' => $type,
+ 'token' => $token,
+ 'remote_token' => $remoteToken,
+ 'remote_server' => $remoteServer,
+ ]);
}
public function resolveRoomDisplayName(Room $room, string $userId): string {
diff --git a/lib/Service/RecordingService.php b/lib/Service/RecordingService.php
index 8c9eb4815..a8d7b666f 100644
--- a/lib/Service/RecordingService.php
+++ b/lib/Service/RecordingService.php
@@ -42,24 +42,14 @@ class RecordingService {
'video/ogg' => ['ogv'],
'video/x-matroska' => ['mkv'],
];
- private IMimeTypeDetector $mimeTypeDetector;
- private ParticipantService $participantService;
- private IRootFolder $rootFolder;
- private Config $config;
- private RoomService $roomService;
public function __construct(
- IMimeTypeDetector $mimeTypeDetector,
- ParticipantService $participantService,
- IRootFolder $rootFolder,
- Config $config,
- RoomService $roomService
+ private IMimeTypeDetector $mimeTypeDetector,
+ private ParticipantService $participantService,
+ private IRootFolder $rootFolder,
+ private Config $config,
+ private RoomService $roomService
) {
- $this->mimeTypeDetector = $mimeTypeDetector;
- $this->participantService = $participantService;
- $this->rootFolder = $rootFolder;
- $this->config = $config;
- $this->roomService = $roomService;
}
public function start(Room $room, int $status): void {