New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ChatService refactoring #1336
Comments
Ok, i looked into the ChatService (which is the "problem") and the ChatController (which seems to be the owner/"root" of all Chat related things) and here are some more observations: For some parts of the chat, UI state is held directly inside ChatController, while other state is held inside Service classes (PircBotXChatService), specifically:
While this for itself could be reasonable, since ChatController owns/has dependency on PircBotXChatService, it seems like PircBotXChatService is actually supposed to be the IRC specific stuff (i infer that from the fact that "ChatService" is a pretty generic name while it deals with all the IRC stuff under the hood). These two roles of the current ChatService implementation need to be separated imo. So we probably end up with something like:
However im pretty sure we still end up with a bunch of stuff that is
Any thoughts on this? |
Ok, i started implementing this and have a pretty good feeling about the proposed changes. |
Stale |
Just letting you guys know that I am currently working on a refactoring that basically touches all of
PircBotXChatService
. This is the current IRC implementation forChatService
.I decided to try and split that class into stuff that is related to
PircBotX
and stuff that is not (IRC independent). Stuff that isn't calls the newPircBotXChatService
through an IRC independant interface (which may get the nameChatConnector
or something). This way ONLY the actual IRC stuff is behindChatConnector
, while the stuff that would be needed for any chat implementation is inside the new classChatServiceImpl
.I may also make it more clear what the connected channels SHOULD be (vs which may be connected at a certain moment), maybe this allows me to ge to get rid of some awkward flags and make it easy to get from bad states/disconnect to proper proper channel state better.
There are no functionality changes. but this should for example make it easy to instantly join channels when editing saved auto channels or similar fun stuff in the future. Also should make it easier to swap out the IRC implementation by reimplementing only
ChatConnector
instead of entire ChatService.This refactoring will not be able to hide IRC entirly, because the
ChatService
interface would need to change for that (because it exposes IRC specific stuff likewhois()
method) and i am not changing that interface for now.The text was updated successfully, but these errors were encountered: