mirror of https://github.com/deavmi/birchwood
Compare commits
3 Commits
3e01ef17d6
...
6a394ad4e8
Author | SHA1 | Date |
---|---|---|
Tristan B. Velloza Kildaire | 6a394ad4e8 | |
Tristan B. Velloza Kildaire | 565d6b10d8 | |
Tristan B. Velloza Kildaire | f5b0fe5118 |
|
@ -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).
|
||||
|
|
2
dub.json
2
dub.json
|
@ -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",
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue