Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data ClientChannel = ClientChannel {}
- 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
- _cdDMUserId :: Maybe UserId
- _cdSidebarShowOverride :: Maybe UTCTime
- _cdFetchPending :: Bool
- _cdTotalMessageCount :: Int
- _cdViewedMessageCount :: Int
- data ClientChannels
- chanMap :: Lens' ClientChannels (HashMap ChannelId ClientChannel)
- data NewMessageIndicator
- ccInfo :: Lens' ClientChannel ChannelInfo
- ccMessageInterface :: Lens' ClientChannel (MessageInterface Name ())
- 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
- cdDMUserId :: Lens' ChannelInfo (Maybe UserId)
- cdChannelId :: Lens' ChannelInfo ChannelId
- cdSidebarShowOverride :: Lens' ChannelInfo (Maybe UTCTime)
- cdNotifyProps :: Lens' ChannelInfo ChannelNotifyProps
- cdTeamId :: Lens' ChannelInfo (Maybe TeamId)
- cdFetchPending :: Lens' ChannelInfo Bool
- cdTotalMessageCount :: Lens' ChannelInfo Int
- cdViewedMessageCount :: Lens' ChannelInfo Int
- 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
- incrementTotalMessageCount :: ClientChannel -> ClientChannel
- incrementViewedMessageCount :: 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
- emptyChannelMessages :: MonadIO m => m Messages
Documentation
data ClientChannel Source #
A ClientChannel
contains both the message
listing and the metadata about a channel
ClientChannel | |
|
data ChannelInfo Source #
The ChannelInfo
record represents metadata
about a channel
ChannelInfo | |
|
data ClientChannels Source #
Instances
Monoid ClientChannels Source # | |
Defined in Matterhorn.Types.Channels mappend :: ClientChannels -> ClientChannels -> ClientChannels # mconcat :: [ClientChannels] -> ClientChannels # | |
Semigroup ClientChannels Source # | |
Defined in Matterhorn.Types.Channels (<>) :: ClientChannels -> ClientChannels -> ClientChannels # sconcat :: NonEmpty ClientChannels -> ClientChannels # stimes :: Integral b => b -> ClientChannels -> ClientChannels # |
data NewMessageIndicator Source #
Instances
Show NewMessageIndicator Source # | |
Defined in Matterhorn.Types.Channels showsPrec :: Int -> NewMessageIndicator -> ShowS # show :: NewMessageIndicator -> String # showList :: [NewMessageIndicator] -> ShowS # | |
Eq NewMessageIndicator Source # | |
Defined in Matterhorn.Types.Channels (==) :: NewMessageIndicator -> NewMessageIndicator -> Bool # (/=) :: NewMessageIndicator -> NewMessageIndicator -> Bool # |
Lenses created for accessing ClientChannel fields
Lenses created for accessing ChannelInfo fields
cdDMUserId :: Lens' ChannelInfo (Maybe UserId) 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.
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 #
emptyChannelMessages :: MonadIO m => m Messages Source #
An initial empty channel message list. This also contains an UnknownGapBefore, which is a signal that causes actual content fetching. The initial Gap's timestamp is the local client time, but subsequent fetches will synchronize with the server (and eventually eliminate this Gap as well).