3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-26 22:09:26 +01:00

Split multi-context grabbed nicks to show first nick when displaying such quotegrabs

This commit is contained in:
Pragmatic Software 2013-10-04 22:14:16 +00:00
parent 2cb74ecf95
commit bd9e53e77a
2 changed files with 12 additions and 8 deletions

View File

@ -315,10 +315,12 @@ sub delete_quotegrab {
my $text = $quotegrab->{text};
my ($first_nick) = split /\+/, $quotegrab->{nick}, 2;
if($text =~ s/^\/me\s+//) {
return "Deleted $arguments: * $quotegrab->{nick} $text";
return "Deleted $arguments: * $first_nick $text";
} else {
return "Deleted $arguments: <$quotegrab->{nick}> $text";
return "Deleted $arguments: <$first_nick> $text";
}
}
@ -333,11 +335,12 @@ sub show_quotegrab {
my $timestamp = $quotegrab->{timestamp};
my $ago = ago(gettimeofday - $timestamp);
my $text = $quotegrab->{text};
my ($first_nick) = split /\+/, $quotegrab->{nick}, 2;
if($text =~ s/^\/me\s+//) {
return "$arguments: grabbed by $quotegrab->{grabbed_by} on " . localtime($timestamp) . " [$ago] * $quotegrab->{nick} $text";
return "$arguments: grabbed by $quotegrab->{grabbed_by} on " . localtime($timestamp) . " [$ago] * $first_nick $text";
} else {
return "$arguments: grabbed by $quotegrab->{grabbed_by} on " . localtime($timestamp) . " [$ago] <$quotegrab->{nick}> $text";
return "$arguments: grabbed by $quotegrab->{grabbed_by} on " . localtime($timestamp) . " [$ago] <$first_nick> $text";
}
}
@ -389,11 +392,12 @@ sub show_random_quotegrab {
my $quotegrab = $quotes[int rand($#quotes + 1)];
my $text = $quotegrab->{text};
my ($first_nick) = split /\+/, $quotegrab->{nick}, 2;
if($text =~ s/^\/me\s+//) {
return "$quotegrab->{id}: * $quotegrab->{nick} $text";
return "$quotegrab->{id}: * $first_nick $text";
} else {
return "$quotegrab->{id}: <$quotegrab->{nick}> $text";
return "$quotegrab->{id}: <$first_nick> $text";
}
}

View File

@ -13,8 +13,8 @@ use warnings;
# These are set automatically by the build/commit script
use constant {
BUILD_NAME => "PBot",
BUILD_REVISION => 434,
BUILD_DATE => "2013-10-03",
BUILD_REVISION => 436,
BUILD_DATE => "2013-10-04",
};
1;