1
0
Fork 0
forked from murx/irc9

Close private chats with bare /query

This commit is contained in:
Johannes Findeisen 2026-11-27 20:47:05 +01:00
commit fd74e04fb1
2 changed files with 4 additions and 3 deletions

View file

@ -132,7 +132,7 @@ instead.
| `/nick newnick` | change nickname |
| `/msg nick text` | send a private message |
| `/notice target text` | send a notice |
| `/query nick` | open or focus a private-message window |
| `/query [nick]` | open or focus a private-message window, or close the current private chat with no nick |
| `/whois nick` | show server information about a nick |
| `/who [mask]` | request a user list |
| `/me text` | send a CTCP ACTION |

5
irc9.c
View file

@ -1834,8 +1834,9 @@ static void do_command(char *line)
appendf(w, "-%s- %s", curwin->srv->nick, q);
} else if (strcasecmp(cmd, "query") == 0) {
char *nick = next_word(&q);
if (!nick || !curwin) return;
focus_window(window_get(curwin->srv, nick, W_QUERY));
if (!curwin) return;
if (nick) focus_window(window_get(curwin->srv, nick, W_QUERY));
else if (curwin->type == W_QUERY) window_close(curwin->srv, curwin);
} else if (strcasecmp(cmd, "who") == 0) {
if (!curwin) return;
curwin->srv->reply_win = curwin;