Remove channels from the tree after leaving
This commit is contained in:
parent
820ae7f855
commit
61822435f4
2 changed files with 9 additions and 3 deletions
|
|
@ -128,7 +128,7 @@ instead.
|
|||
| --- | --- |
|
||||
| `/join #chan` | join a channel |
|
||||
| `/n [chan]` / `/names [chan]` | show a channel's nicklist (default: current window) |
|
||||
| `/part [#chan] [reason]` / `/leave [#chan] [reason]` | leave the current or given channel |
|
||||
| `/part [#chan] [reason]` / `/leave [#chan] [reason]` | leave the current or given channel and remove it from the tree |
|
||||
| `/nick newnick` | change nickname |
|
||||
| `/msg nick text` | send a private message |
|
||||
| `/notice target text` | send a notice |
|
||||
|
|
|
|||
10
irc9.c
10
irc9.c
|
|
@ -1147,10 +1147,16 @@ static void handle_line(Server *s, char *line)
|
|||
|
||||
if (strcasecmp(cmd, "PART") == 0) {
|
||||
if (narg < 1) return;
|
||||
Window *w = window_get(s, arg[0], W_CHANNEL);
|
||||
member_remove(w, nick);
|
||||
char why[MAXLINE];
|
||||
if (narg > 1) snprintf(why, sizeof why, " (%s)", arg[1]); else why[0] = 0;
|
||||
Window *w;
|
||||
if (strcasecmp(nick, s->nick) == 0) {
|
||||
window_close(s, window_find(s, arg[0]));
|
||||
w = sw;
|
||||
} else {
|
||||
w = window_get(s, arg[0], W_CHANNEL);
|
||||
member_remove(w, nick);
|
||||
}
|
||||
appendf(w, "* %s left %s%s", hostmask ? hostmask : "someone", arg[0], why);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue