wm: ircd

Download patch

ref: 0acc524c9faec4f0bd87f82da1a6a22a7faaa065
parent: ccd77afbd1a4095dd74376d3c9c138b1026320b4
author: mkf <mkf@cloud9p.org>
date: Tue Sep 26 02:48:13 EDT 2023

add Cantsendtochannel (404)

--- a/ircd.c
+++ b/ircd.c
@@ -32,6 +32,7 @@
 	Notregistered,
 	Alreadyregistered,
 	Nosuchchannel,
+	Cantsendtochannel,
 	Unknowncmd,
 };
 
@@ -364,6 +365,10 @@
 		/* r->argv is: channel */
 		n = snprint(buf, n, ":%s 403 %s :No such channel\r\n", servername, r->argv[0]);
 		break;
+	case CantsendtoChannel:
+		/* r->argv is: channel */
+		n = snprint(buf, n, ":%s 404 %s %s :Cannot send to channel\r\n", servername, c->nick, r->argv[0]);
+		break;
 	case Erroneousnick:
 		/* r->argv[0] is nick */
 		n = snprint(buf, n, ":%s 432 %s %s :Erroneous nickname\r\n", servername, c->nick, r->argv[0]);
@@ -824,7 +829,7 @@
 			if(joined(c, target))
 				replychan(ch, &r, c);
 			else{
-				r.code = Notonchannel;
+				r.code = Cantsendtochannel;
 				r.argv[0] = target;
 				reply(c, &r);
 			}