1
0
mirror of https://github.com/deavmi/birchwood synced 2024-09-20 19:22:52 +02:00
Commit Graph

298 Commits

Author SHA1 Message Date
b79a3ad8ee Client
- Now catches `SnoozeError` if a the libsnooze `Event`'s failed to have their `ensure()` call succeed

ErrorType

- Updated description for enum member `INTERNAL_FAILURE`

Sender

- Removed now-completed TODO

Receiver

- Removed now-completed TODO
2023-06-25 17:30:53 +02:00
fe9bf31ad5 Client
- Removed now-completed comments and commented-out-code
2023-06-25 17:13:45 +02:00
ed39b950c3 Merge branch 'master' into bugfix/improve_snoosy 2023-06-25 17:13:00 +02:00
42f63b9e0e Client
- We now catch `EventyException` when calling `initEvents()` from within `connect()` and throw a `BirchwoodException`
2023-06-25 17:12:24 +02:00
9d0a2bc3ce Client
- Documented that `initEvents()` may throw an `EventyException`

ErrorType

- Added new member `INTERNAL_FAILURE` which could occur from errors with `Eventy` when setting up the signal handlers and event types
2023-06-25 17:11:59 +02:00
46e8518b6b Merge branch 'master' into bugfix/improve_snoosy 2023-06-25 17:06:15 +02:00
5488e7902c Receiver
- Removed irrelevant TODO

Sender

- Removed irrelevant TODO
2023-06-25 17:05:36 +02:00
125bb613a7 Receiver
- Removed `hasEnsured` (commented-out already)
- Call `ensure(this)` in constructor
- Removed TODOs relating to ensurance

Sender

- Removed `hasEnsured` (commented-out already)
- Call `ensure(this)` in constructor
- Removed TODOs relating to ensurance
2023-06-25 17:01:52 +02:00
9c77cce487 Client
- Added FIXME
2023-06-24 15:48:31 +02:00
0fc3f060c1 Client
- Let unit test for client call `quit()` eventually
2023-06-21 14:40:58 +02:00
4655584fa5 Client
- Let unit test for client call `quit()` eventually
2023-06-21 14:39:23 +02:00
229a137e34 Messages
- Added unit test for `hasIllegalCharacters(string)`
2023-06-21 14:39:05 +02:00
80a6baf0f9 Client
- `sendMessage(Message)` now uses the new `Message(this).encode(ChecksMode)`
2023-06-21 14:23:12 +02:00
67520c2574 Messages
- Implemented `hasIllegalCharacters(string)` which checks whether the provided input string contains any invalid characters
- Updated `encode()` to `encode(ChecksMode)`
2023-06-21 14:22:48 +02:00
06efa23c85 Messages
- Implemented `stripIllegalCharacters(string)` which provided an input string this will strip any illegal characters present within it
2023-06-21 14:09:32 +02:00
e833cf7a93 ConnectionInfo
- Added `getMode()` and `setMode(ChecksMode)`
2023-06-21 13:49:36 +02:00
5bcbdf72cd ChecksMode
- Defined as the mode describes how birchwood will act when encounterin invalid characters that were provided BY the user TO birchwood

ConnectionInfo

- Use `ChecksMode.EASY` by default
2023-06-21 13:49:22 +02:00
f54e6d9d9b Events
- Documented enum `IRCEventType` and its memers
2023-06-21 13:34:38 +02:00
156af08974 Events
- Documented `PongEvent` and `IRCEvent`
2023-06-21 13:34:02 +02:00
e399b0d504 Messages
- Documented module
2023-06-21 11:28:45 +02:00
4be1e2e1e2 ControlCode
- Removed completed TODO
2023-06-21 11:28:16 +02:00
9a82f9e703 Constants
- Documented module
2023-06-21 11:27:26 +02:00
79981897ff Client
- Cleaned up whitespace
2023-06-21 11:23:41 +02:00
6ea7f0c421 Client
- Fixed documentation of `connect()` method
2023-06-21 11:22:40 +02:00
dfe2110efc Client
- Documented module
- Removed comment for destructor
2023-06-21 11:21:35 +02:00
992808ca5c Events
- Documented module
- Removed now-completed TODO
2023-06-21 11:20:18 +02:00
385e5856c2 Client
- Removed irrelevant TODO
2023-06-21 11:18:42 +02:00
d924a91d21 Sender
- Removed completed TODO
2023-06-21 11:02:45 +02:00
dc5d0f9f4a Receiver
- Catch more specific exception, `FatalException` rather than `SnoozeError`
- Adjusted error message printed out in unittest-builds on occurence of such an exception

