Cleaned up TOPIC parsing.

This commit is contained in:
Elijah Perrault committed 2011-02-26 14:27:57 -07:00
1 parent 5c517b8093
commit d33d47afd2
2 files changed
+7 -12

No files matched your search

+2
View File
@@ -3,6 +3,8 @@ Auto IRC Bot 3.0: Change Log
3.0 Indev
===============================================================================
* Changed on_topic args to: full source hashref, new topic array
* on_topic is now triggered for any topic change, regardless of source.
* Now parsing numeric 004.
* Added hook on_isupport.
* Added a BotStats module for returning statistics about the bot.
+5 -12
View File
@@ -681,19 +681,12 @@ sub quit {
sub topic {
my ($svr, @ex) = @_;
my %src = API::IRC::usrc(substr($ex[0], 1));
$src{svr} = $svr;
$src{chan} = $ex[2];
$ex[3] = substr $ex[3], 1;
# Ignore it if it's coming from us.
if (lc($src{nick}) ne lc($botinfo{$svr}{nick})) {
$src{chan} = $ex[2];
my (@argv);
$argv[0] = substr($ex[3], 1);
if (defined $ex[4]) {
for (my $i = 4; $i < scalar(@ex); $i++) {
push(@argv, $ex[$i]);
}
}
API::Std::event_run("on_topic", ($svr, \%src, @argv));
}
# Trigger on_topic.
API::Std::event_run('on_topic', (\%src, @ex[3..$#ex]));
return 1;
}