From e9ca12a945b1d1c068e9c31050e264cb20690db4 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 27 Jan 2019 03:23:17 +0100 Subject: Reaktor: add data Command --- src/Reaktor.hs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/Reaktor.hs') diff --git a/src/Reaktor.hs b/src/Reaktor.hs index 21379ca..34baadb 100644 --- a/src/Reaktor.hs +++ b/src/Reaktor.hs @@ -28,6 +28,7 @@ import Prelude.Extended import Reaktor.Internal import Reaktor.Internal as Exports (Actions(..)) import Reaktor.Internal as Exports (Message(Message,Start)) +import Reaktor.IRC as Exports import Reaktor.Internal as Exports (formatMessage) import Reaktor.Nick as Exports import Reaktor.Nick as Nick @@ -104,7 +105,7 @@ logger h takeLog = forever $ takeLog >>= T.hPutStrLn h . pp pinger :: (Message -> IO ()) -> IO () pinger aSend = forever $ do threadDelay time - aSend (Message Nothing "PING" ["heartbeat"]) + aSend (Message Nothing PING ["heartbeat"]) where time = 300 * 1000000 @@ -162,10 +163,10 @@ splitter plugins takeInMsg = logMsgFilter :: Message -> Maybe Message logMsgFilter = \case - Message _ "PING" _ -> Nothing - Message _ "PONG" _ -> Nothing - Message p "PRIVMSG" ["NickServ",xs] | check -> do - Just (Message p "PRIVMSG" ["NickServ",xs']) + Message _ PING _ -> Nothing + Message _ PONG _ -> Nothing + Message p PRIVMSG ["NickServ",xs] | check -> do + Just (Message p PRIVMSG ["NickServ",xs']) where check = elem cmd ["IDENTIFY","REGAIN"] && length ws > 2 ws = T.words xs @@ -206,7 +207,7 @@ showUnprintable = privmsg :: Text -> [Text] -> Message privmsg msgtarget xs = - Message Nothing "PRIVMSG" (msgtarget:T.intercalate " " xs:[]) + Message Nothing PRIVMSG (msgtarget:T.intercalate " " xs:[]) prefixTimestamp :: Blessings Text -> IO (Blessings Text) -- cgit v1.2.3