Closed djkaty closed 8 years ago
To be honest, the MessageType thing was a mistake in the library and should go away (or be ignored for now) :-D It is a leftover from the Net_SmartIRC code that I ported from PHP to C#
It was only there because you couldn't easily tell why you received a callback in the PHP code... In C# you know which event was raised as your callback is specific to the event.
For the other 2 things, I will have to think about it.
What you did in TwitchIrcClient is basically what I had in mind, that looks good, but I try to get rid of the "legacy" stuff
Okay, I can remove the Message stuff from the Twitch code easily and you can presumably remove it altogether from the main branch. I'll wait for you to let me know on the other items before I make any more changes or merge any of the other new features.
(I couldn't find anywhere appropriate to post this on GitHub, so...)
While you are thinking, regarding WebSockets: currently the Connect() takes an extra optional bool specifying whether to negotiate a WebSocket connection or not. The code is lightly peppered in "if (_IsWebSocket)" type stuff (mainly in Connect(), ReadLine() and WriteLine()). Before I make a branch for this, do you prefer:
I slightly favour option 2 but I'll glue it together however you like :)
To discuss changes best is to create a new issue on GitHub, else we will mix the Twitch review with unrelated changes. We had already issues with alternative socket handling because there is currently no abstraction for the socket handling. Another issue is that someone else already worked on trying to streamline the socket handling code since SmartIrc4net has currently some code duplication there, but it wasn't finished/merge yet see #31 but it would be a good idea to finish that one first, else your WebSocket will conflict with that.
The WebSockets issue can be found in #35 now
I've reviewed the ReceiveType and ReplyCode types/parameters and although they can be removed, i think for clarity of the source code and the user there is no harm leaving them in. I propose therefore that derived classes of IrcClient just ignore them and the base class can set them to Unknown by default. Do you agree?
Yes, the ReceiveType can stay with Unknown by default. This field should be marked as [Deprecated] so that people check for ReplyCode instead, which is the official IRC way to know what the reply is about if there is no high-level event available in IrcClient for that.
This is a roll-up of the previous ROOMSTATE and USERSTATE support and the other Twitch tweaks that I hadn't committed yet, re-formulated as a derived class.
So a few matters arising from the implementation depending how you want to do it.
Katy.