Copyright | (c) Eric Mertens 2016 |
---|---|
License | ISC |
Maintainer | emertens@gmail.com |
Safe Haskell | None |
Language | Haskell2010 |
This module is responsible for tracking the state of an individual IRC channel while the client is connected to it. When the client joins a channel a new channel session is created and when the client leaves a channel is it destroyed.
- data ChannelState = ChannelState {
- _chanTopic :: !Text
- _chanTopicProvenance :: !(Maybe TopicProvenance)
- _chanUrl :: !(Maybe Text)
- _chanUsers :: !(HashMap Identifier String)
- _chanModes :: !(Map Char Text)
- _chanLists :: !(Map Char (HashMap Text MaskListEntry))
- _chanCreation :: !(Maybe UTCTime)
- _chanQueuedModeration :: ![RawIrcMsg]
- chanTopic :: Lens' ChannelState Text
- chanTopicProvenance :: Lens' ChannelState (Maybe TopicProvenance)
- chanUrl :: Lens' ChannelState (Maybe Text)
- chanUsers :: Lens' ChannelState (HashMap Identifier String)
- chanModes :: Lens' ChannelState (Map Char Text)
- chanLists :: Lens' ChannelState (Map Char (HashMap Text MaskListEntry))
- chanCreation :: Lens' ChannelState (Maybe UTCTime)
- chanQueuedModeration :: Lens' ChannelState [RawIrcMsg]
- data MaskListEntry = MaskListEntry {
- _maskListSetter :: !Text
- _maskListTime :: !UTCTime
- maskListSetter :: Lens' MaskListEntry Text
- maskListTime :: Lens' MaskListEntry UTCTime
- data TopicProvenance = TopicProvenance {
- _topicAuthor :: !UserInfo
- _topicTime :: !UTCTime
- topicAuthor :: Lens' TopicProvenance UserInfo
- topicTime :: Lens' TopicProvenance UTCTime
- newChannel :: ChannelState
- setTopic :: Text -> ChannelState -> ChannelState
- joinChannel :: Identifier -> ChannelState -> ChannelState
- partChannel :: Identifier -> ChannelState -> ChannelState
- nickChange :: Identifier -> Identifier -> ChannelState -> ChannelState
Channel state
data ChannelState Source #
Dynamic information about the state of an IRC channel
ChannelState | |
|
chanLists :: Lens' ChannelState (Map Char (HashMap Text MaskListEntry)) Source #
Mask list entries
data MaskListEntry Source #
Topic information
data TopicProvenance Source #
Channel manipulation
newChannel :: ChannelState Source #
Construct an empty ChannelState
setTopic :: Text -> ChannelState -> ChannelState Source #
Set the channel topic
joinChannel :: Identifier -> ChannelState -> ChannelState Source #
Add a user to the user list
partChannel :: Identifier -> ChannelState -> ChannelState Source #
Remove a user from the user list
nickChange :: Identifier -> Identifier -> ChannelState -> ChannelState Source #
Rename a user in the user list