[Poll] Polls now have an associated note, poll templates, start_show_styles event, started css

This commit is contained in:
Daniel
2020-11-22 02:36:01 +00:00
committed by Hugo Sales
parent 3a51d3ef89
commit 168b7d313a
18 changed files with 307 additions and 91 deletions

View File

@@ -21,8 +21,10 @@
namespace Plugin\Poll\Controller;
use App\Entity\Note;
use App\Entity\Poll;
use App\Util\Common;
use App\Util\Exception\NoSuchNoteException;
use App\Util\Exception\NotFoundException;
use Symfony\Component\HttpFoundation\Request;
@@ -55,6 +57,12 @@ class ShowPoll
$poll = Poll::getFromId((int) $id);
$note = Note::getFromId($poll->getNoteId());
if (!$note->isVisibleTo($user)) {
throw new NoSuchNoteException();
}
if ($poll == null) {
throw new NotFoundException('Poll does not exist');
}