Dropped support for older versions of yesod and warp than the ones in Debian Jessie.
466 lines of compat cruft deleted!
This commit is contained in:
parent
a15e1158c6
commit
eb8ef44133
13 changed files with 19 additions and 466 deletions
|
@ -5,13 +5,7 @@
|
|||
- Licensed under the GNU AGPL version 3 or higher.
|
||||
-}
|
||||
|
||||
{-# LANGUAGE CPP, QuasiQuotes, TemplateHaskell, OverloadedStrings #-}
|
||||
|
||||
#if defined VERSION_yesod_default
|
||||
#if ! MIN_VERSION_yesod_default(1,1,0)
|
||||
#define WITH_OLD_YESOD
|
||||
#endif
|
||||
#endif
|
||||
{-# LANGUAGE QuasiQuotes, TemplateHaskell, OverloadedStrings #-}
|
||||
|
||||
module Assistant.WebApp.Notifications where
|
||||
|
||||
|
@ -26,9 +20,7 @@ import Utility.WebApp
|
|||
|
||||
import Data.Text (Text)
|
||||
import qualified Data.Text as T
|
||||
#ifndef WITH_OLD_YESOD
|
||||
import qualified Data.Aeson.Types as Aeson
|
||||
#endif
|
||||
|
||||
{- Add to any widget to make it auto-update using long polling.
|
||||
-
|
||||
|
@ -42,15 +34,9 @@ import qualified Data.Aeson.Types as Aeson
|
|||
-}
|
||||
autoUpdate :: Text -> Route WebApp -> Int -> Int -> Widget
|
||||
autoUpdate tident geturl ms_delay ms_startdelay = do
|
||||
#ifdef WITH_OLD_YESOD
|
||||
let delay = show ms_delay
|
||||
let startdelay = show ms_startdelay
|
||||
let ident = "'" ++ T.unpack tident ++ "'"
|
||||
#else
|
||||
let delay = Aeson.String (T.pack (show ms_delay))
|
||||
let startdelay = Aeson.String (T.pack (show ms_startdelay))
|
||||
let ident = Aeson.String tident
|
||||
#endif
|
||||
$(widgetFile "notifications/longpolling")
|
||||
|
||||
{- Notifier urls are requested by the javascript, to avoid allocation
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue