+} /* join_set_channelmodes */
+
+
+/**
+ * Forward JOIN command to a specific server
+ *
+ * This function diffentiates between servers using RFC 2813 mode that
+ * support the JOIN command with appended ASCII 7 character and channel
+ * modes, and servers using RFC 1459 protocol which require separate JOIN
+ * and MODE commands.
+ *
+ * @param To Forward JOIN (and MODE) command to this peer server
+ * @param Prefix Client used to prefix the genrated commands
+ * @param Data Parameters of JOIN command to forward, probably
+ * containing channel modes separated by ASCII 7.
+ */
+static void
+cb_join_forward(CLIENT *To, CLIENT *Prefix, void *Data)
+{
+ CONN_ID conn;
+ char str[COMMAND_LEN], *ptr = NULL;
+
+ strlcpy(str, (char *)Data, sizeof(str));
+ conn = Client_Conn(To);
+
+ if (Conn_Options(conn) & CONN_RFC1459) {
+ /* RFC 1459 compatibility mode, appended modes are NOT
+ * supported, so strip them off! */
+ ptr = strchr(str, 0x7);
+ if (ptr)
+ *ptr++ = '\0';
+ }
+
+ IRC_WriteStrClientPrefix(To, Prefix, "JOIN %s", str);
+ if (ptr && *ptr)
+ IRC_WriteStrClientPrefix(To, Prefix, "MODE %s +%s %s", str, ptr,
+ Client_ID(Prefix));
+} /* cb_join_forward */