From 909d3acc6ed815236bf1cbc0fd733ed9d89f5855 Mon Sep 17 00:00:00 2001 From: nek0 Date: Sun, 6 Aug 2017 04:42:57 +0200 Subject: [PATCH] fix #51 --- Handler/Medium.hs | 22 ++++++++++++---------- eidolon.cabal | 2 +- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Handler/Medium.hs b/Handler/Medium.hs index 470fa83..f651a8d 100755 --- a/Handler/Medium.hs +++ b/Handler/Medium.hs @@ -25,6 +25,7 @@ import Text.Markdown import Yesod.Text.Markdown import Yesod.RssFeed import Yesod.AtomFeed +import Control.Monad (unless) getMediumR :: MediumId -> Handler Html getMediumR mediumId = do @@ -95,16 +96,17 @@ postMediumR mediumId = do --send mail to medium owner owner <- runDB $ getJust $ mediumOwner medium link <- ($ MediumR (commentOrigin temp)) <$> getUrlRender - sendMail (userEmail owner) (userSl `T.append` " commented on your medium") - [shamlet| -

Hello #{userSlug owner} -

#{userSl} commented on your medium #{mediumTitle medium}: -

#{commentContent temp} -

To follow the comment thread follow - - this link - . - |] + unless (userId == mediumOwner medium) $ + sendMail (userEmail owner) (userSl `T.append` " commented on your medium") + [shamlet| +

Hello #{userSlug owner} +

#{userSl} commented on your medium #{mediumTitle medium}: +

#{commentContent temp} +

To read the comment thread follow + + this link + . + |] setMessage "Your Comment has been posted" redirect $ MediumR mediumId _ -> do diff --git a/eidolon.cabal b/eidolon.cabal index 0f420f3..df5ae9f 100755 --- a/eidolon.cabal +++ b/eidolon.cabal @@ -1,5 +1,5 @@ name: eidolon -version: 0.1.9.3 +version: 0.1.10.0 synopsis: Image gallery in Yesod homepage: https://eidolon.nek0.eu license: AGPL-3