tiny icon indicating copy to clipboard operation
tiny copied to clipboard

Add support for /whois command

Open prateeknischal opened this issue 3 years ago • 10 comments

Add support for the /whois command using the raw_msg function on the connection for the particular server.

prateeknischal avatar Jul 03 '21 20:07 prateeknischal

Sorry for missing this @prateeknischal. Given that it's easy to send a raw message to a server (just send the message in the server tab), I'm not sure if adding more code for simple commands like this is worth it. For the WHOIS command you can just send WHOIS nick in the server tab.

If we start adding commands for simple IRC commands like this, then for completeness we will probably want LIST, RULES, ... not sure if that's necessary.

WDYT? cc @trevarj

osa1 avatar Aug 06 '21 06:08 osa1

Not the first time this was asked for, due to the ability to autocomplete a username after /whois .... Therefore, I think it's ok to add. It seems that irssi supports all the commands 🤷🏻‍♂️

trevarj avatar Aug 06 '21 06:08 trevarj

Hi @osa1 , As @trevarj mentioned, irssi supports a lot of commands and that's why I had the thought of adding it to tiny, to enhance the UX for the client. If this seems redundant, then we can close this PR :)

prateeknischal avatar Aug 06 '21 08:08 prateeknischal

Note: Relates to #294

trevarj avatar Aug 13 '21 19:08 trevarj

ability to autocomplete a username after /whois ....

I think this is a good idea, I'm convinced. However there's a bit of an UX issue with this implementation. If I run /whois osa1 in channel #tiny, I get the response in the server tab. Shouldn't I see it in the same tab that I ran the command in?

osa1 avatar Aug 17 '21 08:08 osa1

get the response in the server tab

This makes sense to me, since I wouldn't want the WHOIS response to flood the chan tab, even though it is only 6-7 lines.

trevarj avatar Aug 17 '21 08:08 trevarj

This makes sense to me, since I wouldn't want the WHOIS response to flood the chan tab, even though it is only 6-7 lines.

I'm not sure. If I run a command in a tab I expect the response in the same tab, unless the command creates a new tab (e.g. /msg).

Imagine a new user trying this command. It's possible they won't even realize that the response is in the server tab.

osa1 avatar Aug 17 '21 08:08 osa1

It's possible they won't even realize that the response is in the server tab.

Ok, good point. I did not try this yet, but I would expect it to work like doing /msg chanserv help in a chan tab --> the server tab actually tags you and the tab name highlights bold. Maybe /whois should work the same as that?

trevarj avatar Aug 17 '21 08:08 trevarj

the server tab actually tags you and the tab name highlights bold. Maybe /whois should work the same as that?

Maybe. We could also automatically switch to the server tab. I'd prefer showing the response in the same tab though.

osa1 avatar Aug 17 '21 09:08 osa1

I'd prefer showing the response in the same tab though.

Ok, in that case, we need to handle the WHOIS replies to direct them to CurrentTab:

cmd: Reply { num: 311, params: ["tester100", "trev", "~trev", "user/trev", "*", "t"] } }
cmd: Reply { num: 312, params: ["tester100", "trev", "zinc.libera.chat", "Espoo, FI"] } }
cmd: Reply { num: 671, params: ["tester100", "trev", "is using a secure connection"] } }
cmd: Reply { num: 317, params: ["tester100", "trev", "12164", "1629179930", "seconds idle, signon time"] } }
cmd: Reply { num: 330, params: ["tester100", "trev", "trev", "is logged in as"] } }
cmd: Reply { num: 318, params: ["tester100", "trev", "End of /WHOIS list."] } }

trevarj avatar Aug 17 '21 09:08 trevarj