]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
search plugin: use single result format when a single hit is found
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Tue, 14 Aug 2007 17:19:27 +0000 (17:19 +0000)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Tue, 14 Aug 2007 17:19:27 +0000 (17:19 +0000)
data/rbot/plugins/search.rb

index 8453b4bae9e6db8b5a14ae2595e50e0419048a54..493db9367ad62f0c3969c57a3de23479d435ca2a 100644 (file)
@@ -85,6 +85,7 @@ class SearchPlugin < Plugin
       m.reply "no results found for #{what}"
       return
     end
+    single ||= (results.length==1)
     urls = Array.new
     results = results[0...hits].map { |res|
       n = res[0]