Fix the code that checks if we should send notification regarding type of notification

This commit is contained in:
Olivier PEREZ 2016-11-14 23:35:04 +01:00
parent c6a98e16e8
commit 79ae5bb77d

View File

@ -34,7 +34,11 @@ class NotificationService {
$_SESSION['mail_sent'] = [];
}
if ($poll->receiveNewVotes) {
$isVoteAndCanSendIt = ($type == self::UPDATE_VOTE || $type == self::ADD_VOTE) && $poll->receiveNewVotes;
$isCommentAndCanSendIt = $type == self::ADD_COMMENT && $poll->receiveNewComments;
$isOtherType = $type != self::UPDATE_VOTE && $type != self::ADD_VOTE && $type != self::ADD_COMMENT;
if ($isVoteAndCanSendIt || $isCommentAndCanSendIt || $isOtherType) {
if (self::isParticipation($type)) {
$translationString = 'Poll\'s participation: %s';