packages feed

irc-core 2.12 → 2.13

raw patch · 4 files changed

+38/−9 lines, 4 filesdep ~basedep ~hashabledep ~timePVP ok

version bump matches the API change (PVP)

Dependency ranges changed: base, hashable, time

API changes (from Hackage documentation)

- Irc.Message: TargetExisting :: !Identifier -> MessageTarget
+ Irc.Commands: ircHelp :: Text -> RawIrcMsg
+ Irc.Commands: ircNames :: Identifier -> RawIrcMsg
+ Irc.Message: Tagmsg :: !Source -> !Identifier -> IrcMsg
+ Irc.Message: isNickChar :: Char -> Bool

Files

ChangeLog.md view
@@ -1,5 +1,10 @@ # Revision history for irc-core +## 2.13++* Added constructors for TAGMSG from messages-tags+* Removed `TargetExisting` (added in 2.12 as part of AWAY handling)+ ## 2.12  * Added constructors for AWAY
irc-core.cabal view
@@ -1,6 +1,6 @@ cabal-version:       3.0 name:                irc-core-version:             2.12+version:             2.13 synopsis:            IRC core library for glirc description:         IRC core library for glirc                      .@@ -15,7 +15,7 @@ extra-doc-files:     ChangeLog.md homepage:            https://github.com/glguy/irc-core bug-reports:         https://github.com/glguy/irc-core/issues-tested-with:         GHC==9.4.7+tested-with:         GHC == 9.0.2, GHC == 9.4.8, GHC == 9.8.2  source-repository head   type: git@@ -33,14 +33,14 @@                        Irc.UserInfo   other-modules:       View -  build-depends:       base       >=4.11 && <4.20,+  build-depends:       base       >=4.11 && <4.21,                        base64-bytestring >= 1.0.0.1 && <1.3,                        attoparsec ^>=0.14,                        bytestring >=0.10 && <0.13,-                       hashable   >=1.2  && <1.5,+                       hashable   >=1.2  && <1.6,                        primitive  >=0.6  && <0.10,                        text       >=1.2  && <2.2,-                       time       >=1.6  && <1.13,+                       time       >=1.6  && <1.15,                        vector     >=0.11 && <0.14    hs-source-dirs:      src
src/Irc/Commands.hs view
@@ -18,6 +18,7 @@   , ircCnotice   , ircCprivmsg   , ircEtrace+  , ircHelp   , ircInfo   , ircInvite   , ircIson@@ -34,6 +35,7 @@   , ircMode   , ircMonitor   , ircMotd+  , ircNames   , ircNick   , ircNotice   , ircOper@@ -450,6 +452,18 @@   Text {- ^ username -} ->   Text {- ^ realname -} -> RawIrcMsg ircUser user real = rawIrcMsg "USER" [user, "0", "*", real]++-- | NAMES command+ircNames ::+  Identifier {- ^ channel -} ->+  RawIrcMsg+ircNames chan = rawIrcMsg "NAMES" [idText chan]++-- | HELP command+ircHelp ::+  Text {- ^ topic -} ->+  RawIrcMsg+ircHelp topic = rawIrcMsg "HELP" [topic]  -- | CAP REQ command ircCapReq ::
src/Irc/Message.hs view
@@ -28,6 +28,7 @@   , msgSource    -- * Helper functions+  , isNickChar   , nickSplit   , computeMaxMessageLength   , capCmdText@@ -75,6 +76,7 @@   | Wallops  !Source !Text -- ^ Braodcast message: Source, message   | Invite !Source !Identifier !Identifier -- ^ sender target channel   | Away !Source (Maybe Text)+  | Tagmsg !Source !Identifier -- ^ source target   deriving Show  data Source = Source { srcUser :: {-# UNPACK #-}!UserInfo, srcAcct :: !Text }@@ -213,6 +215,12 @@            , message <- view msgParams msg ->            Away source (listToMaybe message) +    "TAGMSG"+      | Just source <- msgSource msg+      , [target] <- view msgParams msg ->+      Tagmsg source (mkId target)++     _      -> UnknownMsg msg  -- | Parse a CTCP encoded message:@@ -229,7 +237,6 @@ -- | Targets used to direct a message to a window for display data MessageTarget   = TargetUser     !Identifier -- ^ Metadata update for a user-  | TargetExisting !Identifier -- ^ Directed message to window that already exists   | TargetWindow   !Identifier -- ^ Directed message to channel or from user   | TargetNetwork              -- ^ Network-level message   deriving (Show)@@ -247,7 +254,7 @@     Part _ chan _            -> TargetWindow chan     Quit user _              -> TargetUser (userNick (srcUser user))     Kick _ chan _ _          -> TargetWindow chan-    Kill _ _ _               -> TargetNetwork+    Kill{}                   -> TargetNetwork     Topic _ chan _           -> TargetWindow chan     Invite{}                 -> TargetNetwork     Privmsg src tgt _        -> directed (srcUser src) tgt@@ -265,7 +272,8 @@     Account user _           -> TargetUser (userNick (srcUser user))     Chghost user _ _         -> TargetUser (userNick (srcUser user))     Wallops _ _              -> TargetNetwork-    Away user _              -> TargetExisting (userNick (srcUser user))+    Away user _              -> TargetUser (userNick (srcUser user))+    Tagmsg src tgt           -> directed (srcUser src) tgt   where     directed src tgt       | Text.null (userHost src) = TargetNetwork -- server message@@ -308,6 +316,7 @@     Chghost x _ _ -> Just x     Wallops x _   -> Just x     Away x _      -> Just x+    Tagmsg x _    -> Just x  renderSource :: Source -> Text renderSource (Source u "") = renderUserInfo u@@ -340,11 +349,12 @@     Authenticate{} -> ""     BatchStart{}   -> ""     BatchEnd{}     -> ""-    Invite _ _ _   -> ""+    Invite{}       -> ""     Chghost x a b  -> Text.unwords [renderSource x, a, b]     Wallops x t    -> Text.unwords [renderSource x, t]     Away x (Just t) -> Text.unwords [renderSource x, "away", t]     Away x Nothing  -> Text.unwords [renderSource x, "back"]+    Tagmsg x _     -> renderSource x  capCmdText :: CapCmd -> Text capCmdText cmd =