irc-core 2.3.0 → 2.4.0
raw patch · 5 files changed
+44/−34 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- ChangeLog.md +4/−0
- irc-core.cabal +3/−4
- src/Irc/Codes.hs +2/−2
- src/Irc/Message.hs +32/−25
- src/Irc/RawIrcMsg.hs +3/−3
ChangeLog.md view
@@ -1,5 +1,9 @@ # Revision history for irc-core +## 2.4.0++* Change TOPIC and INVITING replies to channel target+ ## 2.3.0 -- 2017-06-02 * Change type of `idDenote` to save a bit of memory
irc-core.cabal view
@@ -1,10 +1,9 @@ name: irc-core-version: 2.3.0+version: 2.4.0 synopsis: IRC core library for glirc description: IRC core library for glirc . The glirc client has been split off into <https://hackage.haskell.org/package/glirc>-homepage: https://github.com/glguy/irc-core license: ISC license-file: LICENSE author: Eric Mertens@@ -33,14 +32,14 @@ Irc.UserInfo other-modules: View - build-depends: base >=4.9 && <4.11,+ build-depends: base >=4.9 && <4.12, base64-bytestring >= 1.0.0.1 && <1.1, attoparsec >=0.13 && <0.14, bytestring >=0.10 && <0.11, hashable >=1.2 && <1.3, primitive >=0.6 && <0.7, text >=1.2 && <1.3,- time >=1.6 && <1.9,+ time >=1.6 && <1.10, vector >=0.11 && <0.13 hs-source-dirs: src
src/Irc/Codes.hs view
@@ -206,7 +206,7 @@ pattern RPL_MOTDSTART = ReplyCode 375 pattern RPL_ENDOFMOTD = ReplyCode 376 pattern RPL_WHOISHOST = ReplyCode 378-pattern RPL_KICKLINKED = ReplyCode 379+pattern RPL_WHOISMODES = ReplyCode 379 pattern RPL_YOUREOPER = ReplyCode 381 pattern RPL_REHASHING = ReplyCode 382 pattern RPL_YOURESERVICE = ReplyCode 383@@ -633,7 +633,7 @@ , (RPL_MOTDSTART , ReplyCodeInfo CommandReply "motd-start") , (RPL_ENDOFMOTD , ReplyCodeInfo CommandReply "end-of-motd") , (RPL_WHOISHOST , ReplyCodeInfo CommandReply "whois-host")- , (RPL_KICKLINKED , ReplyCodeInfo CommandReply "kick-linked")+ , (RPL_WHOISMODES , ReplyCodeInfo CommandReply "whois-modes") , (RPL_YOUREOPER , ReplyCodeInfo CommandReply "youre-oper") , (RPL_REHASHING , ReplyCodeInfo CommandReply "rehashing") , (RPL_YOURESERVICE , ReplyCodeInfo CommandReply "youre-service")
src/Irc/Message.hs view
@@ -182,31 +182,38 @@ msgTarget :: Identifier -> IrcMsg -> MessageTarget msgTarget me msg = case msg of- UnknownMsg{} -> TargetNetwork- Nick user _ -> TargetUser (userNick user)- Mode _ tgt _ | tgt == me -> TargetNetwork- | otherwise -> TargetWindow tgt- Join _ chan -> TargetWindow chan- Part _ chan _ -> TargetWindow chan- Quit user _ -> TargetUser (userNick user)- Kick _ chan _ _ -> TargetWindow chan- Topic _ chan _ -> TargetWindow chan- Privmsg src tgt _ | tgt == me -> TargetWindow (userNick src)- | otherwise -> TargetWindow tgt- Ctcp src tgt _ _ | tgt == me -> TargetWindow (userNick src)- | otherwise -> TargetWindow tgt- CtcpNotice src tgt _ _ | tgt == me -> TargetWindow (userNick src)- | otherwise -> TargetWindow tgt- Notice src tgt _ | tgt == me -> TargetWindow (userNick src)- | otherwise -> TargetWindow tgt- Authenticate{} -> TargetHidden- Ping{} -> TargetHidden- Pong{} -> TargetHidden- Error{} -> TargetNetwork- Cap{} -> TargetNetwork- Reply{} -> TargetNetwork- BatchStart{} -> TargetHidden- BatchEnd{} -> TargetHidden+ UnknownMsg{} -> TargetNetwork+ Nick user _ -> TargetUser (userNick user)+ Mode _ tgt _ | tgt == me -> TargetNetwork+ | otherwise -> TargetWindow tgt+ Join _ chan -> TargetWindow chan+ Part _ chan _ -> TargetWindow chan+ Quit user _ -> TargetUser (userNick user)+ Kick _ chan _ _ -> TargetWindow chan+ Topic _ chan _ -> TargetWindow chan+ Privmsg src tgt _ -> directed src tgt+ Ctcp src tgt _ _ -> directed src tgt+ CtcpNotice src tgt _ _ -> directed src tgt+ Notice src tgt _ -> directed src tgt+ Authenticate{} -> TargetHidden+ Ping{} -> TargetHidden+ Pong{} -> TargetHidden+ Error{} -> TargetNetwork+ Cap{} -> TargetNetwork+ Reply code args -> replyTarget code args+ BatchStart{} -> TargetHidden+ BatchEnd{} -> TargetHidden+ where+ directed src tgt+ | Text.null (userHost src) = TargetNetwork -- server message+ | tgt == me = TargetWindow (userNick src)+ | otherwise = TargetWindow tgt+ where+ src' = userNick src++ replyTarget RPL_TOPIC (_:chan:_) = TargetWindow (mkId chan)+ replyTarget RPL_INVITING (_:_:chan:_) = TargetWindow (mkId chan)+ replyTarget _ _ = TargetNetwork -- | 'UserInfo' of the user responsible for a message. msgActor :: IrcMsg -> Maybe UserInfo
src/Irc/RawIrcMsg.hs view
@@ -255,9 +255,9 @@ <> Text.encodeUtf8Builder (renderUserInfo u) <> Builder.char8 ' ' --- | Build concatenate a list of parameters into a single, space---- delimited bytestring. Use a colon for the last parameter if it contains--- a colon or a space.+-- | Concatenate a list of parameters into a single, space-delimited+-- bytestring. Use a colon for the last parameter if it starts with+-- a colon or contains a space. buildParams :: [Text] -> Builder buildParams [x] | " " `Text.isInfixOf` x || ":" `Text.isPrefixOf` x