1
0
Fork 0
forked from murx/irc9

Remove channels from the tree after leaving

This commit is contained in:
Johannes Findeisen 2026-11-27 20:38:00 +01:00
commit 61822435f4
2 changed files with 9 additions and 3 deletions

10
irc9.c
View file

@ -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;
}