Different output for !bug command on the other channels. (#winehackers, #samba-technical)

svn path=/trunk/; revision=20590
This commit is contained in:
Maarten Bosma
2006-01-05 21:46:24 +00:00
parent 8218812468
commit 6de3d3ca11
7 changed files with 84 additions and 17 deletions

View File

@@ -5,13 +5,19 @@ namespace TechBot.Library
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 @@ namespace TechBot.Library
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));
}

View File

@@ -19,7 +19,7 @@ namespace TechBot.Library
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 @@ namespace TechBot.Library
string hresultXml,
string wmXml,
string svnCommand,
string bugUrl)
string BugUrl,
string WineBugUrl,
string SambaBugUrl)
{
this.hostname = hostname;
this.port = port;
@@ -54,7 +56,9 @@ namespace TechBot.Library
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 @@ namespace TechBot.Library
hresultXml,
wmXml,
svnCommand,
bugUrl);
bugUrl,
WineBugUrl,
SambaBugUrl);
service.Run();
client = new IrcClient();

View File

@@ -17,7 +17,7 @@ namespace TechBot.Library
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 @@ namespace TechBot.Library
string hresultXml,
string wmXml,
string svnCommand,
string bugUrl)
string bugUrl,
string WineBugUrl,
string SambaBugUrl)
{
this.serviceOutput = serviceOutput;
this.chmPath = chmPath;
@@ -39,6 +41,8 @@ namespace TechBot.Library
this.wmXml = wmXml;
this.svnCommand = svnCommand;
this.bugUrl = bugUrl;
this.WineBugUrl = WineBugUrl;
this.SambaBugUrl = SambaBugUrl;
}
public void Run()
@@ -63,7 +67,9 @@ namespace TechBot.Library
commands.Add(new SvnCommand(serviceOutput,
svnCommand));
commands.Add(new BugCommand(serviceOutput,
bugUrl));
bugUrl,
WineBugUrl,
SambaBugUrl));
}
public void InjectMessage(MessageContext context,