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:
authorVincent Petry <vincent@nextcloud.com>2020-12-01 13:56:54 +0300
committerVincent Petry <vincent@nextcloud.com>2020-12-11 20:15:47 +0300
commit17971cd34a6ecb0cdf4e926e41414f13a2bd4c41 (patch)
treeabb522f422fd26ff1654eabdaacfe54ed5d09a94 /lib/Controller
parentbe0ed4a7f5f3b7eaa8acef96258862929dfd729f (diff)
Add listable flags attribute for conversations
Added ability to set a conversation as listable for regular users and/or guest users from the guest app. This only implements the flag, endpoint and UI to manage it but not yet making it appear in search results. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Diffstat (limited to 'lib/Controller')
-rw-r--r--lib/Controller/RoomController.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/Controller/RoomController.php b/lib/Controller/RoomController.php
index 06d7e6334..c05c98bdd 100644
--- a/lib/Controller/RoomController.php
+++ b/lib/Controller/RoomController.php
@@ -531,6 +531,7 @@ class RoomController extends AEnvironmentAwareController {
'participantType' => Participant::GUEST,
'participantFlags' => Participant::FLAG_DISCONNECTED,
'readOnly' => Room::READ_WRITE,
+ 'listable' => $room->getListable(),
'hasPassword' => $room->hasPassword(),
'hasCall' => false,
'canStartCall' => false,
@@ -605,6 +606,7 @@ class RoomController extends AEnvironmentAwareController {
'objectId' => $room->getObjectId(),
'participantType' => $attendee->getParticipantType(),
'readOnly' => $room->getReadOnly(),
+ 'listable' => $room->getListable(),
'hasCall' => $room->getActiveSince() instanceof \DateTimeInterface,
'lastActivity' => $lastActivity,
'isFavorite' => $attendee->isFavorite(),
@@ -1470,6 +1472,21 @@ class RoomController extends AEnvironmentAwareController {
}
/**
+ * @NoAdminRequired
+ * @RequireModeratorParticipant
+ *
+ * @param int $state
+ * @return DataResponse
+ */
+ public function setListable(int $scope): DataResponse {
+ if (!$this->room->setListable($scope)) {
+ return new DataResponse([], Http::STATUS_BAD_REQUEST);
+ }
+
+ return new DataResponse();
+ }
+
+ /**
* @PublicPage
* @RequireModeratorParticipant
*