mirror of
https://github.com/deavmi/birchwood
synced 2024-09-20 13:43:19 +02:00
Merge branch 'master' into bugfix/shutdown
This commit is contained in:
commit
725672dfa7
@ -427,15 +427,25 @@ public class Client : Thread
|
|||||||
*
|
*
|
||||||
* Params:
|
* Params:
|
||||||
* channel = the channel to leave
|
* channel = the channel to leave
|
||||||
|
* Throws:
|
||||||
|
* `BirchwoodException` if the channel name
|
||||||
|
* is invalid
|
||||||
*/
|
*/
|
||||||
public void leaveChannel(string channel)
|
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 */
|
/* Leave the channel */
|
||||||
Message leaveMessage = new Message("", "PART", channel);
|
Message leaveMessage = new Message("", "PART", channel);
|
||||||
sendMessage(leaveMessage);
|
sendMessage(leaveMessage);
|
||||||
}
|
}
|
||||||
|
/* If invalid characters were present */
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new BirchwoodException(ErrorType.ILLEGAL_CHARACTERS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends a direct message to the intended recipients
|
* Sends a direct message to the intended recipients
|
||||||
@ -645,13 +655,11 @@ public class Client : Thread
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//TODO: Invalid channel name
|
|
||||||
throw new BirchwoodException(ErrorType.INVALID_CHANNEL_NAME);
|
throw new BirchwoodException(ErrorType.INVALID_CHANNEL_NAME);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//TODO: Illegal characters
|
|
||||||
throw new BirchwoodException(ErrorType.ILLEGAL_CHARACTERS);
|
throw new BirchwoodException(ErrorType.ILLEGAL_CHARACTERS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user