mirror of
https://github.com/deavmi/birchwood
synced 2024-09-20 01:43:50 +02:00
Client
- Fixed bug in `channelMessage(string, string[])` in the case where multiple channels were specified then the message would fail to send to the channels after the first one specified Unit tests - Disabled using `command(string, string, string)` to join a channel, rather use `joinChannel(string)` - Added tests for singular `channelMessage(string, string[])` and multiple `channelMessage(string, string[])`
This commit is contained in:
parent
6f0a9e32ca
commit
fe91adde0a
@ -507,6 +507,9 @@ public class Client : Thread
|
|||||||
/* Ensure valid characters in first channel */
|
/* Ensure valid characters in first channel */
|
||||||
if(isValidText(channelLine))
|
if(isValidText(channelLine))
|
||||||
{
|
{
|
||||||
|
/* Append on a trailing `,` */
|
||||||
|
channelLine ~= ",";
|
||||||
|
|
||||||
for(ulong i = 1; i < channels.length; i++)
|
for(ulong i = 1; i < channels.length; i++)
|
||||||
{
|
{
|
||||||
string currentChannel = channels[i];
|
string currentChannel = channels[i];
|
||||||
@ -1177,7 +1180,10 @@ public class Client : Thread
|
|||||||
client.command(new Message("", "USER", "doggie doggie irc.frdeenode.net :Tristan B. Kildaire"));
|
client.command(new Message("", "USER", "doggie doggie irc.frdeenode.net :Tristan B. Kildaire"));
|
||||||
|
|
||||||
Thread.sleep(dur!("seconds")(4));
|
Thread.sleep(dur!("seconds")(4));
|
||||||
client.command(new Message("", "JOIN", "#birchwood"));
|
// client.command(new Message("", "JOIN", "#birchwood"));
|
||||||
|
client.joinChannel("#birchwood");
|
||||||
|
// TODO: Add a joinChannels(string[])
|
||||||
|
client.joinChannel("#birchwood2");
|
||||||
|
|
||||||
Thread.sleep(dur!("seconds")(2));
|
Thread.sleep(dur!("seconds")(2));
|
||||||
client.command(new Message("", "NAMES", ""));
|
client.command(new Message("", "NAMES", ""));
|
||||||
@ -1188,6 +1194,17 @@ public class Client : Thread
|
|||||||
Thread.sleep(dur!("seconds")(2));
|
Thread.sleep(dur!("seconds")(2));
|
||||||
client.command(new Message("", "PRIVMSG", "deavmi naai"));
|
client.command(new Message("", "PRIVMSG", "deavmi naai"));
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test sending a message to a channel
|
||||||
|
*/
|
||||||
|
client.channelMessage("This is a test message sent to a channel", ["#birchwood"]);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test sending a message to multiple channels
|
||||||
|
*/
|
||||||
|
client.channelMessage("This is a message sent to multiple channels one-shot", ["#birchwood", "#birchwood2"]);
|
||||||
|
|
||||||
/* TODO: Add a check here to make sure the above worked I guess? */
|
/* TODO: Add a check here to make sure the above worked I guess? */
|
||||||
/* TODO: Make this end */
|
/* TODO: Make this end */
|
||||||
// while(true)
|
// while(true)
|
||||||
|
Loading…
Reference in New Issue
Block a user