clckwrks-plugin-ircbot 0.5.4 → 0.6.0
raw patch · 8 files changed
+38/−29 lines, 8 filesdep ~acid-statedep ~clckwrksdep ~happstack-hspsetup-changed
Dependency ranges changed: acid-state, clckwrks, happstack-hsp, happstack-server, hsp, reform, reform-happstack, reform-hsp
Files
- Clckwrks/IrcBot/Monad.hs +7/−5
- Clckwrks/IrcBot/Page/IrcLog.hs +3/−2
- Clckwrks/IrcBot/Page/IrcLogs.hs +3/−2
- Clckwrks/IrcBot/Page/Reconnect.hs +5/−3
- Clckwrks/IrcBot/Page/Settings.hs +5/−3
- Clckwrks/IrcBot/Page/Template.hs +3/−2
- Setup.hs +2/−2
- clckwrks-plugin-ircbot.cabal +10/−10
Clckwrks/IrcBot/Monad.hs view
@@ -16,9 +16,11 @@ import Data.Maybe (fromMaybe) import Data.Set (Set, insert) import qualified Data.Text as T+import qualified Data.Text.Lazy as TL import Happstack.Server (ServerPartT, Input) import Happstack.Server.Internal.Monads (FilterFun)-import HSP (Attr((:=)), Attribute(MkAttr), EmbedAsChild(..), EmbedAsAttr(..), IsName(toName), XMLGenT(..), pAttrVal, XML)+import HSP.XMLGenerator (Attr((:=)), EmbedAsChild(..), EmbedAsAttr(..), IsName(toName), XMLGenT(..))+import HSP.XML (Attribute(MkAttr), XML, fromStringLit, pAttrVal) import Network (PortID(PortNumber)) import Network.IRC.Bot.BotMonad (BotMonad(..)) import Network.IRC.Bot.Core (BotConf(..), User(..), nullBotConf, simpleBot)@@ -58,15 +60,15 @@ instance (Functor m, Monad m) => EmbedAsChild (IrcBotT m) IrcFormError where asChild e = asChild (show e) -instance (IsName n) => EmbedAsAttr IrcBotM (Attr n IrcBotURL) where+instance (IsName n TL.Text) => EmbedAsAttr IrcBotM (Attr n IrcBotURL) where asAttr (n := u) = do url <- showURL u- asAttr $ MkAttr (toName n, pAttrVal (T.unpack url))+ asAttr $ MkAttr (toName n, pAttrVal (TL.fromStrict url)) -instance (IsName n) => EmbedAsAttr IrcBotM (Attr n ClckURL) where+instance (IsName n TL.Text) => EmbedAsAttr IrcBotM (Attr n ClckURL) where asAttr (n := url) = do showFn <- ircBotClckURL <$> ask- asAttr $ MkAttr (toName n, pAttrVal (T.unpack $ showFn url []))+ asAttr $ MkAttr (toName n, pAttrVal (TL.fromStrict $ showFn url [])) runIrcBotT :: IrcBotConfig -> IrcBotT m a -> ClckT IrcBotURL m a runIrcBotT mc m = mapClckT f m
Clckwrks/IrcBot/Page/IrcLog.hs view
@@ -1,4 +1,4 @@-{-# OPTIONS_GHC -F -pgmFtrhsx #-}+{-# OPTIONS_GHC -F -pgmFhsx2hs #-} module Clckwrks.IrcBot.Page.IrcLog where import Control.Applicative ((<$>))@@ -12,7 +12,8 @@ import Happstack.Server.FileServe.BuildingBlocks (isSafePath) import System.Directory import System.FilePath-import HSP+import HSP.XMLGenerator+import HSP.XML import Happstack.Server import Happstack.Server.HSP.HTML
Clckwrks/IrcBot/Page/IrcLogs.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE OverloadedStrings #-}-{-# OPTIONS_GHC -F -pgmFtrhsx #-}+{-# OPTIONS_GHC -F -pgmFhsx2hs #-} module Clckwrks.IrcBot.Page.IrcLogs where import Control.Applicative ((<$>))@@ -11,7 +11,8 @@ import Data.List (sort) import System.Directory import System.FilePath-import HSP+import HSP.XMLGenerator+import HSP.XML import Happstack.Server.HSP.HTML ircLogs :: IrcBotM Response
Clckwrks/IrcBot/Page/Reconnect.hs view
@@ -1,4 +1,4 @@-{-# OPTIONS_GHC -F -pgmFtrhsx #-}+{-# OPTIONS_GHC -F -pgmFhsx2hs #-} module Clckwrks.IrcBot.Page.Reconnect where import Control.Applicative ((<$>), (<*))@@ -10,8 +10,10 @@ import Clckwrks.IrcBot.URL (IrcBotURL) import Data.Map (Map) import qualified Data.Map as Map+import Data.Text.Lazy (pack) import Happstack.Server (Response, ok, setResponseCode, toResponse)-import HSP+import HSP.XML+import HSP.XMLGenerator import Text.Reform ((++>)) import Text.Reform.Happstack (reform) import Text.Reform.HSP.String (inputSubmit, form)@@ -22,7 +24,7 @@ do action <- showURL here template "Force Reconnect" () $ <%>- <% reform (form action) "ir" forceReconnect Nothing forceReconnectForm %>+ <% reform (form action) (pack "ir") forceReconnect Nothing forceReconnectForm %> </%> where forceReconnect :: Maybe String -> IrcBotM Response
Clckwrks/IrcBot/Page/Settings.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE RecordWildCards #-}-{-# OPTIONS_GHC -F -pgmFtrhsx #-}+{-# OPTIONS_GHC -F -pgmFhsx2hs #-} module Clckwrks.IrcBot.Page.Settings where import Control.Applicative ((<$>), (<*>), (<*))@@ -17,9 +17,11 @@ import qualified Data.Map as Map import Data.Set (Set) import qualified Data.Set as Set+import Data.Text.Lazy (pack) import Data.Word (Word16) import Happstack.Server (Response, ok, setResponseCode, toResponse)-import HSP+import HSP.XML+import HSP.XMLGenerator import Network.IRC.Bot (User(..)) import Numeric (readDec) import Text.Reform ((++>), mapView, transformEither)@@ -33,7 +35,7 @@ oldConfig <- query GetIrcConfig template "IrcBot Settings" () $ <%>- <% reform (form action) "ibs" updateSettings Nothing (ircBotSettingsForm oldConfig) %>+ <% reform (form action) (pack "ibs") updateSettings Nothing (ircBotSettingsForm oldConfig) %> </%> where updateSettings :: IrcConfig -> IrcBotM Response
Clckwrks/IrcBot/Page/Template.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE FlexibleContexts, OverloadedStrings #-}-{-# OPTIONS_GHC -F -pgmFtrhsx #-}+{-# OPTIONS_GHC -F -pgmFhsx2hs #-} module Clckwrks.IrcBot.Page.Template where import Clckwrks@@ -8,7 +8,8 @@ import Clckwrks.IrcBot.Monad import Control.Monad.Reader import Data.Text (Text)-import HSP hiding (escape)+import HSP.XML+import HSP.XMLGenerator import Happstack.Server.HSP.HTML () import Web.Plugins.Core (Plugin(..), getPluginRouteFn, getTheme)
Setup.hs view
@@ -5,9 +5,9 @@ import Distribution.Simple import Distribution.Simple.Program -trhsxProgram = simpleProgram "trhsx"+hsx2hsProgram = simpleProgram "hsx2hs" main :: IO () main = defaultMainWithHooks simpleUserHooks {- hookedPrograms = [trhsxProgram]+ hookedPrograms = [hsx2hsProgram] }
clckwrks-plugin-ircbot.cabal view
@@ -1,5 +1,5 @@ Name: clckwrks-plugin-ircbot-Version: 0.5.4+Version: 0.6.0 Synopsis: ircbot plugin for clckwrks Homepage: http://clckwrks.com/ License: BSD3@@ -20,7 +20,7 @@ Library Build-tools:- trhsx+ hsx2hs Exposed-modules: Clckwrks.IrcBot@@ -40,24 +40,24 @@ Build-depends: base < 5,- acid-state >= 0.7,+ acid-state >= 0.9, attoparsec == 0.10.*, blaze-html >= 0.5 && < 0.7,- clckwrks >= 0.16 && < 0.17,+ clckwrks >= 0.18 && < 0.19, containers >= 0.4 && < 0.6, directory >= 1.1 && < 1.3, filepath >= 1.2 && < 1.4,- happstack-server >= 7.0 && < 7.2,- happstack-hsp == 7.1.*,- hsp == 0.7.*,+ happstack-server >= 7.0 && < 7.4,+ happstack-hsp == 7.2.*,+ hsp == 0.9.*, ircbot >= 0.5.2 && < 0.6, ixset == 1.0.*, -- magic == 1.0.*, mtl >= 2.0 && < 2.3, network >= 2.3 && < 2.5,- reform == 0.1.*,- reform-happstack == 0.1.*,- reform-hsp >= 0.1.1 && < 0.2,+ reform == 0.2.*,+ reform-happstack == 0.2.*,+ reform-hsp >= 0.2 && < 0.3, safecopy >= 0.6, text == 0.11.*, web-plugins >= 0.1 && < 0.3,