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

Matterhorn.State.Channels

Synopsis

Documentation

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. Note that this does not actually hide the channel in our UI; we hide it in response to the preference change websocket event triggered by this function's API interaction with the server.

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 :: TeamId -> 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 :: TeamId -> Text -> MH () Source #

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

renameChannelUrl :: TeamId -> Text -> MH () Source #

This renames the current channel's url name. It makes a request to the server to change the name, but does not actually change the name in Matterhorn yet; that is handled by a websocket event handled asynchronously.