From: Art Cancro Date: Thu, 4 Jan 2024 15:54:40 +0000 (-0500) Subject: Wondering how we ever got by with narrow terminals X-Git-Tag: v997~36 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=e7bc04b76924def18f33471d74f36c823d6199a0 Wondering how we ever got by with narrow terminals --- diff --git a/citadel/server/modules/checkpoint/serv_checkpoint.c b/citadel/server/modules/checkpoint/serv_checkpoint.c index ff3154a57..ca6b1b76c 100644 --- a/citadel/server/modules/checkpoint/serv_checkpoint.c +++ b/citadel/server/modules/checkpoint/serv_checkpoint.c @@ -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 @@ -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"; } diff --git a/citadel/server/modules/ctdlproto/serv_file.c b/citadel/server/modules/ctdlproto/serv_file.c index 5ecd99562..25ef08b15 100644 --- a/citadel/server/modules/ctdlproto/serv_file.c +++ b/citadel/server/modules/ctdlproto/serv_file.c @@ -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); diff --git a/citadel/server/modules/ctdlproto/serv_messages.c b/citadel/server/modules/ctdlproto/serv_messages.c index 13bb0c96b..7e18c0bc9 100644 --- a/citadel/server/modules/ctdlproto/serv_messages.c +++ b/citadel/server/modules/ctdlproto/serv_messages.c @@ -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 #include @@ -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; }