Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2019-07-04 16:33:16 +0300
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2019-08-28 11:28:06 +0300
commit8cd50644d406364a43acfebed30836694c632199 (patch)
tree215876ba9bdf847621b37c43b9aeb22829d4c95d /lib/Controller
parent36e3da092c496d7fbde7fa31c81064605bb99ca8 (diff)
Allow a timer as well
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Controller')
-rw-r--r--lib/Controller/RoomController.php10
-rw-r--r--lib/Controller/WebinaryController.php18
2 files changed, 25 insertions, 3 deletions
diff --git a/lib/Controller/RoomController.php b/lib/Controller/RoomController.php
index 549bd4cf7..bb0de64e8 100644
--- a/lib/Controller/RoomController.php
+++ b/lib/Controller/RoomController.php
@@ -37,6 +37,7 @@ use OCA\Spreed\Manager;
use OCA\Spreed\Participant;
use OCA\Spreed\Room;
use OCA\Spreed\TalkSession;
+use OCA\Spreed\Webinary;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\Utility\ITimeFactory;
@@ -201,6 +202,13 @@ class RoomController extends AEnvironmentAwareController {
$lastActivity = 0;
}
+ $lobbyTimer = $room->getLobbyTimer();
+ if ($lobbyTimer instanceof \DateTimeInterface) {
+ $lobbyTimer = $lobbyTimer->format(\DateTime::ATOM);
+ } else {
+ $lobbyTimer = '';
+ }
+
$roomData = array_merge($roomData, [
'name' => $room->getName(),
'displayName' => $room->getDisplayName($currentParticipant->getUser()),
@@ -216,6 +224,8 @@ class RoomController extends AEnvironmentAwareController {
'lastActivity' => $lastActivity,
'isFavorite' => $currentParticipant->isFavorite(),
'notificationLevel' => $currentParticipant->getNotificationLevel(),
+ 'lobbyState' => $room->getLobbyState(),
+ 'lobbyTimer' => $lobbyTimer,
'lastPing' => $currentParticipant->getLastPing(),
'sessionId' => $currentParticipant->getSessionId(),
]);
diff --git a/lib/Controller/WebinaryController.php b/lib/Controller/WebinaryController.php
index d67cd2843..e34a1f612 100644
--- a/lib/Controller/WebinaryController.php
+++ b/lib/Controller/WebinaryController.php
@@ -26,13 +26,19 @@ namespace OCA\Spreed\Controller;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
+use OCP\AppFramework\Utility\ITimeFactory;
use OCP\IRequest;
class WebinaryController extends AEnvironmentAwareController {
+ /** @var ITimeFactory */
+ protected $timeFactory;
+
public function __construct(string $appName,
- IRequest $request) {
+ IRequest $request,
+ ITimeFactory $timeFactory) {
parent::__construct($appName, $request);
+ $this->timeFactory = $timeFactory;
}
/**
@@ -40,10 +46,16 @@ class WebinaryController extends AEnvironmentAwareController {
* @RequireModeratorParticipant
*
* @param int $state
+ * @param string $timer
* @return DataResponse
*/
- public function setLobbyState(int $state): DataResponse {
- if (!$this->room->setLobbyState($state)) {
+ public function setLobby(int $state, ?string $timer = null): DataResponse {
+ $timerDateTime = null;
+ if (trim((string) $timer) !== '') {
+ $timerDateTime = $this->timeFactory->getDateTime($timer);
+ }
+
+ if (!$this->room->setLobby($state, $timerDateTime)) {
return new DataResponse([], Http::STATUS_BAD_REQUEST);
}