matterhorn-50200.11.0: Terminal client for the Mattermost chat system

Safe HaskellNone
LanguageHaskell2010

Matterhorn.State.Channels

Synopsis

Documentation

updateViewedChan :: Bool -> ChannelId -> MH () Source #

When a new channel has been selected for viewing, this will notify the server of the change, and also update the local channel state to set the last-viewed time for the previous channel and update the viewed time to now for the newly selected channel.

The boolean argument indicates whether the view time of the previous channel (if any) should be updated, too. We typically want to do that only on channel switching; when we just want to update the view time of the specified channel, False should be provided.

refreshChannel :: SidebarUpdate -> Channel -> ChannelMember -> MH () Source #

Refresh information about a specific channel. The channel metadata is refreshed, and if this is a loaded channel, the scrollback is updated as well.

The sidebar update argument indicates whether this refresh should also update the sidebar. Ordinarily you want this, so pass SidebarUpdateImmediate unless you are very sure you know what you are doing, i.e., you are very sure that a call to refreshChannel will be followed immediately by a call to updateSidebar. We provide this control so that channel refreshes can be batched and then a single updateSidebar call can be used instead of the default behavior of calling it once per refreshChannel call, which is the behavior if the immediate setting is passed here.

refreshChannelsAndUsers :: MH () Source #

Refresh information about all channels and users. This is usually triggered when a reconnect event for the WebSocket to the server occurs.

hideDMChannel :: ChannelId -> MH () Source #

If the current channel is a DM channel with a single user or a group of users, hide it from the sidebar and adjust the server-side preference to hide it persistently.

If the current channel is any other kind of channel, complain with a usage error.

handleChannelInvite :: ChannelId -> MH () Source #

When we are added to a channel not locally known about, we need to fetch the channel info for that channel.

joinChannel :: ChannelId -> MH () Source #

If the user is not a member of the specified channel, submit a request to join it. Otherwise switch to the channel.

changeChannelByName :: Text -> MH () Source #

This switches to the named channel or creates it if it is a missing but valid user channel.