<add key="WinerrorXml" value="C:\IRC\TechBot\winerror.xml" />\r
<add key="HresultXml" value="C:\IRC\TechBot\hresult.xml" />\r
<add key="WmXml" value="C:\IRC\TechBot\wm.xml" />\r
- <add key="SvnCommand" value="svn co svn://svn.reactos.com/trunk/reactos" />\r
- <add key="BugUrl" value="www.reactos.org/bugzilla/show_bug.cgi?id={0}" />\r
+ <add key="SvnCommand" value="svn co svn://svn.reactos.org/trunk/reactos" />\r
+ <add key="BugUrl" value="http://www.reactos.org/bugzilla/show_bug.cgi?id={0}" />\r
+ <add key="WineBugUrl" value="http://bugs.winehq.org/show_bug.cgi?id={0}" />\r
+ <add key="SambaBugUrl" value="https://bugzilla.samba.org/show_bug.cgi?id={0}" />\r
</appSettings>\r
</configuration>\r
}\r
}\r
\r
+ private static string WineBugUrl\r
+ {\r
+ get\r
+ {\r
+ string optionName = "WineBugUrl";\r
+ string s = ConfigurationSettings.AppSettings[optionName];\r
+ VerifyRequiredOption(optionName,\r
+ s);\r
+ return s;\r
+ }\r
+ }\r
+\r
+\r
+ private static string SambaBugUrl\r
+ {\r
+ get\r
+ {\r
+ string optionName = "SambaBugUrl";\r
+ string s = ConfigurationSettings.AppSettings[optionName];\r
+ VerifyRequiredOption(optionName,\r
+ s);\r
+ return s;\r
+ }\r
+ }\r
+\r
+\r
private static void RunIrcService()\r
{\r
IrcService ircService = new IrcService(IRCServerHostName,\r
HresultXml,\r
WmXml,\r
SvnCommand,\r
- BugUrl);\r
+ BugUrl,\r
+ WineBugUrl,\r
+ SambaBugUrl);\r
ircService.Run();\r
}\r
\r
HresultXml,\r
WmXml,\r
SvnCommand,\r
- BugUrl);\r
+ BugUrl,\r
+ WineBugUrl,\r
+ SambaBugUrl);\r
service.Run();\r
while (true)\r
{\r
public class BugCommand : BaseCommand, ICommand\r
{\r
private IServiceOutput serviceOutput;\r
- private string bugUrl;\r
+ private string RosBugUrl;\r
+ private string WineBugUrl;\r
+ private string SambaBugUrl;\r
\r
public BugCommand(IServiceOutput serviceOutput,\r
- string bugUrl)\r
+ string RosBugUrl,\r
+ string WineBugUrl,\r
+ string SambaBugUrl)\r
{\r
this.serviceOutput = serviceOutput;\r
- this.bugUrl = bugUrl;\r
+ this.RosBugUrl = RosBugUrl;\r
+ this.WineBugUrl = WineBugUrl;\r
+ this.SambaBugUrl = SambaBugUrl;\r
}\r
\r
public bool CanHandle(string commandName)\r
bugText));\r
return;\r
}\r
+ \r
+ string bugUrl = this.RosBugUrl;\r
\r
+ if (context is ChannelMessageContext)\r
+ {\r
+ ChannelMessageContext channelContext = context as ChannelMessageContext;\r
+ if (channelContext.Channel.Name == "winehackers")\r
+ bugUrl = this.WineBugUrl;\r
+ else if (channelContext.Channel.Name == "samba-technical")\r
+ bugUrl = this.SambaBugUrl;\r
+ }\r
+ \r
serviceOutput.WriteLine(context,\r
String.Format(bugUrl, bug));\r
}\r
private string hresultXml;\r
private string wmXml;\r
private string svnCommand;\r
- private string bugUrl;\r
+ private string bugUrl, WineBugUrl, SambaBugUrl;\r
private IrcClient client;\r
private ArrayList channels = new ArrayList(); /* IrcChannel */\r
private TechBotService service;\r
string hresultXml,\r
string wmXml,\r
string svnCommand,\r
- string bugUrl)\r
+ string BugUrl,\r
+ string WineBugUrl,\r
+ string SambaBugUrl)\r
{\r
this.hostname = hostname;\r
this.port = port;\r
this.hresultXml = hresultXml;\r
this.wmXml = wmXml;\r
this.svnCommand = svnCommand;\r
- this.bugUrl = bugUrl;\r
+ this.bugUrl = BugUrl;\r
+ this.WineBugUrl = WineBugUrl;\r
+ this.SambaBugUrl = SambaBugUrl;\r
}\r
\r
public void Run()\r
hresultXml,\r
wmXml,\r
svnCommand,\r
- bugUrl);\r
+ bugUrl,\r
+ WineBugUrl,\r
+ SambaBugUrl);\r
service.Run();\r
\r
client = new IrcClient();\r
private string hresultXml;\r
private string wmXml;\r
private string svnCommand;\r
- private string bugUrl;\r
+ private string bugUrl, WineBugUrl, SambaBugUrl;\r
private ArrayList commands = new ArrayList();\r
\r
public TechBotService(IServiceOutput serviceOutput,\r
string hresultXml,\r
string wmXml,\r
string svnCommand,\r
- string bugUrl)\r
+ string bugUrl,\r
+ string WineBugUrl,\r
+ string SambaBugUrl)\r
{\r
this.serviceOutput = serviceOutput;\r
this.chmPath = chmPath;\r
this.wmXml = wmXml;\r
this.svnCommand = svnCommand;\r
this.bugUrl = bugUrl;\r
+ this.WineBugUrl = WineBugUrl;\r
+ this.SambaBugUrl = SambaBugUrl;\r
}\r
\r
public void Run()\r
commands.Add(new SvnCommand(serviceOutput,\r
svnCommand));\r
commands.Add(new BugCommand(serviceOutput,\r
- bugUrl));\r
+ bugUrl,\r
+ WineBugUrl,\r
+ SambaBugUrl));\r
}\r
\r
public void InjectMessage(MessageContext context,\r
<add key="HresultXml" value="C:\IRC\TechBot\hresult.xml" />\r
<add key="WmXml" value="C:\IRC\TechBot\wm.xml" />\r
<add key="SvnCommand" value="svn co svn://svn.reactos.org/trunk/reactos" />\r
- <add key="BugUrl" value="www.reactos.org/bugzilla/show_bug.cgi?id={0}" />\r
+ <add key="BugUrl" value="http://www.reactos.org/bugzilla/show_bug.cgi?id={0}" />\r
+ <add key="WineBugUrl" value="http://bugs.winehq.org/show_bug.cgi?id={0}" />\r
+ <add key="SambaBugUrl" value="https://bugzilla.samba.org/show_bug.cgi?id={0}" />\r
</appSettings>\r
</configuration>\r
private string WmXml;\r
private string WinerrorXml;\r
private string SvnCommand;\r
- private string BugUrl;\r
+ private string BugUrl, WineBugUrl, SambaBugUrl;\r
private EventLog eventLog;\r
\r
public ServiceThread(EventLog eventLog)\r
WinerrorXml = ConfigurationSettings.AppSettings["WinerrorXml"];\r
SvnCommand = ConfigurationSettings.AppSettings["SvnCommand"];\r
BugUrl = ConfigurationSettings.AppSettings["BugUrl"];\r
+ WineBugUrl = ConfigurationSettings.AppSettings["WineBugUrl"];\r
+ SambaBugUrl = ConfigurationSettings.AppSettings["SambaBugUrl"];\r
}\r
\r
public void Run()\r
HresultXml,\r
WmXml,\r
SvnCommand,\r
- BugUrl);\r
+ BugUrl,\r
+ WineBugUrl,\r
+ SambaBugUrl);\r
ircService.Run();\r
}\r
\r