Wondering how we ever got by with narrow terminals
authorArt Cancro <ajc@citadel.org>
Thu, 4 Jan 2024 15:54:40 +0000 (10:54 -0500)
committerArt Cancro <ajc@citadel.org>
Thu, 4 Jan 2024 15:54:40 +0000 (10:54 -0500)
citadel/server/modules/checkpoint/serv_checkpoint.c
citadel/server/modules/ctdlproto/serv_file.c
citadel/server/modules/ctdlproto/serv_messages.c

index ff3154a57f8236325d4cbcfd48c77c458072e2ca..ca6b1b76ca8d3ec77e0c324b26f12948811e3ae7 100644 (file)
@@ -1,16 +1,9 @@
-/*
- * checkpointing module for the database
- *
- * Copyright (c) 1987-2022 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.
- */
+// checkpointing module for the database
+//
+// Copyright (c) 1987-2024 by the citadel.org team
+//
+// This program is open source software.  Use, duplication, or disclosure
+// is subject to the terms of the GNU General Public License, version 3.
  
 #include "../../sysdep.h"
 #include <stdlib.h>
@@ -37,6 +30,6 @@ char *ctdl_module_init_checkpoint(void) {
        if (threading) {
                CtdlRegisterSessionHook(cdb_checkpoint, EVT_TIMER, PRIO_CLEANUP + 10);
        }
-       /* return our module name for the log */
+       // return our module name for the log
        return "checkpoint";
 }
index 5ecd99562351d119ec80b020aba35009564bc1b8..25ef08b1510e568a5cfa480cfdedeccc59be548d 100644 (file)
@@ -1,6 +1,6 @@
 // Server functions which handle file transfers and room directories.
 //
-// Copyright (c) 1987-2022 by the citadel.org team
+// Copyright (c) 1987-2024 by the citadel.org team
 //
 // This program is open source software.  Use, duplication, or disclosure
 // is subject to the terms of the GNU General Public License, version 3.
