+/**
+ * Get pointer to a static string representing the connection "options".
+ *
+ * @param Idx Connection index.
+ * @return Pointer to static (global) string buffer.
+ */
+static char *
+#ifdef ZLIB
+Option_String(CONN_ID Idx)
+#else
+Option_String(UNUSED CONN_ID Idx)
+#endif
+{
+ static char option_txt[8];
+ UINT16 options;
+
+ assert(Idx != NONE);
+
+ options = Conn_Options(Idx);
+ strcpy(option_txt, "F"); /* No idea what this means, but the
+ * original ircd sends it ... */
+#ifdef SSL_SUPPORT
+ if(options & CONN_SSL) /* SSL encrypted link */
+ strlcat(option_txt, "s", sizeof(option_txt));
+#endif
+#ifdef ZLIB
+ if(options & CONN_ZIP) /* zlib compression enabled */
+ strlcat(option_txt, "z", sizeof(option_txt));
+#endif
+
+ return option_txt;
+} /* Option_String */
+
+/**
+ * Send a message to target(s).
+ *
+ * This function is used by IRC_{PRIVMSG|NOTICE|SQUERY} to actualy
+ * send the message(s).
+ *
+ * @param Client The client from which this command has been received.
+ * @param Req Request structure with prefix and all parameters.
+ * @param ForceType Required type of the destination of the message(s).
+ * @param SendErrors Whether to report errors back to the client or not.
+ * @return CONNECTED or DISCONNECTED.
+ */
+static bool
+Send_Message(CLIENT * Client, REQUEST * Req, int ForceType, bool SendErrors)
+{
+ CLIENT *cl, *from;
+ CL2CHAN *cl2chan;
+ CHANNEL *chan;
+ char *currentTarget = Req->argv[0];
+ char *strtok_last = NULL;
+ char *message = NULL;
+ char *targets[MAX_HNDL_TARGETS];
+ int i, target_nr = 0;
+
+ assert(Client != NULL);
+ assert(Req != NULL);
+
+ if (Req->argc == 0) {
+ if (!SendErrors)
+ return CONNECTED;
+ return IRC_WriteErrClient(Client, ERR_NORECIPIENT_MSG,
+ Client_ID(Client), Req->command);
+ }
+ if (Req->argc == 1) {
+ if (!SendErrors)
+ return CONNECTED;
+ return IRC_WriteErrClient(Client, ERR_NOTEXTTOSEND_MSG,
+ Client_ID(Client));
+ }
+ if (Req->argc > 2) {
+ if (!SendErrors)
+ return CONNECTED;
+ return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
+ Client_ID(Client), Req->command);
+ }