Skip Menu |
 

This queue is for tickets about the POE-Component-IRC CPAN distribution.

Report information
The Basics
Id: 33850
Status: resolved
Worked: 20 min
Priority: 0/
Queue: POE-Component-IRC

People
Owner: BINGOS [...] cpan.org
Requestors: michael [...] shoebox.net
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 5.70
Fixed in: (no value)



Subject: POE::Component::IRC::State, selectively disable auto-/who on join
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Charset: utf8
X-RT-Original-Encoding: utf-8
Content-Type: multipart/mixed; boundary="----------=_1204802040-30553-5"
Content-Length: 0
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
Content-Length: 643
Download (untitled) / with headers
text/plain 643b
POE::Component::IRC::State automatically sends a /who command when someone joins a channel. I would like to be able to turn this off for various reasons. I have attached a patch that adds handling for a 'WhoJoiners' configuration value, similar to AwayPoll. Documentation is modified accordingly. If WhoJoiners is specified and false, it turns off the automatic /who when someone joins a channel. Otherwise it functions the same as always. As far as I can tell this does not adversely affect POE::Component::IRC::State. Plugins and code that rely on is_operator() and nick_info() may not function correctly if WhoJoiners is turned off.
Subject: diff.txt
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="----------=_1204802040-30553-4"
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Charset: utf8
Content-Length: 0
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: iso-8859-1
Content-Length: 0
Content-Type: text/plain; charset="utf-8"; name="diff.txt"
Content-Disposition: inline; filename="diff.txt"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: ascii
Content-Length: 1214
Download diff.txt
text/plain 1.1k
--- State.pm~orig 2008-03-06 00:26:45.000000000 -0900 +++ State.pm 2008-03-06 00:43:59.000000000 -0900 @@ -84,7 +84,9 @@ } else { - $self->yield ( 'who' => $nick ); + if ( !exists $self->{whojoiners} || $self->{whojoiners} ) { + $self->yield ( 'who' => $nick ); + } $self->{STATE}->{Nicks}->{ $unick }->{Nick} = $nick; $self->{STATE}->{Nicks}->{ $unick }->{User} = $user; $self->{STATE}->{Nicks}->{ $unick }->{Host} = $host; @@ -1123,12 +1125,15 @@ POE::Component::IRC::State's constructors, and its C<connect> event, all take the same arguments as L<POE::Component::IRC|POE::Component::IRC> does, as -well as an additional one: +well as two additional: 'AwayPoll', the interval (in seconds) in which to poll (i.e. C<WHO #channel>) the away status of channel members. Defaults to 0 (disabled). If enabled, you will receive C<irc_away_sync_*> / C<irc_user_away> / C<irc_user_back> events. +'WhoJoiners', a boolean indicating whether or not to send a C<WHO nick> for +people just joining the channel. Defaults to on (the WHO is sent). + =head1 METHODS All of the L<POE::Component::IRC|POE::Component::IRC> methods are supported,
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Charset: utf8
Message-Id: <rt-3.6.HEAD-30531-1204815738-161.33850-0-0 [...] rt.cpan.org>
Content-Type: text/plain
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 41
Patch applied to svn trunk. Many thanks.
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Charset: utf8
Message-Id: <rt-3.6.HEAD-30561-1205120467-565.33850-0-0 [...] rt.cpan.org>
Content-Type: text/plain
Content-Transfer-Encoding: binary
From: hinrik.sig [...] gmail.com
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 172
Download (untitled) / with headers
text/plain 172b
I modified the patch a bit. I changed it from 'WhoJoiners' to 'WhoMembers' and made it also control the initial C<WHO #channel> that State.pm sends when it joins a channel.
MIME-Version: 1.0
X-Spam-Status: No, hits=-2.6 required=8.0 tests=BAYES_00
In-Reply-To: <rt-3.6.HEAD-30561-1205120467-565.33850-6-0 [...] rt.cpan.org>
Content-Disposition: inline
References: <RT-Ticket-33850 [...] rt.cpan.org> <rt-3.6.HEAD-30561-1205120467-565.33850-6-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
X-RT-Original-Encoding: us-ascii
Received: from x1.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id 1DA8F4D8018 for <bug-POE-Component-IRC [...] rt.cpan.org>; Mon, 10 Mar 2008 22:16:46 -0400 (EDT)
Received: (qmail 13674 invoked from network); 11 Mar 2008 02:16:45 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 11 Mar 2008 02:16:45 -0000
Received: from oftechnologies.com (HELO wulfgar.oftechnologies.com) (66.180.173.28) by 16.mx.develooper.com (qpsmtpd/0.43rc1) with ESMTP; Mon, 10 Mar 2008 19:16:42 -0700
Received: from beowulf.eth (root [...] 165-0-178-69.static.gci.net [69.178.0.165]) by wulfgar.oftechnologies.com (8.13.8/8.13.8/Debian-3) with ESMTP id m2B2fgcZ026888 for <bug-POE-Component-IRC [...] rt.cpan.org>; Mon, 10 Mar 2008 21:41:42 -0500
Received: from beowulf.eth (michael [...] localhost [127.0.0.1]) by beowulf.eth (8.13.8/8.13.8/Debian-3) with ESMTP id m2B2GYM0016495 for <bug-POE-Component-IRC [...] rt.cpan.org>; Mon, 10 Mar 2008 18:16:34 -0800
Received: (from michael [...] localhost) by beowulf.eth (8.13.8/8.13.8/Submit) id m2B2GYq9016492 for bug-POE-Component-IRC [...] rt.cpan.org; Mon, 10 Mar 2008 18:16:34 -0800
Delivered-To: cpan-bug+POE-Component-IRC [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #33850] POE::Component::IRC::State, selectively disable auto-/who on join
User-Agent: Mutt/1.5.13 (2006-08-11)
Return-Path: <michael [...] shoebox.net>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-POE-Component-IRC [...] rt.cpan.org
Date: Mon, 10 Mar 2008 18:16:34 -0800
X-Spam-Level: *
Message-Id: <20080311021634.GA16373 [...] shoebox.net>
To: Hinrik Orn Sigurdsson via RT <bug-POE-Component-IRC [...] rt.cpan.org>
From: Michael Fowler <michael [...] shoebox.net>
X-RT-Original-Encoding: utf-8
RT-Message-ID: <rt-3.6.HEAD-24335-1205201811-282.33850-0-0 [...] rt.cpan.org>
Content-Length: 662
Download (untitled) / with headers
text/plain 662b
On Sun, Mar 09, 2008 at 11:41:08PM -0400, Hinrik Orn Sigurdsson via RT wrote: Show quoted text
> I modified the patch a bit. I changed it from 'WhoJoiners' to > 'WhoMembers' and made it also control the initial C<WHO #channel> that > State.pm sends when it joins a channel.
I was specifically trying to avoid disabling the "/who $channel" when the bot joins. That /who is required in order to properly sync the channel and fill the data structures. It was also something I was relying on ::State to do. If you insist on disabling it, could you make it an option separate from the one I patched in? I don't want to disable "/who $channel". -- Michael Fowler www.shoebox.net
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Charset: utf8
Message-Id: <rt-3.6.HEAD-17438-1205319833-104.33850-0-0 [...] rt.cpan.org>
Content-Type: text/plain
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 129
Download (untitled) / with headers
text/plain 129b
Rolled back WhoMembers, left as WhoJoiners. Yes, it doesn't make sense to disable the initial channel synchronisation. Cheers.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.