diff options
Diffstat (limited to 'lib/Service/CommentService.php')
-rw-r--r-- | lib/Service/CommentService.php | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/lib/Service/CommentService.php b/lib/Service/CommentService.php index 1f5c18f9..4dc3c696 100644 --- a/lib/Service/CommentService.php +++ b/lib/Service/CommentService.php @@ -88,17 +88,15 @@ class CommentService { $this->acl->setPollId($pollId, Acl::PERMISSION_COMMENT_ADD); } - if ($message !== '') { - $this->comment = new Comment(); - $this->comment->setPollId($this->acl->getPollId()); - $this->comment->setUserId($this->acl->getUserId()); - $this->comment->setComment($message); - $this->comment->setDt(date('Y-m-d H:i:s')); - $this->comment->setTimestamp(time()); - $this->comment = $this->commentMapper->insert($this->comment); - $this->watchService->writeUpdate($this->comment->getPollId(), Watch::OBJECT_COMMENTS); - return $this->comment; - } + $this->comment = new Comment(); + $this->comment->setPollId($this->acl->getPollId()); + $this->comment->setUserId($this->acl->getUserId()); + $this->comment->setComment($message); + $this->comment->setDt(date('Y-m-d H:i:s')); + $this->comment->setTimestamp(time()); + $this->comment = $this->commentMapper->insert($this->comment); + $this->watchService->writeUpdate($this->comment->getPollId(), Watch::OBJECT_COMMENTS); + return $this->comment; } /** |