glirc-2.26: Console IRC client

Copyright(c) Eric Mertens 2016
LicenseISC
Maintaineremertens@gmail.com
Safe HaskellNone
LanguageHaskell2010

Client.Image.Message

Description

This module provides image renderers for messages.

Synopsis

Documentation

data MessageRendererParams Source #

Parameters used when rendering messages

Constructors

MessageRendererParams 

Fields

data RenderMode Source #

Level of detail to use when rendering

Constructors

NormalRender

only render nicknames

DetailedRender

render full user info

data IdentifierColorMode Source #

Constructors

PrivmsgIdentifier

An identifier in a PRIVMSG

NormalIdentifier

An identifier somewhere else

defaultRenderParams :: MessageRendererParams Source #

Default MessageRendererParams with no sigils or nicknames specified

msgImage Source #

Arguments

:: ZonedTime

time of message

-> MessageRendererParams 
-> MessageBody

message body

-> (Image', Image', Image')

prefix, image, full

Construct a message given the time the message was received and its render parameters.

metadataImg :: IrcSummary -> Maybe (Image', Identifier, Maybe Identifier) Source #

Returns image and identifier to be used when collapsing metadata messages.

ignoreImage :: Image' Source #

Image used when treating ignored chat messages as metadata

quietIdentifier :: Palette -> Identifier -> Image' Source #

Render an identifier without using colors. This is useful for metadata.

coloredUserInfo Source #

Arguments

:: Palette

color palette

-> RenderMode

mode

-> HashSet Identifier

my nicks

-> UserInfo

userinfo to draw

-> Image' 

Render an a full user. In normal mode only the nickname will be rendered. If detailed mode the full user info including the username and hostname parts will be rendered. The nickname will be colored.

coloredIdentifier Source #

Arguments

:: Palette

color palette

-> IdentifierColorMode

draw mode

-> HashSet Identifier

my nicknames

-> Identifier

identifier to draw

-> Image' 

Render a nickname in its hash-based color.

nickPad Source #

Arguments

:: PaddingMode

padding mode

-> Image'

input image

-> Image'

padded image

Optionally add padding to an input image according to the specified mode. If the input image is already wider than the specified padding mode, the image is returned unmodified.

timeImage :: Palette -> TimeOfDay -> Image' Source #

Render a ZonedTime as time using quiet attributes

23:15

drawWindowLine Source #

Arguments

:: Palette

palette

-> Int

draw columns

-> PaddingMode

nick padding

-> WindowLine

window line

-> [Image']

wrapped lines

Render the normal view of a chat message line padded and wrapped.

parseIrcTextWithNicks Source #

Arguments

:: Palette

palette

-> HashSet Identifier

my nicks

-> HashSet Identifier

other nicks

-> Bool

explicit controls rendering

-> Text

input text

-> Image'

colored text

Parse message text to construct an image. If the text has formatting control characters in it then the text will be rendered according to the formatting codes. Otherwise the nicknames in the message are highlighted.