r106489 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106488‎ | r106489 | r106490 >
Date:00:33, 17 December 2011
Author:petrb
Status:deferred
Tags:
Comment:
fixed parsing of values in stream from server
Modified paths:
  • /trunk/tools/wmib/Core.cs (modified) (history)

Diff [purge]

Index: trunk/tools/wmib/Core.cs
@@ -545,11 +545,11 @@
546546 {
547547 if ( parameters > 1)
548548 {
549 - int curr = 0;
550 - while ( parameters >= curr )
 549+ int curr = 1;
 550+ while ( parameters > curr )
551551 {
552 - curr++;
553552 keyv = keyv.Replace("$" + curr.ToString(), p[curr]);
 553+ curr++;
554554 }
555555 }
556556 if (User == "")
@@ -1250,7 +1250,7 @@
12511251 {
12521252 if (text.Contains("PRIVMSG"))
12531253 {
1254 - string info = text.Substring(1, text.IndexOf(":", 2));
 1254+ string info = text.Substring(1, text.IndexOf(" :", 1) - 1);
12551255 string info_host;
12561256 // we got a message here :)
12571257 if (text.Contains("!") && text.Contains("@"))
@@ -1263,9 +1263,8 @@
12641264 if (info_host.Contains("#"))
12651265 {
12661266 channel = info_host.Substring(info_host.IndexOf("#"));
1267 - channel = channel.Substring(0, channel.IndexOf(" "));
12681267 message = text.Replace(info, "");
1269 - message = message.Substring(message.IndexOf(":") + 1);
 1268+ message = message.Substring(message.IndexOf(" :") + 2);
12701269 if (message.Contains(delimiter.ToString() + "ACTION"))
12711270 {
12721271 getAction(message.Replace(delimiter.ToString() +"ACTION", ""), channel, host, nick);

Status & tagging log