summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-01-31 13:57:55 +0100
committerJoas Schilling <coding@schilljs.com>2023-01-31 13:57:55 +0100
commit986a52001cc78eb9d029a80d6143ceb7cac485f5 (patch)
tree0c429b09693c67f05a28df31473861547b50e417 /lib
parent48f1d414b200b64f3495f6669f78221e4d747f3a (diff)
fix(polls): Don't allow to create polls in changelog conversations
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/Controller/PollController.php4
-rw-r--r--lib/Middleware/InjectionMiddleware.php3
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/Controller/PollController.php b/lib/Controller/PollController.php
index b4950692a..0763339ed 100644
--- a/lib/Controller/PollController.php
+++ b/lib/Controller/PollController.php
@@ -77,8 +77,8 @@ class PollController extends AEnvironmentAwareController {
* @return DataResponse
*/
public function createPoll(string $question, array $options, int $resultMode, int $maxVotes): DataResponse {
- if ($this->room->getType() === Room::TYPE_ONE_TO_ONE
- || $this->room->getType() === Room::TYPE_ONE_TO_ONE_FORMER) {
+ if ($this->room->getType() !== Room::TYPE_GROUP
+ && $this->room->getType() !== Room::TYPE_PUBLIC) {
return new DataResponse([], Http::STATUS_BAD_REQUEST);
}
diff --git a/lib/Middleware/InjectionMiddleware.php b/lib/Middleware/InjectionMiddleware.php
index fc8e4bcad..de5110710 100644
--- a/lib/Middleware/InjectionMiddleware.php
+++ b/lib/Middleware/InjectionMiddleware.php
@@ -200,6 +200,9 @@ class InjectionMiddleware extends Middleware {
if (!$room instanceof Room || $room->getReadOnly() === Room::READ_ONLY) {
throw new ReadOnlyException();
}
+ if ($room->getType() === Room::TYPE_CHANGELOG) {
+ throw new ReadOnlyException();
+ }
}
/**