Safe Haskell | None |
---|---|
Language | Haskell2010 |
- Lenses created for accessing ClientChannel fields
- Lenses created for accessing ChannelInfo fields
- Lenses created for accessing ChannelContents fields
- Creating ClientChannel objects
- Managing ClientChannel collections
- Creating ChannelInfo objects
- Channel State management
- Notification settings
- Miscellaneous channel-related operations
Synopsis
- data ClientChannel = ClientChannel {}
- data ChannelContents = ChannelContents {}
- data ChannelInfo = ChannelInfo {
- _cdChannelId :: ChannelId
- _cdTeamId :: Maybe TeamId
- _cdViewed :: Maybe ServerTime
- _cdNewMessageIndicator :: NewMessageIndicator
- _cdEditedMessageThreshold :: Maybe ServerTime
- _cdMentionCount :: Int
- _cdUpdated :: ServerTime
- _cdName :: Text
- _cdDisplayName :: Text
- _cdHeader :: Text
- _cdPurpose :: Text
- _cdType :: Type
- _cdNotifyProps :: ChannelNotifyProps
- _cdTypingUsers :: TypingUsers
- _cdDMUserId :: Maybe UserId
- _cdSidebarShowOverride :: Maybe UTCTime
- type ClientChannels = AllMyChannels ClientChannel
- data NewMessageIndicator
- data EphemeralEditState = EphemeralEditState {}
- data EditMode
- eesMultiline :: Lens' EphemeralEditState Bool
- eesInputHistoryPosition :: Lens' EphemeralEditState (Maybe Int)
- eesLastInput :: Lens' EphemeralEditState (Text, EditMode)
- defaultEphemeralEditState :: EphemeralEditState
- ccContents :: Lens' ClientChannel ChannelContents
- ccInfo :: Lens' ClientChannel ChannelInfo
- ccEditState :: Lens' ClientChannel EphemeralEditState
- cdViewed :: Lens' ChannelInfo (Maybe ServerTime)
- cdNewMessageIndicator :: Lens' ChannelInfo NewMessageIndicator
- cdEditedMessageThreshold :: Lens' ChannelInfo (Maybe ServerTime)
- cdUpdated :: Lens' ChannelInfo ServerTime
- cdName :: Lens' ChannelInfo Text
- cdDisplayName :: Lens' ChannelInfo Text
- cdHeader :: Lens' ChannelInfo Text
- cdPurpose :: Lens' ChannelInfo Text
- cdType :: Lens' ChannelInfo Type
- cdMentionCount :: Lens' ChannelInfo Int
- cdTypingUsers :: Lens' ChannelInfo TypingUsers
- cdDMUserId :: Lens' ChannelInfo (Maybe UserId)
- cdChannelId :: Lens' ChannelInfo ChannelId
- cdSidebarShowOverride :: Lens' ChannelInfo (Maybe UTCTime)
- cdNotifyProps :: Lens' ChannelInfo ChannelNotifyProps
- cdTeamId :: Lens' ChannelInfo (Maybe TeamId)
- cdMessages :: Lens' ChannelContents Messages
- cdFetchPending :: Lens' ChannelContents Bool
- makeClientChannel :: MonadIO m => UserId -> Channel -> m ClientChannel
- noChannels :: ClientChannels
- addChannel :: ChannelId -> ClientChannel -> ClientChannels -> ClientChannels
- removeChannel :: ChannelId -> ClientChannels -> ClientChannels
- findChannelById :: ChannelId -> ClientChannels -> Maybe ClientChannel
- modifyChannelById :: ChannelId -> (ClientChannel -> ClientChannel) -> ClientChannels -> ClientChannels
- channelByIdL :: ChannelId -> Traversal' ClientChannels ClientChannel
- maybeChannelByIdL :: ChannelId -> Lens' ClientChannels (Maybe ClientChannel)
- allTeamIds :: ClientChannels -> [TeamId]
- filteredChannelIds :: (ClientChannel -> Bool) -> ClientChannels -> [ChannelId]
- filteredChannels :: ((ChannelId, ClientChannel) -> Bool) -> ClientChannels -> [(ChannelId, ClientChannel)]
- channelInfoFromChannelWithData :: Channel -> ChannelMember -> ChannelInfo -> ChannelInfo
- clearNewMessageIndicator :: ClientChannel -> ClientChannel
- clearEditedThreshold :: ClientChannel -> ClientChannel
- adjustUpdated :: Post -> ClientChannel -> ClientChannel
- adjustEditedThreshold :: Post -> ClientChannel -> ClientChannel
- updateNewMessageIndicator :: Post -> ClientChannel -> ClientChannel
- addChannelTypingUser :: UserId -> UTCTime -> ClientChannel -> ClientChannel
- notifyPreference :: User -> ClientChannel -> NotifyOption
- isMuted :: ClientChannel -> Bool
- channelNotifyPropsMarkUnreadL :: Lens' ChannelNotifyProps (WithDefault NotifyOption)
- channelNotifyPropsIgnoreChannelMentionsL :: Lens' ChannelNotifyProps (WithDefault Bool)
- channelNotifyPropsDesktopL :: Lens' ChannelNotifyProps (WithDefault NotifyOption)
- channelNotifyPropsPushL :: Lens' ChannelNotifyProps (WithDefault NotifyOption)
- canLeaveChannel :: ChannelInfo -> Bool
- preferredChannelName :: Channel -> Text
- isTownSquare :: Channel -> Bool
- channelDeleted :: Channel -> Bool
- getDmChannelFor :: UserId -> ClientChannels -> Maybe ChannelId
- allDmChannelMappings :: ClientChannels -> [(UserId, ChannelId)]
- getChannelNameSet :: TeamId -> ClientChannels -> Set Text
Documentation
data ClientChannel Source #
A ClientChannel
contains both the message
listing and the metadata about a channel
ClientChannel | |
|
data ChannelContents Source #
The ChannelContents
is a wrapper for a list of
Message
values
data ChannelInfo Source #
The ChannelInfo
record represents metadata
about a channel
ChannelInfo | |
|
type ClientChannels = AllMyChannels ClientChannel Source #
Define the exported typename which universally binds the collection to the ChannelInfo type.
data NewMessageIndicator Source #
Instances
Eq NewMessageIndicator Source # | |
Defined in Matterhorn.Types.Channels (==) :: NewMessageIndicator -> NewMessageIndicator -> Bool # (/=) :: NewMessageIndicator -> NewMessageIndicator -> Bool # | |
Show NewMessageIndicator Source # | |
Defined in Matterhorn.Types.Channels showsPrec :: Int -> NewMessageIndicator -> ShowS # show :: NewMessageIndicator -> String # showList :: [NewMessageIndicator] -> ShowS # |
data EphemeralEditState Source #
EphemeralEditState | |
|
The input state associated with the message editor.
Lenses created for accessing ClientChannel fields
Lenses created for accessing ChannelInfo fields
cdDMUserId :: Lens' ChannelInfo (Maybe UserId) Source #
Lenses created for accessing ChannelContents fields
Creating ClientChannel objects
makeClientChannel :: MonadIO m => UserId -> Channel -> m ClientChannel Source #
Managing ClientChannel collections
noChannels :: ClientChannels Source #
Initial collection of Channels with no members
addChannel :: ChannelId -> ClientChannel -> ClientChannels -> ClientChannels Source #
Add a channel to the existing collection.
removeChannel :: ChannelId -> ClientChannels -> ClientChannels Source #
Remove a channel from the collection.
findChannelById :: ChannelId -> ClientChannels -> Maybe ClientChannel Source #
Get the ChannelInfo information given the ChannelId
modifyChannelById :: ChannelId -> (ClientChannel -> ClientChannel) -> ClientChannels -> ClientChannels Source #
Transform the specified channel in place with provided function.
channelByIdL :: ChannelId -> Traversal' ClientChannels ClientChannel Source #
A Traversal
that will give us the ClientChannel
in a
ClientChannels
structure if it exists
maybeChannelByIdL :: ChannelId -> Lens' ClientChannels (Maybe ClientChannel) Source #
A Lens
that will give us the ClientChannel
in a
ClientChannels
wrapped in a Maybe
allTeamIds :: ClientChannels -> [TeamId] Source #
Get all the team IDs in the channel collection.
filteredChannelIds :: (ClientChannel -> Bool) -> ClientChannels -> [ChannelId] Source #
Apply a filter to each ClientChannel and return a list of the ChannelId values for which the filter matched.
filteredChannels :: ((ChannelId, ClientChannel) -> Bool) -> ClientChannels -> [(ChannelId, ClientChannel)] Source #
Filter the ClientChannel collection, keeping only those for which the provided filter test function returns True.
Creating ChannelInfo objects
Channel State management
clearNewMessageIndicator :: ClientChannel -> ClientChannel Source #
Clear the new message indicator for the specified channel
clearEditedThreshold :: ClientChannel -> ClientChannel Source #
Clear the edit threshold for the specified channel
adjustUpdated :: Post -> ClientChannel -> ClientChannel Source #
Adjust updated time based on a message, ensuring that the updated time does not move backward.
addChannelTypingUser :: UserId -> UTCTime -> ClientChannel -> ClientChannel Source #
Add user to the list of users in this channel who are currently typing.
Notification settings
notifyPreference :: User -> ClientChannel -> NotifyOption Source #
isMuted :: ClientChannel -> Bool Source #
Miscellaneous channel-related operations
canLeaveChannel :: ChannelInfo -> Bool Source #
preferredChannelName :: Channel -> Text Source #
isTownSquare :: Channel -> Bool Source #
Town Square is special in that its non-display name cannot be changed and is a hard-coded constant server-side according to the developers (as of 8217). So this is a reliable way to check for whether a channel is in fact that channel, even if the user has changed its display name.
channelDeleted :: Channel -> Bool Source #
getDmChannelFor :: UserId -> ClientChannels -> Maybe ChannelId Source #
allDmChannelMappings :: ClientChannels -> [(UserId, ChannelId)] Source #
getChannelNameSet :: TeamId -> ClientChannels -> Set Text Source #