summaryrefslogtreecommitdiffstats
path: root/lib/Controller/PollController.php
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2022-05-16 14:42:21 +0200
committerJoas Schilling <coding@schilljs.com>2022-06-13 12:52:58 +0200
commit30c41a8fff35ed77f9a7ced277f64e665a5b03c3 (patch)
tree05fb4f7d88ceeb481fe739eba74b7087a4392ff0 /lib/Controller/PollController.php
parenta39e7815e1caad62c870fd61f0651a52a316639b (diff)
Cache the display name for polls and votes
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Controller/PollController.php')
-rw-r--r--lib/Controller/PollController.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Controller/PollController.php b/lib/Controller/PollController.php
index ade2a22e8..2aeaefa33 100644
--- a/lib/Controller/PollController.php
+++ b/lib/Controller/PollController.php
@@ -31,6 +31,7 @@ use OCA\Talk\Exceptions\WrongPermissionsException;
use OCA\Talk\Model\Poll;
use OCA\Talk\Model\Vote;
use OCA\Talk\Service\PollService;
+use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\Utility\ITimeFactory;
@@ -77,12 +78,14 @@ class PollController extends AEnvironmentAwareController {
$this->room->getId(),
$attendee->getActorType(),
$attendee->getActorId(),
+ $attendee->getDisplayName(),
$question,
$options,
$resultMode,
$maxVotes
);
} catch (\Exception $e) {
+ $this->logger->error('Error creating poll', ['exception' => $e]);
return new DataResponse([], Http::STATUS_BAD_REQUEST);
}
@@ -119,7 +122,7 @@ class PollController extends AEnvironmentAwareController {
public function showPoll(int $pollId): DataResponse {
try {
$poll = $this->pollService->getPoll($this->room->getId(), $pollId);
- } catch (\Exception $e) {
+ } catch (DoesNotExistException $e) {
return new DataResponse([], Http::STATUS_NOT_FOUND);
}