Skip Menu |
 

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

Report information
The Basics
Id: 45135
Status: resolved
Priority: 0/
Queue: POE-Component-IRC

People
Owner: Nobody in particular
Requestors: bazerka [...] beardz.net
Cc:
AdminCc:

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



Subject: POE::Component::IRC::Plugin::AutoJoin - Rejoin on kick/ban broken for passworded channels on ircu/snircd servers
Date: Sun, 19 Apr 2009 04:07:17 +0100
To: bug-POE-Component-IRC [...] rt.cpan.org
From: Jase Thew <bazerka [...] beardz.net>
Download (untitled) / with headers
text/plain 732b
Due to ircu/snircd servers hiding channel passwords from non-opped users (they return '*' instead of the channel password in the 3rd item of numeric 324's reply string), the S_Join server method is overwriting the channel password stored in the Channels hash with an invalid password ('*'). This results in the plugin failing to rejoin a passworded channel after being kicked or kick-banned. The attached patch (against latest Autojoin.pm in the git repo) introduces a new argument ( Store_key_on_join ) for the plugin's new method which dictates whether the S_Join server method stores a channel's password to the Channels hash. By default, it is enabled and must be disabled for use on ircu/snircd servers. Regards, Jase Thew.
Download AutoJoin.pm.diff
text/x-diff 1.5k
--- AutoJoin.pm.git 2009-04-19 02:38:48.000000000 +0100 +++ AutoJoin.pm 2009-04-19 03:22:56.000000000 +0100 @@ -34,6 +34,7 @@ } $self->{Rejoin_delay} = 5 if !defined $self->{Rejoin_delay}; + $self->{Store_key_on_join} = 1 if !defined $self->{Store_key_on_join}; $irc->plugin_register($self, 'SERVER', qw(474 isupport chan_mode join kick part)); return 1; } @@ -82,6 +83,7 @@ my ($self, $irc) = splice @_, 0, 2; my $joiner = parse_user(${ $_[0] }); my $chan = ${ $_[1] }; + return unless $self->{Store_key_on_join}; if ($joiner eq $irc->nick_name()) { $self->{Channels}->{$chan} = $irc->channel_key($chan); @@ -173,7 +175,7 @@ =head2 C<new> -Two optional arguments: +Four optional arguments: B<'Channels'>, either an array reference of channel names, or a hash reference keyed on channel name, containing the password for each channel. By default it @@ -188,6 +190,13 @@ B<'Retry_when_banned'>, if you can't join a channel due to a ban, set this to the number of seconds to wait between retries. Default is 0 (disabled). +B<'Store_key_on_join'>, set this to 0 if you're using this plugin on ircu or +snircd servers (such as undernet or QuakeNet servers). As both ircu and snircd +hide channel passwords from non-opped users (they show * instead of the channel +password), setting this to 0 prevents the plugin from overwriting the channel +password stored in the B<'Channels'> hash with the masked password. Default is +1 (enabled). + Returns a plugin object suitable for feeding to L<POE::Component::IRC|POE::Component::IRC>'s C<plugin_add> method.
Download (untitled) / with headers
text/plain 480b
Thanks for the bug report. The fact that it's overriding the password at all is actually a bug. It does so at join time, when $irc->channel_key($chan) will be empty on all servers, not just ircu and its derivatives. Anyway, I'm cooking up a solution to this which won't require a special key to new() for ircu (the plugin will just check the server version and Do The Right Thing). Furthermore, it will also record the password for any password-protected channels you join later.
Closing.


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.