irc-client 0.4.1.0 → 0.4.1.1
raw patch · 3 files changed
+14/−6 lines, 3 filesPVP: minor bump suggested
API additions: PVP suggests at least a minor version bump
API changes (from Hackage documentation)
+ Network.IRC.Client.Handlers: joinOnWelcome :: UnicodeEvent -> StatefulIRC s ()
Files
- Network/IRC/Client.hs +1/−1
- Network/IRC/Client/Handlers.hs +11/−3
- irc-client.cabal +2/−2
Network/IRC/Client.hs view
@@ -136,7 +136,7 @@ , _realname = n , _password = Nothing , _channels = []- , _ctcpVer = "irc-client-0.4.1.0"+ , _ctcpVer = "irc-client-0.4.1.1" , _eventHandlers = defaultEventHandlers , _ignore = [] }
Network/IRC/Client/Handlers.hs view
@@ -11,6 +11,7 @@ , ctcpVersionHandler , ctcpTimeHandler , welcomeNick+ , joinOnWelcome , nickMangler -- * Special handlers@@ -68,6 +69,7 @@ , EventHandler "Respond to CTCP VERSION requests" ECTCP ctcpVersionHandler , EventHandler "Respond to CTCP TIME requests" ECTCP ctcpTimeHandler , EventHandler "Update the nick upon welcome" ENumeric welcomeNick+ , EventHandler "Join channels upon welcome" ENumeric joinOnWelcome , EventHandler "Mangle the nick on collision" ENumeric nickMangler , EventHandler "Update the channel list on JOIN" ENumeric joinHandler , EventHandler "Update the channel lift on KICK" EKick kickHandler@@ -109,6 +111,14 @@ writeTVar tvarI iconf { _nick = srvNick } go _ = return () +-- | Join default channels upon welcome (numeric reply 001). If sent earlier,+-- the server might reject the JOIN attempts.+joinOnWelcome :: UnicodeEvent -> StatefulIRC s ()+joinOnWelcome = numHandler [(001, go)] where+ go _ = do+ iconf <- instanceConfig+ mapM_ (send . Join) $ _channels iconf+ -- | Mangle the nick if there's a collision (numeric replies 432, 433, -- and 436) when we set it nickMangler :: UnicodeEvent -> StatefulIRC s ()@@ -191,13 +201,11 @@ -- *Special --- | The default connect handler: set the nick and join default--- channels.+-- | The default connect handler: set the nick. defaultOnConnect :: StatefulIRC s () defaultOnConnect = do iconf <- instanceConfig send . Nick $ _nick iconf- mapM_ (send . Join) $ _channels iconf -- | The default disconnect handler: do nothing. You might want to -- override this with one which reconnects.
irc-client.cabal view
@@ -10,7 +10,7 @@ -- PVP summary: +-+------- breaking API changes -- | | +----- non-breaking API additions -- | | | +--- code changes with no API change-version: 0.4.1.0+version: 0.4.1.1 -- A short (one-line) description of the package. synopsis: An IRC client library.@@ -108,4 +108,4 @@ source-repository this type: git location: https://github.com/barrucadu/irc-client.git- tag: 0.4.1.0+ tag: 0.4.1.1