Sender

- Catch more specific exception, `FatalException` rather than `SnoozeError`
- Adjusted error message printed out in unittest-builds on occurence of such an exception
2023-06-13 20:30:10 +02:00
f6069ed254 Sender
- When `wait()` has an `InterruptedException` then go back to the loop again (retry the `wait()`)
- On `SnoozeError` (for now) we also do the same even though we should stop the loop

Receiver

- When `wait()` has an `InterruptedException` then go back to the loop again (retry the `wait()`)
- On `SnoozeError` (for now) we also do the same even though we should stop the loop

Dub

- Upgraded to `libsnooze` version `1.0.0-beta`
2023-06-12 17:52:42 +02:00
68a8fc74ae Sender
- Added a TODO to catch the `InterruptedException` here
2023-06-12 08:23:36 +02:00
27704617a7 Receiver
- Added a TODO to catch the `InterruptedException` here
2023-06-12 08:23:22 +02:00
8199b8b2a4 Client
- When the remote host closes the connection and we are in `unittest` build then purposefully crash
2023-06-05 21:04:44 +02:00
2b5da1eb9a Client
- In the `loop()` (the read loop) if built in `unittest` mode then log the read count/status and the current data after the PEEK'd read
2023-06-02 19:29:53 +02:00
cf23797f99 Unit test
- Hang for testing ping-pong
2023-06-01 15:59:38 +02:00
c89ae25502 Client
- Added a comment
2023-04-05 08:27:37 +02:00
19c1c06bc4 Client
- Removed now-completed TODO
2023-04-05 08:26:58 +02:00
a48b515d2e Receiver
- Removed now-completed TODO
2023-04-05 08:26:25 +02:00
fe578c74b8 ConnectioNInfo
- Removed debug print in `getDB(string)`
2023-03-25 14:26:44 +02:00
1da039dcb2 ConnectionInfo
- Added documentation to `T getDB(T)(string)` and `updateDB(string, string)`
2023-03-25 14:26:32 +02:00
4c3afb5027 ConnInfo
- Added documentation for `setDefaults(ref ConnectionInfo)`
- Removed assertion and debug print
2023-03-25 14:24:42 +02:00
357d8ed133 Client
- Clarified behaviour of `hostname==username` in `doAuth(string)`
2023-03-25 14:23:14 +02:00
919e458300 Client
- Added documentation to `doAuth(string)` and `user(string.s tring, string, string)`
2023-03-25 14:20:51 +02:00
a23636483c Client
- Updated comment for call to `doAuth()`
2023-03-25 14:18:51 +02:00
02d25517b9 Client
- `doAuth()` now takes in a default argument `doAuth(string = "bogus.net")`
2023-03-25 14:17:55 +02:00
fa9de6dad5 ConnectionInfo
- Made field `nickname` public
- Added public fields `username` and `realname`
- Updated constructor to take in additional parameters `username` and `realname`

Client

- Calling `connect()` on a `Client` object will now call `doAuth()` which will do `/NICK` and `/USER` for you automatically (no need to do it manually anymore)
- The newly added `doAuth()` will take `hostname=username` from `connInfo.username`, it will set `servername` to `"bogus.net"` and `realname==connInfo.realname`
- Added `user(username, hostname, servername, realname)`
2023-03-25 14:11:03 +02:00
ea3f6ec5cb Client
- Just import `birchwood.config` package rather
- Call `setDefaults(this.connInfo)` to assign default `db` values
- `nick(string)` will now fetch the maximum nickname length and ensure the provided nickname is in said bounds, if not then a `BirchwoodException` with `ErrorType` `NICKNAME_TOO_LONG` is thrown

Unit tests

- Updated unit test to test the updated value of `MAXNICKLEN` (which on BonoboNET is 30)
2023-03-25 13:38:49 +02:00
9ca98ac664 ConnectionInfo
- Updated `string getDB(string)` to `T getDB(T)(string)` which will now attempt conversion to type `T`, on failure to do so it will return `T.init`

