From 49e70ed098ab1094f337ccbe19a5bcef41a7bf1e Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Mon, 14 May 2018 19:21:58 -0700 Subject: [PATCH] No longer show channel name in "did you mean..." if strictnamespace is enabled --- PBot/DualIndexHashObject.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PBot/DualIndexHashObject.pm b/PBot/DualIndexHashObject.pm index 11c9019d..1c801266 100644 --- a/PBot/DualIndexHashObject.pm +++ b/PBot/DualIndexHashObject.pm @@ -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 = ", "; }