{
const char *name; /* name of capability */
unsigned int cap; /* mask value */
+ unsigned int required; /* 1 if required, 0 if not */
};
#define CAP_CAP 0x00001 /* received a CAP to begin with */
/*
* ircd-ratbox: A slightly useful ircd.
- * m_away.c: Negotiates capabilities with a remote server.
+ * m_capab.c: Negotiates capabilities with a remote server.
*
* Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
* Copyright (C) 1996-2002 Hybrid Development Team
}
}
+ /* check to ensure any "required" caps are set. --nenolod */
+ for (cap = captab; cap->name; cap++)
+ {
+ if (!cap->required)
+ continue;
+
+ if (!(client_p->localClient->caps & cap->cap))
+ {
+ char exitbuf[BUFSIZE];
+
+ rb_snprintf(exitbuf, BUFSIZE, "Missing required CAPAB [%s]", cap->cap);
+ exit_client(client_p, client_p, client_p, exitbuf);
+
+ return 0;
+ }
+ }
+
return 0;
}