matterhorn-50200.17.0: Terminal client for the Mattermost chat system
Safe HaskellNone
LanguageHaskell2010

Matterhorn.Types.Channels

Synopsis

Documentation

data ClientChannel Source #

A ClientChannel contains both the message listing and the metadata about a channel

Constructors

ClientChannel 

Fields

data ChannelInfo Source #

The ChannelInfo record represents metadata about a channel

Constructors

ChannelInfo 

Fields

Lenses created for accessing ClientChannel fields

Lenses created for accessing ChannelInfo fields

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

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

Miscellaneous channel-related operations

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.

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).