Commit 1d6f3580 authored by Nikita Karetnikov's avatar Nikita Karetnikov

Use absolute links.

parent 55f3f108
......@@ -372,10 +372,14 @@ createUser ident passwd name email avatar nick = do
--
insertDefaultNotificationPrefs user_id
welcome_route <- getUrlRender
-- 'MonolingualWikiR' is deprecated.
<*> (pure $ MonolingualWikiR "snowdrift" "welcome" [])
let notif_text = Markdown $ T.unlines
[ "Thanks for registering!"
, "<br> Please read our [**welcome message**](/p/snowdrift/w/welcome), and let us know any questions."
, "<br> Please read our [**welcome message**](" <>
welcome_route <>
"), and let us know any questions."
]
-- TODO: change snowdrift_id to the generated site-project id
-- TODO(mitchell): This notification doesn't get sent to the event channel. Is that okay?
......
......@@ -63,7 +63,6 @@ import Model.Comment.Sql
import Model.Discussion
import Model.Notification
import Model.User.Internal (sendPreferredNotificationDB)
import Model.Utils
import qualified Control.Monad.State as State
import Control.Monad.Writer.Strict (tell)
......@@ -326,7 +325,8 @@ editCommentDB comment_id text = do
Nothing -> return ()
Just (Entity comment_flagging_id CommentFlagging{..}) -> do
langs <- lift $ lift getLanguages
rendered_route <- lift (makeCommentRouteDB langs comment_id >>= lift . routeToText . fromJust)
render <- getUrlRender
rendered_route <- lift $ makeCommentRouteDB langs comment_id >>= return . render . fromJust
let notif_text = Markdown $ "A comment you flagged has been edited and reposted to the site. You can view it [here](" <> rendered_route <> ")."
lift (deleteCascade comment_flagging_id) -- delete flagging and all flagging reasons with it.
sendPreferredNotificationDB commentFlaggingFlagger NotifFlagRepost Nothing Nothing notif_text
......
......@@ -52,7 +52,7 @@ notificationEventHandler AppConfig{..} (ECommentPending comment_id comment) = ru
sendPreferredNotificationDB (commentUser comment) NotifUnapprovedComment Nothing Nothing $ mconcat
[ "Your [comment]("
, Markdown route_text
, Markdown $ appRoot <> route_text
, ") now awaits moderator approval."
, "<br><br>"
, "When a moderator acknowledges you as a legitimate user "
......@@ -85,7 +85,7 @@ notificationEventHandler AppConfig{..} (ECommentApproved comment_id comment) = r
route_text <- lift (makeCommentRouteDB [LangEn] comment_id >>= lift . routeToText . fromJust)
sendPreferredNotificationDB (commentUser comment) NotifApprovedComment Nothing Nothing $ mconcat
[ "Your [comment]("
, Markdown route_text
, Markdown $ appRoot <> route_text
, ") has been approved."
]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment