r107721 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107720‎ | r107721 | r107722 >
Date:14:16, 31 December 2011
Author:petrb
Status:deferred
Tags:
Comment:
improved @search and regsearch info
Modified paths:
  • /trunk/tools/wmib/Infobot.cs (modified) (history)

Diff [purge]

Index: trunk/tools/wmib/Infobot.cs
@@ -351,10 +351,12 @@
352352 {
353353 Regex value = new Regex(search_key, RegexOptions.Compiled);
354354 string results = "";
 355+ int count = 0;
355356 foreach (item data in text)
356357 {
357358 if (data.key == search_key || value.Match(data.text).Success)
358359 {
 360+ count++;
359361 results = results + data.key + ", ";
360362 }
361363 }
@@ -364,7 +366,7 @@
365367 }
366368 else
367369 {
368 - irc.SlowQueue.DeliverMessage("Results: " + results, Channel);
 370+ irc.SlowQueue.DeliverMessage("Results (found " + count.ToString() + "): " + results, Channel);
369371 }
370372 running = false;
371373 }
@@ -421,12 +423,14 @@
422424 return;
423425 }
424426 key = key.Substring(8);
 427+ int count = 0;
425428 string results = "";
426429 foreach (item data in text)
427430 {
428431 if (data.key == key || data.text.Contains(key))
429432 {
430433 results = results + data.key + ", ";
 434+ count++;
431435 }
432436 }
433437 if (results == "")
@@ -435,7 +439,7 @@
436440 }
437441 else
438442 {
439 - irc.SlowQueue.DeliverMessage("Results: " + results, Chan.name);
 443+ irc.SlowQueue.DeliverMessage("Results (found " + count.ToString() + "): " + results, Chan.name);
440444 }
441445 }
442446

Status & tagging log