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

Matterhorn.Types.EditState

Synopsis

Documentation

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

Instances details
Eq EditMode Source # 
Instance details

Defined in Matterhorn.Types.EditState

Show EditMode Source # 
Instance details

Defined in Matterhorn.Types.EditState

data AutocompletionType Source #

The type of data that the autocompletion logic supports. We use this to track the kind of completion underway in case the type of completion needs to change.

data CompletionSource Source #

The source of an autocompletion alternative.

Constructors

Server 
Client 

data SpecialMention Source #

A "special" mention that does not map to a specific user, but is an alias that the server uses to notify users.

Constructors

MentionAll

@all: notify everyone in the channel.

MentionChannel

@channel: notify everyone in the channel.

data EditState n Source #

The EditState value contains the editor widget itself as well as history and metadata we need for editing-related operations.

Constructors

EditState 

Fields

newEditState :: n -> n -> Maybe TeamId -> ChannelId -> EditMode -> Bool -> Maybe (IO ()) -> EditState n Source #

esEditor :: forall n. Lens' (EditState n) (Editor Text n) Source #

data EphemeralEditState Source #

Constructors

EphemeralEditState 

Fields

addEphemeralStateTypingUser :: UserId -> UTCTime -> EphemeralEditState -> EphemeralEditState Source #

Add user to the list of users in this state who are currently typing.

data AutocompleteState n Source #

Constructors

AutocompleteState 

Fields

  • _acPreviousSearchString :: Text

    The search string used for the currently-displayed autocomplete results, for use in deciding whether to issue another server query

  • _acCompletionList :: List n AutocompleteAlternative

    The list of alternatives that the user selects from

  • _acType :: AutocompletionType

    The type of data that we're completing

  • _acCachedResponses :: HashMap Text [AutocompleteAlternative]

    A cache of alternative lists, keyed on search string, for use in avoiding server requests. The idea here is that users type quickly enough (and edit their input) that would normally lead to rapid consecutive requests, some for the same strings during editing, that we can avoid that by caching them here. Note that this cache gets destroyed whenever autocompletion is not on, so this cache does not live very long.

data AutocompleteAlternative Source #

Constructors

UserCompletion User Bool

User, plus whether the user is in the channel that triggered the autocomplete

SpecialMention SpecialMention

A special mention.

ChannelCompletion Bool Channel

Channel, plus whether the user is a member of the channel

SyntaxCompletion Text

Name of a skylighting syntax definition

CommandCompletion CompletionSource Text Text Text

Source, name of a slash command, argspec, and description

EmojiCompletion Text

The text of an emoji completion