3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-19 10:29:30 +01:00

No longer show channel name in "did you mean..." if strictnamespace is enabled

This commit is contained in:
Pragmatic Software 2018-05-14 19:21:58 -07:00
parent 2df10fdf45
commit 49e70ed098

View File

@ -209,6 +209,7 @@ sub levenshtein_matches {
if ($strictnamespace) {
next unless $index1 eq '.*' or $index1 eq $primary;
$header = "" unless $header eq '[global channel] ';
}
foreach my $index2 (sort keys %{ $self->hash->{$index1} }) {
@ -218,6 +219,7 @@ sub levenshtein_matches {
if($distance_result / $length < $distance) {
$header = "" if $last_header eq $header;
$last_header = $header;
$comma = '; ' if $comma ne '' and $header ne '';
$result .= $comma . $header . $index2;
$comma = ", ";
}