mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-23 04:19:27 +01:00
Split multi-context grabbed nicks to show first nick when displaying such quotegrabs
This commit is contained in:
parent
2cb74ecf95
commit
bd9e53e77a
@ -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";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user