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
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
--- 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,
Patch applied to svn trunk. Many thanks.
From: hinrik.sig [...] gmail.com
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.
Subject: Re: [rt.cpan.org #33850] POE::Component::IRC::State, selectively disable auto-/who on join
Date: Mon, 10 Mar 2008 18:16:34 -0800
To: Hinrik Orn Sigurdsson via RT <bug-POE-Component-IRC [...] rt.cpan.org>
From: Michael Fowler <michael [...] shoebox.net>
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
Rolled back WhoMembers, left as WhoJoiners. Yes, it doesn't make sense to disable the initial channel synchronisation. Cheers.