]> git.donarmstrong.com Git - infobot.git/commitdiff
prefer chan specific commands
authordondelelcaro <dondelelcaro@c11ca15a-4712-0410-83d8-924469b57eb5>
Thu, 6 Mar 2014 20:37:27 +0000 (20:37 +0000)
committerdondelelcaro <dondelelcaro@c11ca15a-4712-0410-83d8-924469b57eb5>
Thu, 6 Mar 2014 20:37:27 +0000 (20:37 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/branches/don/dpkg@1937 c11ca15a-4712-0410-83d8-924469b57eb5

src/Factoids/Question.pl

index 276f9e8c5ea402115ac51d3d99f17855f2f51a03..06f81346f49d7b85173b76f602046e380464a86a 100644 (file)
@@ -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;