From 45ebb68aa03ff7a292f46048141949c12cf90f91 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Thu, 6 Aug 2009 00:09:56 +0200 Subject: renamed "Server" algebraic data type to "IrcServer" --- Config.hs | 4 ++-- Hsbot/Core.hs | 8 ++++---- Hsbot/IRC.hs | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Config.hs b/Config.hs index 44278f6..a635292 100644 --- a/Config.hs +++ b/Config.hs @@ -7,7 +7,7 @@ import Hsbot.Core -- | Imported plugins goes there -- | User server -kro = Server +kro = IrcServer { address = "kro.corp" , port = 6667 , channels = ["#geek"] @@ -21,6 +21,6 @@ kro = Server config :: Config config = Config { commandPrefixes = ['@'] - , servers = [kro] + , ircServers = [kro] } diff --git a/Hsbot/Core.hs b/Hsbot/Core.hs index 153ce77..b2e34c8 100644 --- a/Hsbot/Core.hs +++ b/Hsbot/Core.hs @@ -1,7 +1,7 @@ module Hsbot.Core ( Bot(..) , Config(..) - , Server(..) + , IrcServer(..) , newbot ) where @@ -10,17 +10,17 @@ import System.IO (Handle) -- | An IRC Bot server state (socket handles) data Bot = Bot - { joinedServers :: M.Map Server Handle -- servers we are connected to + { joinedServers :: M.Map IrcServer Handle -- servers we are connected to } deriving (Eq, Show) -- | Configuration data type data Config = Config { commandPrefixes :: String, -- command prefixes, for example @[\'>\',\'@\',\'?\']@ - servers :: [Server] -- list of 'Server's to connect to + ircServers :: [IrcServer] -- list of 'Server's to connect to } deriving (Eq,Show) -- | An IRC server -data Server = Server +data IrcServer = IrcServer { address :: String -- the server's address , port :: Int -- the server's port , channels :: [String] -- a list of channels to join diff --git a/Hsbot/IRC.hs b/Hsbot/IRC.hs index 094cb3f..6ff1013 100644 --- a/Hsbot/IRC.hs +++ b/Hsbot/IRC.hs @@ -22,9 +22,9 @@ data IrcInput = Cmd User Channel (Command, Maybe String) -- a regular command -- | Data that can go over the remote channel data IrcOutput = Str String -- a regular string - | Quit (Server, Handle) -- a quit message from a server - | Join (Server, Channel) -- joined a channel - | Part (Server, Channel) -- parted the channel + | Quit (IrcServer, Handle) -- a quit message from a server + | Join (IrcServer, Channel) -- joined a channel + | Part (IrcServer, Channel) -- parted the channel | Reboot -- reboot message sent | Nil -- signifies thread death, only happens after reboot deriving (Eq,Show) -- cgit v1.2.3