Copyright | (c) Eric Mertens, 2016 |
---|---|
License | ISC |
Maintainer | emertens@gmail.com |
Safe Haskell | None |
Language | Haskell2010 |
This module defines types and operations used to store messages for display in the client's buffers.
- data Window = Window {
- _winMessages :: ![WindowLine]
- _winUnread :: !Int
- _winTotal :: !Int
- _winMention :: !Bool
- winMessages :: Lens' Window [WindowLine]
- winUnread :: Lens' Window Int
- winTotal :: Lens' Window Int
- winMention :: Lens' Window Bool
- data WindowLine = WindowLine {
- _wlBody :: !MessageBody
- _wlText :: !Text
- _wlImage :: !Image
- _wlFullImage :: !Image
- wlBody :: Lens' WindowLine MessageBody
- wlText :: Lens' WindowLine Text
- wlImage :: Lens' WindowLine Image
- wlFullImage :: Lens' WindowLine Image
- data WindowLineImportance
- emptyWindow :: Window
- addToWindow :: WindowLineImportance -> WindowLine -> Window -> Window
- windowSeen :: Window -> Window
Windows
A Window
tracks all of the messages and metadata for a particular
message buffer.
Window | |
|
winMessages :: Lens' Window [WindowLine] Source #
Window lines
data WindowLine Source #
A single message to be displayed in a window
WindowLine | |
|
Window line importance
data WindowLineImportance Source #
Flag for the important of a message being added to a window
WLBoring | Don't update unread count |
WLNormal | Increment unread count |
WLImportant | Increment unread count and set important flag |
Window operations
emptyWindow :: Window Source #
A window with no messages
addToWindow :: WindowLineImportance -> WindowLine -> Window -> Window Source #
Adds a given line to a window as the newest message. Window's unread count will be updated according to the given importance.
windowSeen :: Window -> Window Source #
Update the window clearing the unread count and important flag.