@@ -369,7 +369,7 @@ void cmd_ucls(char *cmd) {
                }
 
                if ((CC->room.QRflags2 & QR2_NOUPLMSG) == 0) {
-                       /* put together an upload notice */
+                       // put together an upload notice
                        snprintf(upload_notice, sizeof upload_notice,
                                 "NEW UPLOAD: '%s'\n %s\n%s\n", CC->upl_file, CC->upl_comment, CC->upl_mimetype);
                        quickie_message(CC->curr_user, NULL, NULL, CC->room.QRname, upload_notice, 0, NULL);
index 13bb0c96b48f62b27b44f2caf329842e65fe38da..7e18c0bc994c5d367f53eda5f211d34520815413 100644 (file)
@@ -1,14 +1,9 @@
 // Message-related protocol commands for Citadel clients
 //
-// Copyright (c) 1987-2023 by the citadel.org team
+// Copyright (c) 1987-2024 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.
+// This program is open source software.  Use, duplication, or disclosure
+// is subject to the terms of the GNU General Public License version 3.
 
 #include <stdio.h>
 #include <libcitadel.h>
@@ -210,10 +205,8 @@ void cmd_msgs(char *cmdbuf) {
        if (with_template == 1) {
                memset(buf, 0, 5);
                unbuffer_output();
-               cprintf("%d Send template then receive message list\n",
-                       START_CHAT_MODE);
-               template = (struct CtdlMessage *)
-                       malloc(sizeof(struct CtdlMessage));
+               cprintf("%d Send template then receive message list\n", START_CHAT_MODE);
+               template = (struct CtdlMessage *) malloc(sizeof(struct CtdlMessage));
                memset(template, 0, sizeof(struct CtdlMessage));
                template->cm_magic = CTDLMESSAGE_MAGIC;
                template->cm_anon_type = MES_NORMAL;
@@ -223,8 +216,7 @@ void cmd_msgs(char *cmdbuf) {
                        long tValueLen;
 
                        tValueLen = extract_token(tfield, buf, 0, '|', sizeof tfield);
-                       if ((tValueLen == 4) && GetFieldFromMnemonic(&f, tfield))
-                       {
+                       if ((tValueLen == 4) && GetFieldFromMnemonic(&f, tfield)) {
                                tValueLen = extract_token(tvalue, buf, 1, '|', sizeof tvalue);
                                if (tValueLen >= 0) {
                                        CM_SetField(template, f, tvalue);
@@ -243,8 +235,7 @@ void cmd_msgs(char *cmdbuf) {
                while(client_getln(buf, sizeof buf) >= 0 && strcmp(buf,"000")) {
                        eMsgField f;
        
-                       if (GetFieldFromMnemonic(&f, buf))
-                       {
+                       if (GetFieldFromMnemonic(&f, buf)) {
                                Put(filt.Filter, LKEY(i), (void*)f, reference_free_handler);
                                i++;
                        }
@@ -283,11 +274,8 @@ void cmd_msgs(char *cmdbuf) {
 }
 
 
-/*
- * display a message (mode 0 - Citadel proprietary)
- */
-void cmd_msg0(char *cmdbuf)
-{
+// display a message (mode 0 - Citadel proprietary)
+void cmd_msg0(char *cmdbuf) {
        long msgid;
        int headers_only = HEADERS_ALL;
 
@@ -342,8 +330,7 @@ void cmd_opna(char *cmdbuf) {
 
        msgid = extract_long(cmdbuf, 0);
        extract_token(desired_section, cmdbuf, 1, '|', sizeof desired_section);
-       safestrncpy(CC->download_desired_section, desired_section,
-               sizeof CC->download_desired_section);
+       safestrncpy(CC->download_desired_section, desired_section, sizeof CC->download_desired_section);
        CtdlOutputMsg(msgid, MT_DOWNLOAD, 0, 1, 1, NULL, 0, NULL, NULL, NULL);
 }                      
 
@@ -415,7 +402,7 @@ void cmd_ent0(char *entargs) {
                if (*ptr == '!') *ptr = '|';
        }
 
-       /* first check to make sure the request is valid. */
+       // first check to make sure the request is valid.
 
        err = CtdlDoIHavePermissionToPostInThisRoom(
                errmsg,
@@ -428,7 +415,7 @@ void cmd_ent0(char *entargs) {
                return;
        }
 
-       /* Check some other permission type things. */
+       // Check some other permission type things.
 
        if (IsEmptyStr(newusername)) {
                strcpy(newusername, CC->user.fullname);
@@ -467,7 +454,7 @@ void cmd_ent0(char *entargs) {
                cprintf("%d You don't have permission to author messages as '%s'.\n",
                        ERROR + HIGHER_ACCESS_REQUIRED,
                        newuseremail
-                       );
+               );
                return;
        }
 
@@ -523,8 +510,7 @@ void cmd_ent0(char *entargs) {
 
                if (valid_to->num_internet + valid_cc->num_internet + valid_bcc->num_internet > 0) {
                        if (CtdlCheckInternetMailPermission(&CC->user)==0) {
-                               cprintf("%d You do not have permission "
-                                       "to send Internet mail.\n",
+                               cprintf("%d You do not have permission to send Internet mail.\n",
                                        ERROR + HIGHER_ACCESS_REQUIRED);
                                free_recipients(valid_to);
                                free_recipients(valid_cc);
@@ -545,8 +531,7 @@ void cmd_ent0(char *entargs) {
                    && (valid_to->num_internet + valid_cc->num_internet + valid_bcc->num_internet > 0)
                    && ((CC->user.flags & US_INTERNET) == 0)
                    && (!CC->internal_pgm)) {
-                       cprintf("%d You don't have access to Internet mail.\n",
-                               ERROR + HIGHER_ACCESS_REQUIRED);
+                       cprintf("%d You don't have access to Internet mail.\n", ERROR + HIGHER_ACCESS_REQUIRED);
                        free_recipients(valid_to);
                        free_recipients(valid_cc);
                        free_recipients(valid_bcc);
@@ -655,7 +640,8 @@ void cmd_ent0(char *entargs) {
 
                        if (!CM_IsEmpty(msg, eExclusiveID)) {
                                cprintf("%s\n", msg->cm_fields[eExclusiveID]);
-                       } else {
+                       }
+                       else {
                                cprintf("\n");
                        }
                        cprintf("000\n");
@@ -687,8 +673,7 @@ void cmd_dele(char *args) {
        }
 
        if (CtdlDoIHavePermissionToDeleteMessagesFromThisRoom() == 0) {
-               cprintf("%d Higher access required.\n",
-                       ERROR + HIGHER_ACCESS_REQUIRED);
+               cprintf("%d Higher access required.\n", ERROR + HIGHER_ACCESS_REQUIRED);
                return;
        }
 
@@ -703,9 +688,9 @@ void cmd_dele(char *args) {
        free(msgs);
 
        if (num_deleted) {
-               cprintf("%d %d message%s deleted.\n", CIT_OK,
-                       num_deleted, ((num_deleted != 1) ? "s" : ""));
-       else {
+               cprintf("%d %d message%s deleted.\n", CIT_OK, num_deleted, ((num_deleted != 1) ? "s" : ""));
+       }
+       else {
                cprintf("%d Message not found.\n", ERROR + MESSAGE_NOT_FOUND);
        }
 }
@@ -784,8 +769,7 @@ void cmd_move(char *args) {
        if (!(ra & UA_KNOWN))  permit = 0;
 
        if (!permit) {
-               cprintf("%d Higher access required.\n",
-                       ERROR + HIGHER_ACCESS_REQUIRED);
+               cprintf("%d Higher access required.\n", ERROR + HIGHER_ACCESS_REQUIRED);
                return;
        }
 
@@ -799,8 +783,7 @@ void cmd_move(char *args) {
        // Do the copy
        err = CtdlSaveMsgPointersInRoom(targ, msgs, num_msgs, 1, NULL, 0);
        if (err != 0) {
-               cprintf("%d Cannot store message(s) in %s: error %d\n",
-                       err, targ, err);
+               cprintf("%d Cannot store message(s) in %s: error %d\n", err, targ, err);
                free(msgs);
                return;
        }