matterhorn-50200.11.0: Terminal client for the Mattermost chat system

Safe HaskellNone
LanguageHaskell2010

Matterhorn.Types.Channels

Contents

Synopsis

Documentation

data ClientChannel Source #

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

Constructors

ClientChannel 

Fields

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

Constructors

ChannelInfo 

Fields

type ClientChannels = AllMyChannels ClientChannel Source #

Define the exported typename which universally binds the collection to the ChannelInfo type.

data EphemeralEditState Source #

Constructors

EphemeralEditState 

Fields

data EditMode Source #

The input state associated with the message editor.

Constructors

NewPost

The input is for a new post.

Editing Post MessageType

The input is ultimately to replace the body of an existing post of the specified type.

Replying Message Post

The input is to be used as a new post in reply to the specified post.

Instances
Show EditMode Source # 
Instance details

Defined in Matterhorn.Types.Channels

Lenses created for accessing ClientChannel fields

Lenses created for accessing ChannelInfo fields

Lenses created for accessing ChannelContents fields

Creating ClientChannel objects

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

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

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.