glirc2

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

Irc.Message

Contents

Description

This module defines high-level IRC commands. Commands are interpreted and their arguments are extracted into the appropriate types.

Synopsis

High-level messages

cookIrcMsg :: RawIrcMsg -> IrcMsg Source #

Interpret a low-level RawIrcMsg as a high-level IrcMsg. Messages that can't be understood are wrapped in UnknownMsg.

Properties of messages

data MessageTarget Source #

Targets used to direct a message to a window for display

Constructors

TargetUser !Identifier

Metadata update for a user

TargetWindow !Identifier

Directed message to channel or from user

TargetNetwork

Network-level message

TargetHidden

Completely hidden message

ircMsgText :: IrcMsg -> Text Source #

Text representation of an IRC message to be used for matching with regular expressions.

msgTarget :: Identifier -> IrcMsg -> MessageTarget Source #

Target information for the window that could be appropriate to display this message in.

msgActor :: IrcMsg -> Maybe UserInfo Source #

UserInfo of the user responsible for a message.

Helper functions

nickSplit :: Text -> [Text] Source #

Split a nick into text parts group by whether or not those parts are valid nickname characters.

computeMaxMessageLength :: UserInfo -> Text -> Int Source #

Maximum length computation for the message part for privmsg and notice. Note that the need for the limit is because the server will limit the length of the message sent out to each client, not just the length of the messages it will recieve.

Note that the length is on the *encoded message* which is UTF-8 The calculation isn't using UTF-8 on the userinfo part because I'm assuming that the channel name and userinfo are all ASCII

:my!user@info PRIVMSG #channel :messagebodyrn