From: dondelelcaro Date: Thu, 6 Mar 2014 20:37:27 +0000 (+0000) Subject: prefer chan specific commands X-Git-Url: https://git.donarmstrong.com/?p=infobot.git;a=commitdiff_plain;h=f74760b6314cad37111faa30ee753a9e727039bf prefer chan specific commands git-svn-id: https://svn.code.sf.net/p/infobot/code/branches/don/dpkg@1937 c11ca15a-4712-0410-83d8-924469b57eb5 --- diff --git a/src/Factoids/Question.pl b/src/Factoids/Question.pl index 276f9e8..06f8134 100644 --- a/src/Factoids/Question.pl +++ b/src/Factoids/Question.pl @@ -221,7 +221,9 @@ sub factoidArgs { # the factoid key to reduce repetitive processing. # it does not matter if it's not alphabetically sorted. - foreach ( sort { length($b) <=> length($a) } @list ) { + foreach ( (sort { length($b) <=> length($a) } grep {$_ =~ /^\Q$chan \E/} @list), + (sort { length($b) <=> length($a) } grep {$_ !~ /^\Q$chan \E/} @list) + ) { next if (/#DEL#/); # deleted. s/^\Q$chan \E//i;