summaryrefslogtreecommitdiffstats
path: root/lib/Crawl/Bot/Plugin/Commit.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Crawl/Bot/Plugin/Commit.pm')
-rw-r--r--lib/Crawl/Bot/Plugin/Commit.pm10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/Crawl/Bot/Plugin/Commit.pm b/lib/Crawl/Bot/Plugin/Commit.pm
index 7f51848..70b7278 100644
--- a/lib/Crawl/Bot/Plugin/Commit.pm
+++ b/lib/Crawl/Bot/Plugin/Commit.pm
@@ -45,6 +45,8 @@ sub said {
my $self = shift;
my ($args) = @_;
+ my @keys = (who => $args->{who}, channel => $args->{channel}, "body");
+
if ($args->{body} =~ /^%git(?:\s+(.*))?$/) {
my $rev = $1;
$rev = "HEAD" unless $rev;
@@ -53,11 +55,13 @@ sub said {
my $abbr = substr($commit->{hash}, 0, 12);
my $pl = ($commit->{nfiles} == 1 ? "" : "s");
- $self->say_all("$commit->{author} * r$abbr: $commit->{subject} "
- . "($commit->{date}, $commit->{nfiles} file$pl, $commit->{nins}+ $commit->{ndel}-)");
+ $self->say(@keys, "$commit->{author} * r$abbr: $commit->{subject} "
+ . "($commit->{date}, $commit->{nfiles} file$pl, "
+ . "$commit->{nins}+ $commit->{ndel}-)"
+ );
} else {
my $ev = $? >> 8;
- $self->say_all("Could not find commit $rev (git returned $ev)");
+ $self->say(@keys, "Could not find commit $rev (git returned $ev)");
}
}
}