1
0
mirror of https://github.com/deavmi/birchwood synced 2024-09-20 11:43:22 +02:00

Merge branch 'master' into bugfix/shutdown

This commit is contained in:
Tristan B. Velloza Kildaire 2023-06-28 08:34:06 +02:00
commit 725672dfa7

View File

@ -427,15 +427,25 @@ public class Client : Thread
*
* Params:
* channel = the channel to leave
* Throws:
* `BirchwoodException` if the channel name
* is invalid
*/
public void leaveChannel(string channel)
{
// TODO: Add check for valid and non-empty channel names
/* Ensure the channel name contains only valid characters */
if(isValidText(channel))
{
/* Leave the channel */
Message leaveMessage = new Message("", "PART", channel);
sendMessage(leaveMessage);
}
/* If invalid characters were present */
else
{
throw new BirchwoodException(ErrorType.ILLEGAL_CHARACTERS);
}
}
/**
* Sends a direct message to the intended recipients
@ -645,13 +655,11 @@ public class Client : Thread
}
else
{
//TODO: Invalid channel name
throw new BirchwoodException(ErrorType.INVALID_CHANNEL_NAME);
}
}
else
{
//TODO: Illegal characters
throw new BirchwoodException(ErrorType.ILLEGAL_CHARACTERS);
}
}