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
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