I thought Richard Stallman was a douchebag before it was cool. master
authorArt Cancro <ajc@citadel.org>
Tue, 21 May 2024 15:38:26 +0000 (15:38 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 21 May 2024 15:38:26 +0000 (15:38 +0000)
citadel/server/modules/expire/expire_policy.c
citadel/server/modules/expire/serv_expire.c

index 32db98ad2ccc62b5b4d4849b59fc19afa122c5a6..ce302a6b310dd83265c36a1957ebbc2418848f40 100644 (file)
@@ -1,15 +1,6 @@
-/* 
- * Functions which manage expire policy for rooms
- * Copyright (c) 1987-2015 by the citadel.org team
- *
- * This program is open source software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
+// Functions which manage expire policy for rooms
+// Copyright (c) 1987-2024 by citadel.org (Art Cancro et al.)
+// This program is open source software.  Use, duplication, or disclosure is subject to the GNU General Public License, version 3.
 
 #include "../../sysdep.h"
 #include <stdlib.h>
@@ -17,7 +8,6 @@
 #include <stdio.h>
 #include <sys/stat.h>
 #include <string.h>
-
 #include <time.h>
 #include <limits.h>
 #include <libcitadel.h>
 #include "../../ctdl_module.h"
 #include "../../user_ops.h"
 
-/*
- * Retrieve the applicable expire policy for a specific room
- */
+// Retrieve the applicable expire policy for a specific room
 void GetExpirePolicy(struct ExpirePolicy *epbuf, struct ctdlroom *qrbuf) {
        struct floor *fl;
 
-       /* If the room has its own policy, return it */ 
+       // If the room has its own policy, return it 
        if (qrbuf->QRep.expire_mode != 0) {
                memcpy(epbuf, &qrbuf->QRep, sizeof(struct ExpirePolicy));
                return;
        }
 
-       /* (non-mailbox rooms)
-        * If the floor has its own policy, return it
-        */
+       // (non-mailbox rooms)
+       // If the floor has its own policy, return it
        if ( (qrbuf->QRflags & QR_MAILBOX) == 0) {
                fl = CtdlGetCachedFloor(qrbuf->QRfloor);
                if (fl->f_ep.expire_mode != 0) {
@@ -56,9 +43,8 @@ void GetExpirePolicy(struct ExpirePolicy *epbuf, struct ctdlroom *qrbuf) {
                }
        }
 
-       /* (Mailbox rooms)
-        * If there is a default policy for mailbox rooms, return it
-        */
+       // (Mailbox rooms)
+       // If there is a default policy for mailbox rooms, return it
        if (qrbuf->QRflags & QR_MAILBOX) {
                if (CtdlGetConfigInt("c_mbxep_mode") != 0) {
                        epbuf->expire_mode = CtdlGetConfigInt("c_mbxep_mode");
@@ -67,15 +53,13 @@ void GetExpirePolicy(struct ExpirePolicy *epbuf, struct ctdlroom *qrbuf) {
                }
        }
 
-       /* Otherwise, fall back on the system default */
+       // Otherwise, fall back on the system default
        epbuf->expire_mode = CtdlGetConfigInt("c_ep_mode");
        epbuf->expire_value = CtdlGetConfigInt("c_ep_value");
 }
 
 
-/*
- * Get Policy EXpire
- */
+// Get Policy EXpire
 void cmd_gpex(char *argbuf) {
        struct ExpirePolicy exp;
        struct floor *fl;
@@ -107,9 +91,7 @@ void cmd_gpex(char *argbuf) {
 }
 
 
-/*
- * Set Policy EXpire
- */
+// Set Policy EXpire
 void cmd_spex(char *argbuf) {
        struct ExpirePolicy exp;
        struct floor flbuf;
@@ -125,8 +107,7 @@ void cmd_spex(char *argbuf) {
                return;
        }
 
-       if ((!strcasecmp(which, strof(roompolicy))) || (!strcasecmp(which, "room")))
-       {
+       if ((!strcasecmp(which, strof(roompolicy))) || (!strcasecmp(which, "room"))) {
                if (!is_room_aide()) {
                        cprintf("%d Higher access required.\n", ERROR + HIGHER_ACCESS_REQUIRED);
                        return;
@@ -148,8 +129,7 @@ void cmd_spex(char *argbuf) {
                return;
        }
 
-       if ((!strcasecmp(which, strof(floorpolicy))) || (!strcasecmp(which, "floor")))
-       {
+       if ((!strcasecmp(which, strof(floorpolicy))) || (!strcasecmp(which, "floor"))) {
                lgetfloor(&flbuf, CC->room.QRfloor);
                memcpy(&flbuf.f_ep, &exp, sizeof(struct ExpirePolicy));
                lputfloor(&flbuf, CC->room.QRfloor);
@@ -157,16 +137,14 @@ void cmd_spex(char *argbuf) {
                return;
        }
 
-       else if ((!strcasecmp(which, strof(mailboxespolicy))) || (!strcasecmp(which, "mailboxes")))
-       {
+       else if ((!strcasecmp(which, strof(mailboxespolicy))) || (!strcasecmp(which, "mailboxes"))) {
                CtdlSetConfigInt("c_mbxep_mode", exp.expire_mode);
                CtdlSetConfigInt("c_mbxep_value", exp.expire_value);
                cprintf("%d Default expire policy for mailboxes set.\n", CIT_OK);
                return;
        }
 
-       else if ((!strcasecmp(which, strof(sitepolicy))) || (!strcasecmp(which, "site")))
-       {
+       else if ((!strcasecmp(which, strof(sitepolicy))) || (!strcasecmp(which, "site"))) {
                if (exp.expire_mode == EXPIRE_NEXTLEVEL) {
                        cprintf("%d Invalid policy (no higher level)\n", ERROR + ILLEGAL_VALUE);
                        return;
index fe4b60b4a20375610c7d1b60954bae7e4dce4221..63b8fc19173bc8fefcca5db2fabaefaa8104a281 100644 (file)
@@ -2,10 +2,9 @@
 //
 // You might also see this module affectionately referred to as TDAP (The Dreaded Auto-Purger).
 //
-// Copyright (c) 1988-2023 by citadel.org (Art Cancro, Wilifried Goesgens, and others)
+// Copyright (c) 1988-2024 by citadel.org (Art Cancro et al.)
 //
-// This program is open source software.  Use, duplication, or disclosure
-// is subject to the terms of the GNU General Public License, version 3.
+// This program is open source software.  Use, duplication, or disclosure is subject to the GNU General Public License, version 3.
 
 
 #include "../../sysdep.h"