+ if (Conn_GetClient(my_conn))
+ return CONNECTED;
+ else
+ return DISCONNECTED;
+} /* IRC_DISCONNECT */
+
+/**
+ * Handler for the IRC "WALLOPS" command.
+ *
+ * @param Client The client from which this command has been received.
+ * @param Req Request structure with prefix and all parameters.
+ * @return CONNECTED or DISCONNECTED.
+ */
+GLOBAL bool
+IRC_WALLOPS( CLIENT *Client, REQUEST *Req )
+{
+ CLIENT *from;
+
+ assert( Client != NULL );
+ assert( Req != NULL );
+
+ switch (Client_Type(Client)) {
+ case CLIENT_USER:
+ if (!Op_Check(Client, Req))
+ return Op_NoPrivileges(Client, Req);
+ from = Client;
+ break;
+ case CLIENT_SERVER:
+ _IRC_REQUIRE_PREFIX_OR_RETURN_(Client, Req)
+ from = Client_Search(Req->prefix);
+ break;
+ default:
+ return CONNECTED;
+ }
+
+ if (!from)
+ return IRC_WriteErrClient(Client, ERR_NOSUCHNICK_MSG,
+ Client_ID(Client), Req->prefix);
+
+ IRC_SendWallops(Client, from, "%s", Req->argv[0]);
+ return CONNECTED;
+} /* IRC_WALLOPS */
+
+/**
+ * Handle <?>LINE commands (GLINE, KLINE).
+ *
+ * @param Client The client from which this command has been received.
+ * @param Req Request structure with prefix and all parameters.
+ * @return CONNECTED or DISCONNECTED.
+ */
+GLOBAL bool
+IRC_xLINE(CLIENT *Client, REQUEST *Req)
+{
+ CLIENT *from, *c, *c_next;
+ char reason[COMMAND_LEN], class_c;
+ struct list_head *list;
+ time_t timeout;
+ int class;
+
+ assert(Client != NULL);
+ assert(Req != NULL);
+
+ /* Bad number of parameters? */
+ if (Req->argc != 1 && Req->argc != 3)
+ return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
+ Client_ID(Client), Req->command);
+
+ from = Op_Check(Client, Req);
+ if (!from)
+ return Op_NoPrivileges(Client, Req);
+
+ switch(Req->command[0]) {
+ case 'g':
+ case 'G':
+ class = CLASS_GLINE; class_c = 'G';
+ break;
+ case 'k':
+ case 'K':
+ class = CLASS_KLINE; class_c = 'K';
+ break;
+ default:
+ Log(LOG_CRIT,
+ "IRC_xLINE() called for unknown line: %c!? Ignored.",
+ Req->command[0]);
+ return CONNECTED;
+ }
+
+ if (Req->argc == 1) {
+ /* Delete mask from list */
+ Class_DeleteMask(class, Req->argv[0]);
+ Log(LOG_NOTICE|LOG_snotice,
+ "\"%s\" deleted \"%s\" from %c-Line list.",
+ Client_Mask(from), Req->argv[0], class_c);
+ if (class == CLASS_GLINE) {
+ /* Inform other servers */
+ IRC_WriteStrServersPrefix(Client, from, "%s %s",
+ Req->command, Req->argv[0]);