ref: f5cb575e6da020ae009f192aa0367affa285e189
parent: 96508828f62f51851ea9891f2fdad57b3d678874
author: mkf <mkf@cirno>
date: Tue Sep 26 22:03:22 EDT 2023
add ERROR command
--- a/ircd.c
+++ b/ircd.c
@@ -23,6 +23,7 @@
NICK,
TOPIC,
AWAY,
+ ERROR,
/* numericals */
RPL_WELCOME = 001,
@@ -344,6 +345,7 @@
/* r->argv is: parter, channel, reason */
n = snprint(buf, n, ":%s PART %s :%s\r\n", r->argv[0], r->argv[1], r->argv[2]);
break;
+ case ERROR:
case QUIT:
/* r->argv is: quitter, reason */
n = snprint(buf, n, ":%s QUIT :%s\r\n", r->argv[0], r->argv[1]);
@@ -1100,7 +1102,7 @@
tmp2++;
return topic(c, tmp, tmp2);
}
- if(strcmp(cmd, "QUIT") == 0){
+ if(strcmp(cmd, "QUIT") == 0 || strcmp(cmd, "ERROR")== 0){
tmp = strtok(0, "\r"); /* reason */
if(tmp == nil)
return 0;