Compare commits

...

3 Commits

3 changed files with 30 additions and 1 deletions

View File

@ -26,6 +26,13 @@ To add birchwood to your project simply run:
dub add birchwood
```
### Dependencies
Birchwood dependends on the following D libraries:
* `eventy` (0.3.2)
* `dlog` (0.0.6)
## Usage
You can take a look at the `Client` API documentation on [DUB](https://birchwood.dpldocs.info/birchwood.client.Client.html).

View File

@ -5,7 +5,7 @@
"copyright": "Copyright © 2022, Tristan B. Kildaire",
"dependencies": {
"dlog": "~>0.0.6",
"eventy": "0.2.5"
"eventy": "0.3.2"
},
"description": "A sane IRC framework for the D language",
"license": "LGPL-3.0",

View File

@ -45,6 +45,28 @@ public static string decodeMessage(ubyte[] messageIn)
// return null;
}
/**
* Checks if the provided message is valid (i.e.)
* does not contain any CR or LF characters in it
*
* Params:
* message = the message to test
* Returns: <code>true</code> if the message is valid,
* <code>false</code> false otherwise
*/
public static bool isValidText(string message)
{
foreach(char character; message)
{
if(character == 13 || character == 10)
{
return false;
}
}
return true;
}
/**
* Message types
*/