irc-core 2.0.0.0 → 2.1.0.0
raw patch · 3 files changed
+21/−1 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Irc.Message: BatchEnd :: Text -> IrcMsg
+ Irc.Message: BatchStart :: Text -> Text -> [Text] -> IrcMsg
Files
- ChangeLog.md +4/−0
- irc-core.cabal +1/−1
- src/Irc/Message.hs +16/−0
ChangeLog.md view
@@ -1,5 +1,9 @@ # Revision history for irc-core +## 2.1.0.0 -- 2016-08-13++* Add BatchStart and BatchEnd messages+ ## 2.0.0.0 -- 2016-08-08 * Extracted from glirc-2.5
irc-core.cabal view
@@ -1,5 +1,5 @@ name: irc-core-version: 2.0.0.0+version: 2.1.0.0 synopsis: IRC core library for glirc description: IRC core library for glirc .
src/Irc/Message.hs view
@@ -62,6 +62,8 @@ | Ping [Text] -- ^ parameters | Pong [Text] -- ^ parameters | Error !Text -- ^ message+ | BatchStart Text Text [Text] -- ^ reference-id type parameters+ | BatchEnd Text -- ^ reference-id deriving Show -- | Sub-commands of the CAP command@@ -147,6 +149,14 @@ "ERROR" | [reason] <- view msgParams msg -> Error reason + "BATCH" | refid : ty : params <- view msgParams msg+ , Just ('+',refid') <- Text.uncons refid ->+ BatchStart refid' ty params++ "BATCH" | [refid] <- view msgParams msg+ , Just ('-',refid') <- Text.uncons refid ->+ BatchEnd refid'+ _ -> UnknownMsg msg -- | Parse a CTCP encoded message:@@ -195,6 +205,8 @@ Error{} -> TargetNetwork Cap{} -> TargetNetwork Reply{} -> TargetNetwork+ BatchStart{} -> TargetHidden+ BatchEnd{} -> TargetHidden -- | 'UserInfo' of the user responsible for a message. msgActor :: IrcMsg -> Maybe UserInfo@@ -218,6 +230,8 @@ Pong{} -> Nothing Error{} -> Nothing Cap{} -> Nothing+ BatchStart{} -> Nothing+ BatchEnd{} -> Nothing -- | Text representation of an IRC message to be used for matching with -- regular expressions.@@ -242,6 +256,8 @@ Cap _ xs -> Text.unwords xs Error t -> t Authenticate{} -> ""+ BatchStart{} -> ""+ BatchEnd{} -> "" -- nickname = ( letter / special ) *8( letter / digit / special / "-" ) -- letter = %x41-5A / %x61-7A ; A-Z / a-z