mirror of
https://github.com/pragma-/pbot.git
synced 2025-02-09 02:54:23 +01:00
No longer show channel name in "did you mean..." if strictnamespace is enabled
This commit is contained in:
parent
2df10fdf45
commit
49e70ed098
@ -209,6 +209,7 @@ sub levenshtein_matches {
|
|||||||
|
|
||||||
if ($strictnamespace) {
|
if ($strictnamespace) {
|
||||||
next unless $index1 eq '.*' or $index1 eq $primary;
|
next unless $index1 eq '.*' or $index1 eq $primary;
|
||||||
|
$header = "" unless $header eq '[global channel] ';
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach my $index2 (sort keys %{ $self->hash->{$index1} }) {
|
foreach my $index2 (sort keys %{ $self->hash->{$index1} }) {
|
||||||
@ -218,6 +219,7 @@ sub levenshtein_matches {
|
|||||||
if($distance_result / $length < $distance) {
|
if($distance_result / $length < $distance) {
|
||||||
$header = "" if $last_header eq $header;
|
$header = "" if $last_header eq $header;
|
||||||
$last_header = $header;
|
$last_header = $header;
|
||||||
|
$comma = '; ' if $comma ne '' and $header ne '';
|
||||||
$result .= $comma . $header . $index2;
|
$result .= $comma . $header . $index2;
|
||||||
$comma = ", ";
|
$comma = ", ";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user