ConnInfo

- Added `setDefaults(ref ConnectionInfo)` which will set defaults in the `db`, namely so far it sets the `MAXNICKLEN` to `9` as per rfc1459

Package (`birchwood.config`)

- Now publically imports `setDefaults()`
2023-03-25 13:37:18 +02:00
1015a4ec1c Exceptions
- Added new enum member `NICKNAME_TOO_LONG` to `ErrorType`
2023-03-25 13:35:11 +02:00
9bd8c2814c Merge branch 'master' into ircv3 2023-03-25 13:17:51 +02:00
037118afa9 Client
- Added `nick(string)` command to allow setting of nickname

Unit tests

- Moved from `client.command(Message)` to `client.nick(string)` for setting nickname
2023-03-25 13:11:58 +02:00
245939824e Client
- Log which key-value pair was added
2023-03-25 13:07:53 +02:00
5979387e87 Client
- Removed testing code that looped through a separate `db`-like structure
2023-03-25 13:06:06 +02:00
03c887c39a ConnInfo
- Removed TODO for `getDB(string)`
2023-03-25 13:05:35 +02:00
fdcbcfeda4 ConnInfo
- `getDB(string)` will now throw `BirchwoodException` with `ErrorType.DB_KEY_NOT_FOUND` if the key is not found

Exceptions

