Jon Portnoy > IRC-Toolkit-0.072000 > IRC::Toolkit::ISupport

Download:
IRC-Toolkit-0.072000.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.072000   Source   Latest Release: IRC-Toolkit-0.088001

NAME ^

IRC::Toolkit::ISupport - IRC ISUPPORT parser

SYNOPSIS ^

  use IRC::Toolkit::ISupport;
  my $isupport = parse_isupport(@lines);

  ## Get the MODES= value
  my $maxmodes = $isupport->modes;

  ## Get the PREFIX= char for mode 'o'
  my $prefix_for_o = $isupport->prefix('o');

  ## ... etc ...

DESCRIPTION ^

An ISUPPORT (IRC numeric 005) parser that accepts either raw IRC lines or IRC::Message::Object instances and produces struct-like objects with some special magic for parsing known ISUPPORT types.

See http://www.irc.org/tech_docs/005.html

parse_isupport

Takes a list of raw IRC lines or IRC::Message::Object instances and produces ISupport objects.

Keys not listed here will return their raw value (or '0 but true' for boolean values).

The following known keys are parsed to provide a nicer interface:

chanlimit

If passed a channel prefix character, returns the CHANLIMIT= value for that prefix.

Without any arguments, returns a HASH mapping channel prefixes to their respective CHANLIMIT= value.

chanmodes

The four mode sets described by a compliant CHANMODES= declaration are list modes, modes that always take a parameter, modes that take a parameter only when they are set, and boolean-type 'flag' modes, respectively:

  CHANMODES=LIST,ALWAYS,WHENSET,BOOL

You can retrieve ARRAYs containing lists of modes belonging to each set:

  my @listmodes = @{ $isupport->chanmodes->list };
  my $always  = $isupport->chanmodes->always;
  my $whenset = $isupport->chanmodes->whenset;
  my $boolean = $isupport->chanmodes->bool;

chantypes

Without any arguments, returns a HASH whose keys are the allowable channel prefixes.

If given a channel prefix, returns boolean true if the channel prefix is allowed per CHANTYPES.

maxlist

Without any arguments, returns a HASH mapping list-type modes (see "chanmodes") to their respective numeric limit.

If given a list-type mode, returns the limit for that list.

prefix

Without any arguments, returns a HASH mapping status modes to their respective prefixes.

If given a status modes, returns the prefix belonging to that mode.

statusmsg

Without any arguments, returns a HASH whose keys are the valid message target status prefixes.

If given a status prefix, returns boolean true if the prefix is listed in STATUSMSG.

MISSING ^

... typically because I'm not sure if there's authoritative documentation or where it might be found ...

AUTHOR ^

Jon Portnoy <avenj@cobaltirc.org>

syntax highlighting: