Safe Haskell | None |
---|---|
Language | Haskell2010 |
Capability negotiation as per IRCv3 spec. Based on v3.1 http://ircv3.net/specs/core/capability-negotiation-3.1.html and v3.2 http://ircv3.net/specs/core/capability-negotiation-3.2.html.
Synopsis
- type Identifier = Either (Unused "*") Text
- type Subcommand = Unused
- data CapModifier
- = ModDisable
- | ModAck
- | ModSticky
- | ModNone
- _ModDisable :: Prism' CapModifier ()
- _ModAck :: Prism' CapModifier ()
- _ModSticky :: Prism' CapModifier ()
- _ModNone :: Prism' CapModifier ()
- data Capability = Capability CapModifier Text
- modifier :: Lens' Capability CapModifier
- capability :: Lens' Capability Text
- data ReqAnswer
- _Ack :: Prism' ReqAnswer ()
- _Nak :: Prism' ReqAnswer ()
- type ErrInvalidcap = Msg "410" [Identifier, Text, Message]
- errInvalidcapIdentifier :: Lens' ErrInvalidcap Identifier
- errInvalidcapCommand :: Lens' ErrInvalidcap Text
- errInvalidcapMessage :: Lens' ErrInvalidcap Message
- type CapLs = Msg "CAP LS" '[Flag "302"]
- capLs302 :: Lens' CapLs (Flag "302")
- type SrvCapLs = Msg "CAP" '[Identifier, Subcommand "LS", Flag "*", CList Capability]
- srvCapLsIdentifier :: Lens' SrvCapLs Identifier
- srvCapLsMultiLine :: Lens' SrvCapLs (Flag "*")
- srvCapLsCapabilities :: Lens' SrvCapLs [Capability]
- type CapList = Msg "CAP LIST" '[]
- type SrvCapList = Msg "CAP" '[Identifier, Subcommand "LIST", Flag "*", CList Capability]
- srvCapListIdentifier :: Lens' SrvCapList Identifier
- srvCapListMultiLine :: Lens' SrvCapList (Flag "*")
- srvCapListCapabilities :: Lens' SrvCapList [Capability]
- type CapReq = Msg "CAP REQ" '[CList Capability]
- capReqCapabilities :: Lens' CapReq [Capability]
- type SrvCapReq = Msg "CAP" '[Identifier, ReqAnswer, CList Capability]
- srvCapReqIdentifier :: Lens' SrvCapReq Identifier
- srvCapReqAnswer :: Lens' SrvCapReq ReqAnswer
- srvCapReqCapabilities :: Lens' SrvCapReq [Capability]
- type CapAck = Msg "CAP ACK" '[CList Capability]
- capAckCapabilities :: Lens' CapAck [Capability]
- type CapEnd = Msg "CAP END" '[]
- type SrvCapNew = Msg "CAP" '[Identifier, Subcommand "NEW", CList Capability]
- srvCapNewIdentifier :: Lens' SrvCapNew Identifier
- srvCapNewCapabilities :: Lens' SrvCapNew [Capability]
- type SrvCapDel = Msg "CAP" '[Identifier, Subcommand "DEL", CList Capability]
- srvCapDelIdentifier :: Lens' SrvCapDel Identifier
- srvCapDelCapabilities :: Lens' SrvCapDel [Capability]
Documentation
type Subcommand = Unused Source #
data CapModifier Source #
ModDisable | |
ModAck | Deprecated as of v3.2 |
ModSticky | Deprecated as of v3.2 |
ModNone |
Instances
Eq CapModifier Source # | |
Defined in Network.Yak.Capabilities (==) :: CapModifier -> CapModifier -> Bool # (/=) :: CapModifier -> CapModifier -> Bool # | |
Ord CapModifier Source # | |
Defined in Network.Yak.Capabilities compare :: CapModifier -> CapModifier -> Ordering # (<) :: CapModifier -> CapModifier -> Bool # (<=) :: CapModifier -> CapModifier -> Bool # (>) :: CapModifier -> CapModifier -> Bool # (>=) :: CapModifier -> CapModifier -> Bool # max :: CapModifier -> CapModifier -> CapModifier # min :: CapModifier -> CapModifier -> CapModifier # | |
Read CapModifier Source # | |
Defined in Network.Yak.Capabilities readsPrec :: Int -> ReadS CapModifier # readList :: ReadS [CapModifier] # readPrec :: ReadPrec CapModifier # readListPrec :: ReadPrec [CapModifier] # | |
Show CapModifier Source # | |
Defined in Network.Yak.Capabilities showsPrec :: Int -> CapModifier -> ShowS # show :: CapModifier -> String # showList :: [CapModifier] -> ShowS # |
_ModDisable :: Prism' CapModifier () Source #
_ModAck :: Prism' CapModifier () Source #
_ModSticky :: Prism' CapModifier () Source #
_ModNone :: Prism' CapModifier () Source #
data Capability Source #
Instances
Invalid Capabilities
type ErrInvalidcap = Msg "410" [Identifier, Text, Message] Source #
410 * <command> :Invalid CAP command
Capability Messages
LS
type CapLs = Msg "CAP LS" '[Flag "302"] Source #
The LS subcommand is used to list the capabilities supported by the server. The client should send an LS subcommand with no other arguments to solicit a list of all capabilities.
Since v3.2, LS can be invoked with a 302 flag.
type SrvCapLs = Msg "CAP" '[Identifier, Subcommand "LS", Flag "*", CList Capability] Source #
All but the last line in multi-line responses must have the * enabled.
LIST
type CapList = Msg "CAP LIST" '[] Source #
The LIST subcommand is used to list the capabilities associated with the active connection. The client should send a LIST subcommand with no other arguments to solicit a list of active capabilities. If no capabilities are active, an empty parameter must be sent.
type SrvCapList = Msg "CAP" '[Identifier, Subcommand "LIST", Flag "*", CList Capability] Source #
All but the last line in multi-line responses must have the * enabled.
srvCapListMultiLine :: Lens' SrvCapList (Flag "*") Source #
REQ
type CapReq = Msg "CAP REQ" '[CList Capability] Source #
The REQ subcommand is used to request a change in capabilities associated with the active connection. It’s sole parameter must be a list of space-separated capability identifiers. Each capability identifier may be prefixed with a dash (-) to designate that the capability should be disabled.
type SrvCapReq = Msg "CAP" '[Identifier, ReqAnswer, CList Capability] Source #
type CapEnd = Msg "CAP END" '[] Source #
The END subcommand signals to the server that capability negotiation is complete and requests that the server continue with client registration.
NEW/DEL
type SrvCapNew = Msg "CAP" '[Identifier, Subcommand "NEW", CList Capability] Source #
type SrvCapDel = Msg "CAP" '[Identifier, Subcommand "DEL", CList Capability] Source #