Skip Menu |
 

This queue is for tickets about the Bot-BasicBot CPAN distribution.

Report information
The Basics
Id: 42625
Status: resolved
Priority: 0/
Queue: Bot-BasicBot

People
Owner: Nobody in particular
Requestors: rg [...] progtech.net
Cc:
AdminCc:

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



Subject: Make BasicBot handle quit messages
Download (untitled) / with headers
text/plain 383b
Hi, I'd like to propose the attached patch. It registers a callback for quit messages, which updates the channel data and emits a chanpart state for every channel the user was on. Maybe it could also (or instead?) emit a quit message, but I didn't need that for my use case. AFAICT, this should also fix the nick tracking (at least I can't think of any other bug with it). Rolf.
Subject: bot.patch
Download bot.patch
text/x-diff 1.1k
--- BasicBot.pm 2009-01-21 21:12:20.000000000 +0100 +++ BasicBot.pm.patched 2009-01-21 21:59:08.000000000 +0100 @@ -135,6 +135,7 @@ sub run { irc_kick => "irc_kicked_state", irc_nick => "irc_nick_state", irc_mode => "irc_mode_state", + irc_quit => "irc_quit_state", fork_close => "fork_close_state", fork_error => "fork_error_state", @@ -1101,6 +1102,26 @@ sub irc_mode_state { } } +=head2 irc_quit_state + +=cut + +sub irc_quit_state { + my ($self, $kernel, $nick, $message) = @_[OBJECT, KERNEL, ARG0, ARG1]; + $nick = $_[OBJECT]->nick_strip($nick); + if ($self->nick eq $nick) { + $kernel->delay('reconnect', 1 ); + return; + } + for my $channel (keys( %{ $self->{channel_data} } )) { + if (defined( $self->{channel_data}{$channel}{$nick}) ) { + $_[OBJECT]->_remove_from_channel( $channel, $nick ); + @_[ARG1, ARG2] = ($channel, $message); + irc_chan_received_state( 'chanpart', 'say', @_ ); + } + } +} + =head2 irc_said_state Called if we recieve a private or public message. This
Bot::BasicBot 0.8 released, fixes this. Thanks.
Subject: Re: [rt.cpan.org #42625] Make BasicBot handle quit messages
Date: Fri, 23 Jan 2009 16:04:58 +0100
To: bug-Bot-BasicBot [...] rt.cpan.org
From: Rolf Grossmann <rg [...] progtech.net>
Download (untitled) / with headers
text/plain 172b
Tom, TOMI via RT wrote: Show quoted text
> Bot::BasicBot 0.8 released, fixes this.
Unfortunately, it seems you forgot to put in the implementation of _remove_from_all_channels :( Rolf
I'm an idiot? 0.81 in the queue, should fix this.


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.