diff --git a/app/classes/Framadate/Services/NotificationService.php b/app/classes/Framadate/Services/NotificationService.php index f1f181cb71b88c8d8cd382a7db02cdefb9b271d6..e59c5c1d8357245047c0df3276e45a4387e2b028 100644 --- a/app/classes/Framadate/Services/NotificationService.php +++ b/app/classes/Framadate/Services/NotificationService.php @@ -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'; diff --git a/app/classes/Framadate/Utils.php b/app/classes/Framadate/Utils.php index 87bc546b0f409c25e2a77ca700229064f05f8b76..f60a592bcb1fe831542238a5dd09ada07c325fda 100644 --- a/app/classes/Framadate/Utils.php +++ b/app/classes/Framadate/Utils.php @@ -28,6 +28,7 @@ class Utils { $dirname = dirname($_SERVER['SCRIPT_NAME']); $dirname = $dirname === '\\' ? '/' : $dirname . '/'; $dirname = str_replace('/admin', '', $dirname); + $dirname = str_replace('/action', '', $dirname); $server_name = (defined('APP_URL') ? APP_URL : $_SERVER['SERVER_NAME']) . $port . $dirname; return $scheme . '://' . preg_replace('#//+#', '/', $server_name);