NAME

App::Bondage::State - Generates IRC server replies based on information provided by POE::Component::IRC::State.

SYNOPSIS

use App::Bondage::State;

$irc->plugin_add('State', App::Bondage::State->new());

DESCRIPTION

App::Bondage::State is a POE::Component::IRC plugin. Its role is to use POE::Component::IRC::State's information as a cache so that fewer trips will be to the IRC server when clients submit queries. The methods here are only useful for a subset of the use cases that their corresponding commands are capable of, mostly because there are certain cases that only the actual IRC server can handle. However, the methods can handle all the automatic queries that modern IRC clients make, so it does the job.

Another thing this plugin does is hide from clients all server replies elicited by POE::Component::IRC::State's information gathering.

This plugin requires the IRC component to be POE::Component::IRC::State or a subclass thereof.

CONSTRUCTOR

new

Takes no arguments.

Returns a plugin object suitable for feeding to POE::Component::IRC's plugin_add() method.

METHODS

topic_reply

One argument:

An IRC channel which the IRC component is on

Returns IRC protocol line responses to the TOPIC command.

names_reply

One argument:

An IRC channel which the IRC component is on

Returns IRC protocol line responses to the NAMES command.

who_reply

One argument:

An IRC channel which the IRC component is on, or a known nickname

Returns IRC protocol line responses to the WHO command.

names_reply

One or two arguments:

The IRC component's nickname, or a channel which the component is on and an optional mode type

Returns IRC protocol line responses to the MODE command.

enqueue

In case a client asks for information about a channel while it is being synced, it should call this method, and the information will be provided as soon as it has been gathered.

Takes three arguments:

A code reference which will be called for every line of response generated, the type of reply being asked for (e.g. 'who_reply'), and the arguments to the corresponding method.

is_syncing

Takes one argument:

An IRC channel.

Returns 1 if the channel or nick is being synced, 0 otherwise.

AUTHOR

Hinrik Örn Sigurðsson, hinrik.sig@gmail.com