Identify TechBot to allow private messages
[reactos.git] / irc / TechBot / TechBot.Library / IrcService.cs
index a771f41..2bc382c 100644 (file)
@@ -11,6 +11,7 @@ namespace TechBot.Library
                private int port;\r
                private string channelnames;\r
                private string botname;\r
+               private string password;\r
                private string chmPath;\r
                private string mainChm;\r
                private string ntstatusXml;\r
@@ -28,6 +29,7 @@ namespace TechBot.Library
                                  int port,\r
                                  string channelnames,\r
                                  string botname,\r
+                                 string password,\r
                                  string chmPath,\r
                                  string mainChm,\r
                                  string ntstatusXml,\r
@@ -41,6 +43,10 @@ namespace TechBot.Library
                        this.port = port;\r
                        this.channelnames = channelnames;\r
                        this.botname = botname;\r
+                       if (password == null || password.Trim() == "")\r
+                               this.password = null;\r
+                       else\r
+                               this.password = password;\r
                        this.chmPath = chmPath;\r
                        this.mainChm = mainChm;\r
                        this.ntstatusXml = ntstatusXml;\r
@@ -72,7 +78,7 @@ namespace TechBot.Library
                                                               hostname, port));\r
                        client.Connect(hostname, port);\r
                        System.Console.WriteLine("Connected...");\r
-                       client.Register(botname, null);\r
+                       client.Register(botname, password, null);\r
                        System.Console.WriteLine(String.Format("Registered as {0}...", botname));\r
                        JoinChannels();\r
                        \r