AmendHub

Download:

jcs

/

wallops

/

amendments

/

60

irc: Implement 900, use default quit message of our version


jcs made amendment 60 3 months ago
--- irc.c Fri Aug 30 09:58:26 2024 +++ irc.c Wed Sep 4 14:23:27 2024 @@ -644,15 +644,17 @@ irc_process_server(struct irc_connection *conn) } if (strcmp(msg.cmd, "QUIT") == 0) { user = irc_parse_user(msg.source); + SLIST_FOREACH(channel, &conn->channels_list, list) { if (!irc_nick_is_in_channel(channel, user->nick)) continue; - + irc_remove_nick_from_channel(channel, user->nick); chatter_printf(conn->chatter, conn, channel, "$B*** %s ($0%s@%s$B)$0 has quit:$/ %s", user->nick, user->username, user->hostname, msg.msg); } + if (strcmp(user->nick, conn->nick) == 0) { chatter_printf(conn->chatter, conn, NULL, "$B*** %s ($0%s@%s$B)$0 has quit:$/ %s", @@ -817,6 +819,12 @@ irc_process_server(struct irc_connection *conn) irc_send(conn, conn->line, len); return true; } + case 900: + /* nickserv login */ + chatter_printf(conn->chatter, conn, NULL, + "$B***$0$/ %s", + msg.msg); + break; default: goto unknown; } @@ -926,7 +934,11 @@ irc_process_input(struct irc_connection *conn, struct if (strcasecmp(arg0, "quit") == 0) { if (conn == NULL) goto not_connected; - irc_printf(conn, "QUIT :%s\r\n", str == NULL ? "Quitting" : str); + if (str == NULL) + irc_printf(conn, "QUIT :%s %s on a %s\r\n", + PROGRAM_NAME, get_version(false), gestalt_machine_type()); + else + irc_printf(conn, "QUIT :%s\r\n", str); return; } if (strcasecmp(arg0, "quote") == 0) {