+send_join_error(struct Client *source_p, int numeric, const char *name)
+{
+ /* This stuff is necessary because the form_str macro only
+ * accepts constants.
+ */
+ switch (numeric)
+ {
+#define NORMAL_NUMERIC(i) \
+ case i: \
+ sendto_one(source_p, form_str(i), \
+ me.name, source_p->name, name); \
+ break
+
+ NORMAL_NUMERIC(ERR_BANNEDFROMCHAN);
+ NORMAL_NUMERIC(ERR_INVITEONLYCHAN);
+ NORMAL_NUMERIC(ERR_BADCHANNELKEY);
+ NORMAL_NUMERIC(ERR_CHANNELISFULL);
+ NORMAL_NUMERIC(ERR_NEEDREGGEDNICK);
+ NORMAL_NUMERIC(ERR_THROTTLE);
+
+ case ERR_USERONCHANNEL:
+ sendto_one_numeric(source_p, ERR_USERONCHANNEL,
+ form_str(ERR_USERONCHANNEL), source_p->name, name);
+ break;
+ default:
+ sendto_one_numeric(source_p, numeric,
+ "%s :Cannot join channel", name);
+ break;
+ }
+}
+
+static char *
+set_final_mode(char *mbuf, char *parabuf, struct Mode *mode, struct Mode *oldmode)