+ 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]);
+
+ }
+ } else {
+ /* Add new mask to list */
+ timeout = atol(Req->argv[1]);
+ if (timeout > 0)
+ timeout += time(NULL);
+ if (Class_AddMask(class, Req->argv[0],
+ timeout,
+ Req->argv[2])) {
+ Log(LOG_NOTICE|LOG_snotice,
+ "\"%s\" added \"%s\" to %c-Line list: \"%s\" (%ld seconds).",
+ Client_Mask(from), Req->argv[0], class_c,
+ Req->argv[2], atol(Req->argv[1]));
+ if (class == CLASS_GLINE) {
+ /* Inform other servers */
+ IRC_WriteStrServersPrefix(Client, from,
+ "%s %s %s :%s", Req->command,
+ Req->argv[0], Req->argv[1],
+ Req->argv[2]);
+ }
+
+ /* Check currently connected clients */
+ snprintf(reason, sizeof(reason), "%c-Line by \"%s\": \"%s\"",
+ class_c, Client_ID(from), Req->argv[2]);
+ list = Class_GetList(class);
+ c = Client_First();
+ while (c) {
+ c_next = Client_Next(c);
+ if ((class == CLASS_GLINE || Client_Conn(c) > NONE)
+ && Lists_Check(list, c))
+ IRC_KillClient(Client, NULL,
+ Client_ID(c), reason);
+ c = c_next;
+ }