Different output for !bug command on the other channels. (#winehackers,
#samba-technical)
Modified: trunk/irc/TechBot/TechBot/App.config
Modified: trunk/irc/TechBot/TechBot/ServiceThread.cs
Modified: trunk/irc/TechBot/TechBot.Console/App.config
Modified: trunk/irc/TechBot/TechBot.Console/Main.cs
Modified: trunk/irc/TechBot/TechBot.Library/BugCommand.cs
Modified: trunk/irc/TechBot/TechBot.Library/IrcService.cs
Modified: trunk/irc/TechBot/TechBot.Library/TechBotService.cs
_____
Modified: trunk/irc/TechBot/TechBot/App.config
--- trunk/irc/TechBot/TechBot/App.config 2006-01-05 21:32:52 UTC
(rev 20589)
+++ trunk/irc/TechBot/TechBot/App.config 2006-01-05 21:46:24 UTC
(rev 20590)
@@ -13,6 +13,8 @@
<add key="HresultXml" value="C:\IRC\TechBot\hresult.xml"
/>
<add key="WmXml" value="C:\IRC\TechBot\wm.xml" />
<add key="SvnCommand" value="svn co
svn://svn.reactos.org/trunk/reactos" />
- <add key="BugUrl"
value="www.reactos.org/bugzilla/show_bug.cgi?id={0}" />
+ <add key="BugUrl"
value="http://www.reactos.org/bugzilla/show_bug.cgi?id={0}" />
+ <add key="WineBugUrl"
value="http://bugs.winehq.org/show_bug.cgi?id={0}" />
+ <add key="SambaBugUrl"
value="https://bugzilla.samba.org/show_bug.cgi?id={0}" />
</appSettings>
</configuration>
_____
Modified: trunk/irc/TechBot/TechBot/ServiceThread.cs
--- trunk/irc/TechBot/TechBot/ServiceThread.cs 2006-01-05 21:32:52 UTC
(rev 20589)
+++ trunk/irc/TechBot/TechBot/ServiceThread.cs 2006-01-05 21:46:24 UTC
(rev 20590)
@@ -19,7 +19,7 @@
private string WmXml;
private string WinerrorXml;
private string SvnCommand;
- private string BugUrl;
+ private string BugUrl, WineBugUrl, SambaBugUrl;
private EventLog eventLog;
public ServiceThread(EventLog eventLog)
@@ -42,6 +42,8 @@
WinerrorXml =
ConfigurationSettings.AppSettings["WinerrorXml"];
SvnCommand =
ConfigurationSettings.AppSettings["SvnCommand"];
BugUrl =
ConfigurationSettings.AppSettings["BugUrl"];
+ WineBugUrl =
ConfigurationSettings.AppSettings["WineBugUrl"];
+ SambaBugUrl =
ConfigurationSettings.AppSettings["SambaBugUrl"];
}
public void Run()
@@ -61,7 +63,9 @@
HresultXml,
WmXml,
SvnCommand,
- BugUrl);
+ BugUrl,
+
WineBugUrl,
+
SambaBugUrl);
ircService.Run();
}
_____
Modified: trunk/irc/TechBot/TechBot.Console/App.config
--- trunk/irc/TechBot/TechBot.Console/App.config 2006-01-05
21:32:52 UTC (rev 20589)
+++ trunk/irc/TechBot/TechBot.Console/App.config 2006-01-05
21:46:24 UTC (rev 20590)
@@ -12,7 +12,9 @@
<add key="WinerrorXml"
value="C:\IRC\TechBot\winerror.xml" />
<add key="HresultXml" value="C:\IRC\TechBot\hresult.xml"
/>
<add key="WmXml" value="C:\IRC\TechBot\wm.xml" />
- <add key="SvnCommand" value="svn co
svn://svn.reactos.com/trunk/reactos" />
- <add key="BugUrl"
value="www.reactos.org/bugzilla/show_bug.cgi?id={0}" />
+ <add key="SvnCommand" value="svn co
svn://svn.reactos.org/trunk/reactos" />
+ <add key="BugUrl"
value="http://www.reactos.org/bugzilla/show_bug.cgi?id={0}" />
+ <add key="WineBugUrl"
value="http://bugs.winehq.org/show_bug.cgi?id={0}" />
+ <add key="SambaBugUrl"
value="https://bugzilla.samba.org/show_bug.cgi?id={0}" />
</appSettings>
</configuration>
_____
Modified: trunk/irc/TechBot/TechBot.Console/Main.cs
--- trunk/irc/TechBot/TechBot.Console/Main.cs 2006-01-05 21:32:52 UTC
(rev 20589)
+++ trunk/irc/TechBot/TechBot.Console/Main.cs 2006-01-05 21:46:24 UTC
(rev 20590)
@@ -182,6 +182,32 @@
}
}
+ private static string WineBugUrl
+ {
+ get
+ {
+ string optionName = "WineBugUrl";
+ string s =
ConfigurationSettings.AppSettings[optionName];
+ VerifyRequiredOption(optionName,
+ s);
+ return s;
+ }
+ }
+
+
+ private static string SambaBugUrl
+ {
+ get
+ {
+ string optionName = "SambaBugUrl";
+ string s =
ConfigurationSettings.AppSettings[optionName];
+ VerifyRequiredOption(optionName,
+ s);
+ return s;
+ }
+ }
+
+
private static void RunIrcService()
{
IrcService ircService = new
IrcService(IRCServerHostName,
@@ -196,7 +222,9 @@
HresultXml,
WmXml,
SvnCommand,
- BugUrl);
+ BugUrl,
+
WineBugUrl,
+
SambaBugUrl);
ircService.Run();
}
@@ -217,7 +245,9 @@
HresultXml,
WmXml,
SvnCommand,
-
BugUrl);
+
BugUrl,
+
WineBugUrl,
+
SambaBugUrl);
service.Run();
while (true)
{
_____
Modified: trunk/irc/TechBot/TechBot.Library/BugCommand.cs
--- trunk/irc/TechBot/TechBot.Library/BugCommand.cs 2006-01-05
21:32:52 UTC (rev 20589)
+++ trunk/irc/TechBot/TechBot.Library/BugCommand.cs 2006-01-05
21:46:24 UTC (rev 20590)
@@ -5,13 +5,19 @@
public class BugCommand : BaseCommand, ICommand
{
private IServiceOutput serviceOutput;
- private string bugUrl;
+ private string RosBugUrl;
+ private string WineBugUrl;
+ private string SambaBugUrl;
public BugCommand(IServiceOutput serviceOutput,
- string bugUrl)
+ string RosBugUrl,
+ string WineBugUrl,
+ string SambaBugUrl)
{
this.serviceOutput = serviceOutput;
- this.bugUrl = bugUrl;
+ this.RosBugUrl = RosBugUrl;
+ this.WineBugUrl = WineBugUrl;
+ this.SambaBugUrl = SambaBugUrl;
}
public bool CanHandle(string commandName)
@@ -41,7 +47,18 @@
bugText));
return;
}
+
+ string bugUrl = this.RosBugUrl;
+ if (context is ChannelMessageContext)
+ {
+ ChannelMessageContext channelContext =
context as ChannelMessageContext;
+ if (channelContext.Channel.Name ==
"winehackers")
+ bugUrl = this.WineBugUrl;
+ else if (channelContext.Channel.Name ==
"samba-technical")
+ bugUrl = this.SambaBugUrl;
+ }
+
serviceOutput.WriteLine(context,
String.Format(bugUrl,
bug));
}
_____
Modified: trunk/irc/TechBot/TechBot.Library/IrcService.cs
--- trunk/irc/TechBot/TechBot.Library/IrcService.cs 2006-01-05
21:32:52 UTC (rev 20589)
+++ trunk/irc/TechBot/TechBot.Library/IrcService.cs 2006-01-05
21:46:24 UTC (rev 20590)
@@ -19,7 +19,7 @@
private string hresultXml;
private string wmXml;
private string svnCommand;
- private string bugUrl;
+ private string bugUrl, WineBugUrl, SambaBugUrl;
private IrcClient client;
private ArrayList channels = new ArrayList(); /*
IrcChannel */
private TechBotService service;
@@ -37,7 +37,9 @@
string hresultXml,
string wmXml,
string svnCommand,
- string bugUrl)
+ string BugUrl,
+ string WineBugUrl,
+ string SambaBugUrl)
{
this.hostname = hostname;
this.port = port;
@@ -54,7 +56,9 @@
this.hresultXml = hresultXml;
this.wmXml = wmXml;
this.svnCommand = svnCommand;
- this.bugUrl = bugUrl;
+ this.bugUrl = BugUrl;
+ this.WineBugUrl = WineBugUrl;
+ this.SambaBugUrl = SambaBugUrl;
}
public void Run()
@@ -67,7 +71,9 @@
hresultXml,
wmXml,
svnCommand,
- bugUrl);
+ bugUrl,
+ WineBugUrl,
+ SambaBugUrl);
service.Run();
client = new IrcClient();
_____
Modified: trunk/irc/TechBot/TechBot.Library/TechBotService.cs
--- trunk/irc/TechBot/TechBot.Library/TechBotService.cs 2006-01-05
21:32:52 UTC (rev 20589)
+++ trunk/irc/TechBot/TechBot.Library/TechBotService.cs 2006-01-05
21:46:24 UTC (rev 20590)
@@ -17,7 +17,7 @@
private string hresultXml;
private string wmXml;
private string svnCommand;
- private string bugUrl;
+ private string bugUrl, WineBugUrl, SambaBugUrl;
private ArrayList commands = new ArrayList();
public TechBotService(IServiceOutput serviceOutput,
@@ -28,7 +28,9 @@
string hresultXml,
string wmXml,
string svnCommand,
- string bugUrl)
+ string bugUrl,
+ string WineBugUrl,
+ string SambaBugUrl)
{
this.serviceOutput = serviceOutput;
this.chmPath = chmPath;
@@ -39,6 +41,8 @@
this.wmXml = wmXml;
this.svnCommand = svnCommand;
this.bugUrl = bugUrl;
+ this.WineBugUrl = WineBugUrl;
+ this.SambaBugUrl = SambaBugUrl;
}
public void Run()
@@ -63,7 +67,9 @@
commands.Add(new SvnCommand(serviceOutput,
svnCommand));
commands.Add(new BugCommand(serviceOutput,
- bugUrl));
+ bugUrl,
+ WineBugUrl,
+ SambaBugUrl));
}
public void InjectMessage(MessageContext context,