Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data ClientMessage
- newClientMessage :: MonadIO m => ClientMessageType -> Text -> m ClientMessage
- cmDate :: Lens' ClientMessage ServerTime
- cmType :: Lens' ClientMessage ClientMessageType
- cmText :: Lens' ClientMessage Text
- data ClientMessageType
- data Attachment
- mkAttachment :: Text -> Text -> FileId -> Attachment
- attachmentName :: Lens' Attachment Text
- attachmentFileId :: Lens' Attachment FileId
- attachmentURL :: Lens' Attachment Text
- data ClientPostType
- = NormalPost
- | Emote
- | Join
- | Leave
- | TopicChange
- data ClientPost
- toClientPost :: Text -> Maybe TeamBaseURL -> Post -> Maybe PostId -> ClientPost
- cpUserOverride :: Lens' ClientPost (Maybe Text)
- cpMarkdownSource :: Lens' ClientPost Text
- cpUser :: Lens' ClientPost (Maybe UserId)
- cpText :: Lens' ClientPost Blocks
- cpType :: Lens' ClientPost ClientPostType
- cpReactions :: Lens' ClientPost (Map Text (Set UserId))
- cpPending :: Lens' ClientPost Bool
- cpOriginalPost :: Lens' ClientPost Post
- cpFromWebhook :: Lens' ClientPost Bool
- cpInReplyToPost :: Lens' ClientPost (Maybe PostId)
- cpDate :: Lens' ClientPost ServerTime
- cpChannelId :: Lens' ClientPost ChannelId
- cpAttachments :: Lens' ClientPost (Seq Attachment)
- cpDeleted :: Lens' ClientPost Bool
- cpPostId :: Lens' ClientPost PostId
- cpPinned :: Lens' ClientPost Bool
- unEmote :: ClientPostType -> Text -> Text
- postIsLeave :: Post -> Bool
- postIsJoin :: Post -> Bool
- postIsTopicChange :: Post -> Bool
- postIsEmote :: Post -> Bool
Documentation
data ClientMessage Source #
A ClientMessage
is a message given to us by our client,
like help text or an error message.
Instances
Show ClientMessage Source # | |
Defined in Matterhorn.Types.Posts showsPrec :: Int -> ClientMessage -> ShowS # show :: ClientMessage -> String # showList :: [ClientMessage] -> ShowS # |
newClientMessage :: MonadIO m => ClientMessageType -> Text -> m ClientMessage Source #
Create a new ClientMessage
value. This is a message generated
by this Matterhorn client and not by (or visible to) the Server.
These should be visible, but not necessarily integrated into any
special position in the output stream (i.e., they should generally
appear at the bottom of the messages display, but subsequent
messages should follow them), so this is a special place where
there is an assumed approximation of equality between local time
and server time.
data ClientMessageType Source #
We format ClientMessage
values differently depending on
their ClientMessageType
Informative | |
Error | |
DateTransition | |
NewMessagesTransition | |
UnknownGapBefore | a region where the server may have messages before the given timestamp that are not known locally by this client |
UnknownGapAfter | a region where server may have messages after the given timestamp that are not known locally by this client |
Instances
Show ClientMessageType Source # | |
Defined in Matterhorn.Types.Posts showsPrec :: Int -> ClientMessageType -> ShowS # show :: ClientMessageType -> String # showList :: [ClientMessageType] -> ShowS # | |
Eq ClientMessageType Source # | |
Defined in Matterhorn.Types.Posts (==) :: ClientMessageType -> ClientMessageType -> Bool # (/=) :: ClientMessageType -> ClientMessageType -> Bool # |
data Attachment Source #
An attachment has a very long URL associated, as well as an actual file URL
Instances
Show Attachment Source # | |
Defined in Matterhorn.Types.Posts showsPrec :: Int -> Attachment -> ShowS # show :: Attachment -> String # showList :: [Attachment] -> ShowS # | |
Eq Attachment Source # | |
Defined in Matterhorn.Types.Posts (==) :: Attachment -> Attachment -> Bool # (/=) :: Attachment -> Attachment -> Bool # |
mkAttachment :: Text -> Text -> FileId -> Attachment Source #
data ClientPostType Source #
A Mattermost Post
value can represent either a normal
chat message or one of several special events.
Instances
Show ClientPostType Source # | |
Defined in Matterhorn.Types.Posts showsPrec :: Int -> ClientPostType -> ShowS # show :: ClientPostType -> String # showList :: [ClientPostType] -> ShowS # | |
Eq ClientPostType Source # | |
Defined in Matterhorn.Types.Posts (==) :: ClientPostType -> ClientPostType -> Bool # (/=) :: ClientPostType -> ClientPostType -> Bool # |
data ClientPost Source #
A ClientPost
is a temporary internal representation of
the Mattermost Post
type, with unnecessary information
removed and some preprocessing done.
Instances
Show ClientPost Source # | |
Defined in Matterhorn.Types.Posts showsPrec :: Int -> ClientPost -> ShowS # show :: ClientPost -> String # showList :: [ClientPost] -> ShowS # |
toClientPost :: Text -> Maybe TeamBaseURL -> Post -> Maybe PostId -> ClientPost Source #
Convert a Mattermost Post
to a ClientPost
, passing in a
ParentId
if it has a known one.
cpReactions :: Lens' ClientPost (Map Text (Set UserId)) Source #