.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.if !\nF .nr F 0
.if \nF>0 \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
.\}
.\" ========================================================================
.\"
.IX Title "POE::Component::IRC::Qnet::State 3pm"
.TH POE::Component::IRC::Qnet::State 3pm "2018-01-01" "perl v5.26.1" "User Contributed Perl Documentation"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
POE::Component::IRC::Qnet::State \- A fully event\-driven IRC client module
for Quakenet with nickname and channel tracking
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 1
\& # A simple Rot13 \*(Aqencryption\*(Aq bot
\&
\& use strict;
\& use warnings;
\& use POE qw(Component::IRC::Qnet::State);
\&
\& my $nickname = \*(AqFlibble\*(Aq . $$;
\& my $ircname = \*(AqFlibble the Sailor Bot\*(Aq;
\& my $ircserver = \*(Aqirc.blahblahblah.irc\*(Aq;
\& my $port = 6667;
\& my $qauth = \*(AqFlibbleBOT\*(Aq;
\& my $qpass = \*(Aqfubar\*(Aq;
\&
\& my @channels = ( \*(Aq#Blah\*(Aq, \*(Aq#Foo\*(Aq, \*(Aq#Bar\*(Aq );
\&
\& # We create a new PoCo\-IRC object and component.
\& my $irc = POE::Component::IRC::Qnet::State\->spawn(
\& nick => $nickname,
\& server => $ircserver,
\& port => $port,
\& ircname => $ircname,
\& ) or die "Oh noooo! $!";
\&
\& POE::Session\->create(
\& package_states => [
\& main => [ qw(_default _start irc_001 irc_public) ],
\& ],
\& heap => { irc => $irc },
\& );
\&
\& $poe_kernel\->run();
\&
\& sub _start {
\& my ($kernel, $heap) = @_[KERNEL, HEAP];
\&
\& # We get the session ID of the component from the object
\& # and register and connect to the specified server.
\& my $irc_session = $heap\->{irc}\->session_id();
\& $kernel\->post( $irc_session => register => \*(Aqall\*(Aq );
\& $kernel\->post( $irc_session => connect => { } );
\&
\& return;
\& }
\&
\& sub irc_001 {
\& my ($kernel, $sender) = @_[KERNEL, SENDER];
\&
\& # Get the component\*(Aqs object at any time by accessing the heap of
\& # the SENDER
\& my $poco_object = $sender\->get_heap();
\& print "Connected to ", $poco_object\->server_name(), "\en";
\&
\& # Lets authenticate with Quakenet\*(Aqs Q bot
\& $kernel\->post( $sender => qbot_auth => $qauth => $qpass );
\&
\& # In any irc_* events SENDER will be the PoCo\-IRC session
\& $kernel\->post( $sender => join => $_ ) for @channels;
\&
\& return;
\& }
\&
\& sub irc_public {
\& my ($kernel, $sender, $who, $where, $what) = @_[KERNEL, SENDER, ARG0, .. ARG2];
\& my $nick = ( split /!/, $who )[0];
\& my $channel = $where\->[0];
\& my $poco_object = $sender\->get_heap();
\&
\& if ( my ($rot13) = $what =~ /^rot13 (.+)/ ) {
\& # Only operators can issue a rot13 command to us.
\& return if !$poco_object\->is_channel_operator( $channel, $nick );
\&
\& $rot13 =~ tr[a\-zA\-Z][n\-za\-mN\-ZA\-M];
\& $kernel\->post( $sender => privmsg => $channel => "$nick: $rot13" );
\& }
\&
\& return;
\& }
\&
\& # We registered for all events, this will produce some debug info.
\& sub _default {
\& my ($event, $args) = @_[ARG0 .. $#_];
\& my @output = ( "$event: " );
\&
\& for my $arg ( @$args ) {
\& if (ref $arg eq \*(AqARRAY\*(Aq) {
\& push( @output, \*(Aq[\*(Aq . join(\*(Aq, \*(Aq, @$arg ) . \*(Aq]\*(Aq );
\& }
\& else {
\& push ( @output, "\*(Aq$arg\*(Aq" );
\& }
\& }
\&
\& print join \*(Aq \*(Aq, @output, "\en";
\& return 0;
\& }
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
POE::Component::IRC::Qnet::State is an extension to
POE::Component::IRC::Qnet specifically for use on
Quakenet , which includes the nickname and channel
tracking from POE::Component::IRC::State. See
the documentation for POE::Component::IRC::Qnet
and POE::Component::IRC::State for general usage.
This document covers the extensions.
.SH "METHODS"
.IX Header "METHODS"
.ie n .IP """ban_mask""" 4
.el .IP "\f(CWban_mask\fR" 4
.IX Item "ban_mask"
Expects a channel and a ban mask, as passed to \s-1MODE\s0 +b\-b. Returns a list of
nicks on that channel that match the specified ban mask or an empty list if the
channel doesn't exist in the state or there are no matches. Follows Quakenet
ircd rules for matching authed users.
.ie n .IP """is_nick_authed""" 4
.el .IP "\f(CWis_nick_authed\fR" 4
.IX Item "is_nick_authed"
Expects a nickname as parameter. Will return that users authname (account) if
that nick is in the state and have authed with Q. Returns a false value if
the user is not authed or the nick doesn't exist in the state.
.ie n .IP """find_auth_nicks""" 4
.el .IP "\f(CWfind_auth_nicks\fR" 4
.IX Item "find_auth_nicks"
Expects an authname and a channel name. Will return a list of nicks on the
given channel that have authed with the given authname.
.ie n .IP """nick_info""" 4
.el .IP "\f(CWnick_info\fR" 4
.IX Item "nick_info"
Expects a nickname. Returns a hashref containing similar information to that
returned by \s-1WHOIS.\s0 Returns a false value if the nickname doesn't exist in the
state. The hashref contains the following keys: \fB'Nick'\fR, \fB'User'\fR,
\&\fB'Host'\fR, \fB'Server'\fR, \fB'Auth'\fR, if authed, and, if applicable, \fB'IRCop'\fR.
.SH "INPUT"
.IX Header "INPUT"
These additional events are accepted:
.ie n .IP """resync_chan""" 4
.el .IP "\f(CWresync_chan\fR" 4
.IX Item "resync_chan"
Accepts a list of channels, will resynchronise each of those channels as if
they have been joined for the first time. Expect to see an
\&\f(CW\*(C`irc_chan_sync\*(C'\fR event for each
channel given.
.ie n .IP """resync_nick""" 4
.el .IP "\f(CWresync_nick\fR" 4
.IX Item "resync_nick"
Accepts a nickname and a list of channels. Will resynchronise the given nickname
and issue an \f(CW\*(C`irc_nick_sync\*(C'\fR
event for each of the given channels (assuming that nick is on each of those channels).
.SH "OUTPUT EVENTS"
.IX Header "OUTPUT EVENTS"
This module returns one additional event over and above the usual events:
.ie n .IP """irc_nick_authed""" 4
.el .IP "\f(CWirc_nick_authed\fR" 4
.IX Item "irc_nick_authed"
Sent when the component detects that a user has authed with Q. Due to the
mechanics of Quakenet you will usually only receive this if an unauthed user
joins a channel, then at some later point auths with Q. The component 'detects'
the auth by seeing if Q decides to +v or +o the user. Klunky? Indeed. But
it is the only way to do it, unfortunately.
.PP
The following two \f(CW\*(C`irc_*\*(C'\fR events are the same as their
POE::Component::IRC::State counterparts, with
the additional parameters:
.ie n .IP """irc_quit""" 4
.el .IP "\f(CWirc_quit\fR" 4
.IX Item "irc_quit"
\&\f(CW\*(C`ARG3\*(C'\fR contains the quitting clients auth name if applicable.
.ie n .IP """irc_part""" 4
.el .IP "\f(CWirc_part\fR" 4
.IX Item "irc_part"
\&\f(CW\*(C`ARG3\*(C'\fR contains the parting clients auth name if applicable.
.ie n .IP """irc_kick""" 4
.el .IP "\f(CWirc_kick\fR" 4
.IX Item "irc_kick"
\&\f(CW\*(C`ARG5\*(C'\fR contains the kick victim's auth name if applicable.
.SH "CAVEATS"
.IX Header "CAVEATS"
Like POE::Component::IRC::State this component
registers itself for a number of events. The main difference with
POE::Component::IRC::State is that it uses an
extended form of '\s-1WHO\s0' supported by the Quakenet ircd, asuka. This \s-1WHO\s0 returns
a different numeric reply than the original \s-1WHO,\s0 namely, \f(CW\*(C`irc_354\*(C'\fR. Also, due
to the way Quakenet is configured all users will appear to be on the server
\&'*.quakenet.org'.
.SH "BUGS"
.IX Header "BUGS"
A few have turned up in the past and they are sure to again. Please use
to report any. Alternatively, email the current
maintainer.
.SH "AUTHOR"
.IX Header "AUTHOR"
Chris 'BinGOs' Williams
.PP
Based on the original POE::Component::IRC by:
.PP
Dennis Taylor
.SH "SEE ALSO"
.IX Header "SEE ALSO"
POE::Component::IRC
.PP
POE::Component::IRC::State
.PP
POE::Component::IRC::Qnet
.PP