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,