Index: trunk/tools/wmib/Core.cs |
— | — | @@ -346,7 +346,7 @@ |
347 | 347 | /// <summary> |
348 | 348 | /// Locked |
349 | 349 | /// </summary> |
350 | | - public bool locked = false; |
| 350 | + public bool locked; |
351 | 351 | |
352 | 352 | public class item |
353 | 353 | { |
— | — | @@ -558,7 +558,7 @@ |
559 | 559 | Message("It would be cool to give me also a name of key", Channel); |
560 | 560 | return true; |
561 | 561 | } |
562 | | - this.aliasKey(name.Substring(name.IndexOf(" alias") + 7), parm[0], ""); |
| 562 | + aliasKey(name.Substring(name.IndexOf(" alias") + 7), parm[0], ""); |
563 | 563 | } |
564 | 564 | else |
565 | 565 | { |
— | — | @@ -583,10 +583,7 @@ |
584 | 584 | } |
585 | 585 | return false; |
586 | 586 | } |
587 | | - else |
588 | | - { |
589 | | - Message("You are not autorized to perform this, sorry", Channel); |
590 | | - } |
| 587 | + Message("You are not autorized to perform this, sorry", Channel); |
591 | 588 | return false; |
592 | 589 | } |
593 | 590 | if (parm[1] == "del") |
— | — | @@ -613,7 +610,7 @@ |
614 | 611 | string[] p = name.Split(' '); |
615 | 612 | int parameters = p.Length; |
616 | 613 | string keyv = getValue(p[0]); |
617 | | - if (!(keyv == "")) |
| 614 | + if (keyv != "") |
618 | 615 | { |
619 | 616 | if (parameters > 1) |
620 | 617 | { |
— | — | @@ -1116,7 +1113,7 @@ |
1117 | 1114 | config.channel Chan = getChannel(channel); |
1118 | 1115 | Chan.Users.addUser("admin", IRCTrust.normalize(user) + "!.*@" + host); |
1119 | 1116 | } |
1120 | | - catch (Exception b) |
| 1117 | + catch (Exception) |
1121 | 1118 | { |
1122 | 1119 | |
1123 | 1120 | } |
— | — | @@ -1212,11 +1209,8 @@ |
1213 | 1210 | config.Save(); |
1214 | 1211 | return; |
1215 | 1212 | } |
1216 | | - else |
1217 | | - { |
1218 | | - Message(messages.PermissionDenied, chan.name); |
1219 | | - return; |
1220 | | - } |
| 1213 | + Message(messages.PermissionDenied, chan.name); |
| 1214 | + return; |
1221 | 1215 | } |
1222 | 1216 | if (message == "@whoami") |
1223 | 1217 | { |
— | — | @@ -1389,10 +1383,8 @@ |
1390 | 1384 | } |
1391 | 1385 | } |
1392 | 1386 | wd.Flush(); |
1393 | | - string text = ""; |
1394 | 1387 | string nick = ""; |
1395 | 1388 | string host = ""; |
1396 | | - string message = ""; |
1397 | 1389 | string channel = ""; |
1398 | 1390 | char delimiter = (char) 001; |
1399 | 1391 | |
— | — | @@ -1402,16 +1394,12 @@ |
1403 | 1395 | { |
1404 | 1396 | while (!rd.EndOfStream) |
1405 | 1397 | { |
1406 | | - text = rd.ReadLine(); |
| 1398 | + string text = rd.ReadLine(); |
1407 | 1399 | if (text.StartsWith(":")) |
1408 | 1400 | { |
1409 | 1401 | string check = text.Substring(text.IndexOf(" ")); |
1410 | | - if (check.StartsWith(" 005")) |
| 1402 | + if (!check.StartsWith(" 005")) |
1411 | 1403 | { |
1412 | | - |
1413 | | - } |
1414 | | - else |
1415 | | - { |
1416 | 1404 | if (text.Contains("PRIVMSG")) |
1417 | 1405 | { |
1418 | 1406 | string info = text.Substring(1, text.IndexOf(" :", 1) - 1); |
— | — | @@ -1426,6 +1414,7 @@ |
1427 | 1415 | } |
1428 | 1416 | info_host = info.Substring(info.IndexOf("PRIVMSG ")); |
1429 | 1417 | |
| 1418 | + string message; |
1430 | 1419 | if (info_host.Contains("#")) |
1431 | 1420 | { |
1432 | 1421 | channel = info_host.Substring(info_host.IndexOf("#")); |
— | — | @@ -1440,41 +1429,38 @@ |
1441 | 1430 | getMessage(channel, nick, host, message); |
1442 | 1431 | continue; |
1443 | 1432 | } |
1444 | | - else |
| 1433 | + message = text.Substring(text.IndexOf("PRIVMSG")); |
| 1434 | + message = message.Substring(message.IndexOf(":")); |
| 1435 | + // private message |
| 1436 | + if (message.StartsWith(":" + delimiter.ToString() + "FINGER")) |
1445 | 1437 | { |
1446 | | - message = text.Substring(text.IndexOf("PRIVMSG")); |
1447 | | - message = message.Substring(message.IndexOf(":")); |
1448 | | - // private message |
1449 | | - if (message.StartsWith(":" + delimiter.ToString() + "FINGER")) |
1450 | | - { |
1451 | | - wd.WriteLine("NOTICE " + nick + " :" + delimiter.ToString() + "FINGER" + |
1452 | | - " I am a bot don't finger me"); |
1453 | | - wd.Flush(); |
1454 | | - continue; |
1455 | | - } |
1456 | | - if (message.StartsWith(":" + delimiter.ToString() + "TIME")) |
1457 | | - { |
1458 | | - wd.WriteLine("NOTICE " + nick + " :" + delimiter.ToString() + "TIME " + |
1459 | | - DateTime.Now.ToString()); |
1460 | | - wd.Flush(); |
1461 | | - continue; |
1462 | | - } |
1463 | | - if (message.StartsWith(":" + delimiter.ToString() + "PING")) |
1464 | | - { |
1465 | | - wd.WriteLine("NOTICE " + nick + " :" + delimiter.ToString() + "PING" + |
1466 | | - message.Substring( |
1467 | | - message.IndexOf(delimiter.ToString() + "PING") + 5)); |
1468 | | - wd.Flush(); |
1469 | | - continue; |
1470 | | - } |
1471 | | - if (message.StartsWith(":" + delimiter.ToString() + "VERSION")) |
1472 | | - { |
1473 | | - wd.WriteLine("NOTICE " + nick + " :" + delimiter.ToString() + "VERSION " + |
1474 | | - config.version); |
1475 | | - wd.Flush(); |
1476 | | - continue; |
1477 | | - } |
| 1438 | + wd.WriteLine("NOTICE " + nick + " :" + delimiter.ToString() + "FINGER" + |
| 1439 | + " I am a bot don't finger me"); |
| 1440 | + wd.Flush(); |
| 1441 | + continue; |
1478 | 1442 | } |
| 1443 | + if (message.StartsWith(":" + delimiter.ToString() + "TIME")) |
| 1444 | + { |
| 1445 | + wd.WriteLine("NOTICE " + nick + " :" + delimiter.ToString() + "TIME " + |
| 1446 | + DateTime.Now.ToString()); |
| 1447 | + wd.Flush(); |
| 1448 | + continue; |
| 1449 | + } |
| 1450 | + if (message.StartsWith(":" + delimiter.ToString() + "PING")) |
| 1451 | + { |
| 1452 | + wd.WriteLine("NOTICE " + nick + " :" + delimiter.ToString() + "PING" + |
| 1453 | + message.Substring( |
| 1454 | + message.IndexOf(delimiter.ToString() + "PING") + 5)); |
| 1455 | + wd.Flush(); |
| 1456 | + continue; |
| 1457 | + } |
| 1458 | + if (message.StartsWith(":" + delimiter.ToString() + "VERSION")) |
| 1459 | + { |
| 1460 | + wd.WriteLine("NOTICE " + nick + " :" + delimiter.ToString() + "VERSION " + |
| 1461 | + config.version); |
| 1462 | + wd.Flush(); |
| 1463 | + continue; |
| 1464 | + } |
1479 | 1465 | } |
1480 | 1466 | if (text.Contains("PING ")) |
1481 | 1467 | { |