glirc-2.31: Console IRC client

Copyright(c) Dan Doel 2016
LicenseISC
Maintainerdan.doel@gmail.com
Safe HaskellNone
LanguageHaskell2010

Client.Hook

Description

This module defines types for hooking into the operation of the client.

Synopsis

Documentation

  • Message hook results

data MessageResult Source #

The possible results of a MessageHook action. A hook can decline to handle a message (PassMessage), filter out a message (OmitMessage), or change a message into an arbitrary other message (RemapMessage).

Constructors

PassMessage

continue processing

OmitMessage

stop processing and drop message

RemapMessage IrcMsg

stop processing and return new message

  • Message hooks

data MessageHook Source #

Constructors

MessageHook 

Fields

applyMessageHooks :: [MessageHook] -> IrcMsg -> Maybe IrcMsg Source #

Apply the given message hooks to an IrcMsg. The hooks are tried in order until one handles the message. A Nothing result means the message was filtered out by a hook. A Just result contains the actual IrcMsg to be processed.