Add support for WHOIS command on IRCListener#159
Open
3V3RYONE wants to merge 4 commits into
Open
Conversation
Contributor
|
@3V3RYONE Can you mention the client you were using to test? It seems like irssi from the screenshot. |
Contributor
Author
|
Hey @tinajn , yup I used irssi as the client! |
tinajn
reviewed
Mar 31, 2023
Contributor
|
Could you also add a test for the WHOIS command to test.py? |
Contributor
Author
|
Surely, getting back to work on this issue latest by Monday! Will add the tests too :) |
Contributor
Author
|
Tested the WHOIS command, works well with the new changes 🎉 Note
Before WHOIS
After WHOIS
|
Contributor
|
Thank you @3V3RYONE. In the process of testing code with an IRC client. Will merge once I have tested. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


This PR fixes #35
Cause of Bug
The reason of this
unknown commandbug is because there is no specific function infakenet/listeners/IRCListener.pythat deals with theWHOIScommand. Therefore, whenever theWHOIScommand is executed, the current code executes theirc_DEFAULTfunction infakenet/listeners/IRCListener.py, that displays theunknown commandmessage as output.Fix
I went ahead and defined a function with the name
irc_WHOISwhich deals with theWHOIScommand. I analyzed the ideal output ofWHOIScommand (executed without fakenet running), and then added the respective fields in theirc_WHOISfunction to replicate the same output.Before
27/03/23 01:45:34 PM [ IRCServer] Client issued an unknown command WHOIS IEUserAfter

Note
While the output is working as expected, there is one side effect. The WHOIS command's output keeps on printing in a forever loop at the client side, even though it is executed once. While I am trying to work on this issue and fix it, I would love any help to proceed in the right direction. Thank you! :)