- Added member `DB_KEY_NOT_FOUND` to `ErrorType` enum
2023-03-25 13:05:04 +02:00
c53fc034d2 Client
- Update the `ConnInfo`'s `db` on `RPL_ISUPPORT`
2023-03-25 13:01:35 +02:00
357deeb5e4 ConnInfo
- Added a `string[string]` key-value pair named `db` to hold the parameters learnt from `RPL_ISUPPORT`s
- Added `updateDB(string, string)` to add an entry to the `db`
- Added `getDB(string)` to fetch a value from the `db` (if it doesn't exist then an empty string `""` is returned)
2023-03-25 13:01:02 +02:00
b3f102276a Merge branch 'master' into ircv3 2023-03-25 12:48:38 +02:00
3c347853e4 Client
- Cleaned up
2023-03-25 12:44:47 +02:00
3846c0b56a Merge branch 'master' into ircv3 2023-03-24 16:05:15 +02:00
680f245b4a Unit tests
- Added cmobined eample that resets background color
2023-03-24 16:02:30 +02:00
70b7b89e18 Unit tests
- Test `setForegroundBackground(SimpleColor, SimpleColor)`
2023-03-24 15:58:15 +02:00
f56c6eb7dc Unit tests
- Tested `setForeground(SimpleColor)`
2023-03-24 15:52:47 +02:00
9cd4b910ac Formatting
- Added a documentation comment to each member of `ControlCode`
2023-03-24 15:44:59 +02:00
89fbd3adf9 Formatting
- Use `cast(string)` instead of any `.dup` or `.idup`
- Removed TODO
- Removed `pragma(inline)`s
2023-03-24 15:43:28 +02:00
37b568c21d - Renamed method 2023-03-19 16:14:23 +02:00
6aa314603c - Documented 2023-03-19 16:14:09 +02:00
2e5ff166a6 God I hate git, added all work I did back now 2023-03-19 16:12:39 +02:00
2f0d370c0b bruh 2023-03-19 16:06:44 +02:00
9e356289b5 Merge branch 'master' into formatting 2023-03-19 16:03:36 +02:00
dc9a247d54 Merge branch 'master' into ircv3 2023-03-19 15:51:19 +02:00
301cc64cca Exceptions
- Added a TODO
2023-03-19 15:51:10 +02:00
0296cc333c Formatting
- Cleaned up code style
2023-03-19 12:37:35 +02:00
927d10abff Formatting
- Added some TODOs
- Code formatting
- Added some documentation
2023-03-19 12:34:20 +02:00
9cd5b7da2c Merge branch 'master' into formatting 2023-03-19 12:25:04 +02:00
b2d7250f49 Merge branch 'master' into ircv3 2023-03-19 12:24:49 +02:00
58d3be3806 Client
- Don't make this member appear in docs (hopefully) - by marking it as `package

Messages

- Don't make this member appear in docs (hopefully) - by marking it as `package
2023-03-19 12:24:11 +02:00
51a04659c5 Exceptions
- Added new `ErrorType` enum member `INVALID_FORMATTING`

Formatting

- All formatting functions will now throw a `BirchwoodException` instead of a `StringException` on invalid formatting parameters
2023-03-19 12:19:32 +02:00
1ca052978b CLient
- Updated unit test to test combining of formatting
2023-03-19 12:13:54 +02:00
033ea850f3 Formatting
- Explicitly make the formatting functions `public`

Client

- Added unit tests for formatting functions
2023-03-19 12:08:44 +02:00
208cfebf49 Formatting
- Added TODO for import `std.string`
-  Added documentation to `SimpleColor` enum
- Added documentation and code-styled `reset_fg_bg()`, `bold(string)`, `italics(string)`, `underline(string)`, `strikethrough(string)` and `monospace(string)`
2023-03-19 11:58:44 +02:00
71d30039da Formatting
- Changed name of enum `simpleColor` to `SimpleColor` to adhere to D naming conventions
2023-03-18 13:05:57 +02:00
9fe4185636 Merge branch 'master' into ircv3 2023-03-18 13:04:38 +02:00
8fccde71e2 Formatting
- Added documentation for module
2023-03-18 13:00:03 +02:00
267f888615
Merge pull request #7 from supremestdoggo/master
Add IRC formatting codes
2023-03-18 12:53:47 +02:00
8d1fbbdece Merge branch 'master' into ircv3 2023-03-18 12:30:10 +02:00
de35d611f7 Client
- Made the `connInfo` field `package` level
- Made the `connInfo` field `shared` meaning access to teh variable (updating the "slot", a.k.a. what struct is stored there) will use a lock
- Updating anything within the struct will use a lock (besides `addrInfo` after returning from `getAddr()`)
- This ensures we can have runtime updates safely
- Added documentation to the constructor
- Added TODO for the destructor
- Re-added `getConnInfo()`
- This practice is good for cases we want to update the struct, as getting it via a function would return a copy

ConnInfo

- `ConnectionInfo` struct must now be marked as `shared` due to `Client.connInfo` being marked as such
- We cast from `shared Address` to `Address` because I don't think there is a lot of mutable data in this anyways (subject to change)

Sender

- The `SenderThread` will now access the client's connection info via the field name (`connInfo`), rather than getting a copy of the struct and then fetching the fakelag
2023-03-18 12:29:35 +02:00
aa83f1a1bb ConnInfo
- Added `setBulkReadSize(ulong)` to `ConnectionInfo`
2023-03-18 11:50:54 +02:00
2ab86df2c7 Client
- Documented the `sender` field
2023-03-18 11:47:54 +02:00
b19a7a52d6 Client
- Added missing documentation for `Client` type
2023-03-18 11:47:06 +02:00
17c81bd1b0 Client
- Store all learnt key-value pairs into `string[string] attrs` for now
2023-03-18 11:45:38 +02:00
ece8593b60 Merge branch 'master' into ircv3 2023-03-18 11:38:59 +02:00
603e636c2a Client
- Removed stray comment
2023-03-18 11:38:54 +02:00
4b43174c20 Client
- Print the key-value pairs from `RPL_ISUPPORT` out
2023-03-18 11:38:38 +02:00
1a89396ba8 Messages
- Temporarily disabled Dlog `debug_` calls
2023-03-18 11:38:12 +02:00
c6a74d3cee Merge branch 'master' into ircv3 2023-03-18 11:33:24 +02:00
ee3cacc244 Unit test
- Added notes about the fact we should be automating the `NICK` and `USER` commands on connect
2023-03-18 11:31:55 +02:00
6688d6dfdf Config
- Documented package module

Client

- Documented package module

Protocol

- Documented package module

Birchwood

- Documented package module
2023-03-18 11:29:41 +02:00
cb56a4d9f4 ConnInfo
- Clean up comment
2023-03-18 11:25:39 +02:00
bd16cc145c Unit tests
- Fixed usage of `ErrorType`
2023-03-18 11:24:52 +02:00