+ Client_Introduce(Client, c, CLIENT_SERVICE);
+ return CONNECTED;
+} /* IRC_SERVICE */
+
+
+/**
+ * Handler for the IRC "WEBIRC" command.
+ *
+ * See doc/Protocol.txt, section II.4:
+ * "Update webchat/proxy client information".
+ *
+ * @param Client The client from which this command has been received.
+ * @param Req Request structure with prefix and all parameters.
+ * @returns CONNECTED or DISCONNECTED.
+ */
+GLOBAL bool
+IRC_WEBIRC(CLIENT *Client, REQUEST *Req)
+{
+ /* Exactly 4 parameters are requited */
+ if (Req->argc != 4)
+ return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG,
+ Client_ID(Client), Req->command);
+
+ if (!Conf_WebircPwd[0] || strcmp(Req->argv[0], Conf_WebircPwd) != 0)
+ return IRC_WriteStrClient(Client, ERR_PASSWDMISMATCH_MSG,
+ Client_ID(Client));
+
+ LogDebug("Connection %d: got valid WEBIRC command: user=%s, host=%s, ip=%s",
+ Client_Conn(Client), Req->argv[1], Req->argv[2], Req->argv[3]);
+
+ Client_SetUser(Client, Req->argv[1], true);
+ Client_SetOrigUser(Client, Req->argv[1]);
+ Client_SetHostname(Client, Req->argv[2]);
+ return CONNECTED;
+} /* IRC_WEBIRC */
+
+
+/**
+ * Handler for the IRC "QUIT" command.
+ *
+ * See RFC 2812, 3.1.7 "Quit", and RFC 2813, 4.1.5 "Quit".
+ *
+ * @param Client The client from which this command has been received.
+ * @param Req Request structure with prefix and all parameters.
+ * @returns CONNECTED or DISCONNECTED.
+ */
+GLOBAL bool
+IRC_QUIT( CLIENT *Client, REQUEST *Req )
+{
+ CLIENT *target;
+ char quitmsg[LINE_LEN];
+
+ assert(Client != NULL);
+ assert(Req != NULL);
+
+ /* Wrong number of arguments? */
+ if (Req->argc > 1)
+ return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG,
+ Client_ID(Client), Req->command);
+
+ if (Req->argc == 1)
+ strlcpy(quitmsg, Req->argv[0], sizeof quitmsg);
+
+ if (Client_Type(Client) == CLIENT_SERVER) {
+ /* Server */
+ target = Client_Search(Req->prefix);
+ if (!target) {
+ Log(LOG_WARNING,
+ "Got QUIT from %s for unknown client!?",
+ Client_ID(Client));
+ return CONNECTED;
+ }
+
+ if (target != Client) {
+ Client_Destroy(target, "Got QUIT command",
+ Req->argc == 1 ? quitmsg : NULL, true);