X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fserver%2Fmodules%2Fbio%2Fserv_bio.c;h=6ccce90c1eddb0ebbb3b46d4a568cd664be3a055;hb=c41961e7d8c2d88398699493879fcfb9817dd534;hp=cf3823210911fd2af59c242478815ca0b53f1cdb;hpb=8490a02d64e53a12212d7c7de16d10f037a4343d;p=citadel.git diff --git a/citadel/server/modules/bio/serv_bio.c b/citadel/server/modules/bio/serv_bio.c index cf3823210..6ccce90c1 100644 --- a/citadel/server/modules/bio/serv_bio.c +++ b/citadel/server/modules/bio/serv_bio.c @@ -1,33 +1,23 @@ -/* - * This module implements server commands related to the display and - * manipulation of user "bio" files. - * - * 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 as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * 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. - */ - -#include "../../ctdl_module.h" -#include "../../config.h" +// This module implements server commands related to the display and +// manipulation of user profiles (also known as "bio" files). +// +// Copyright (c) 1987-2022 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. +// The program is distributed without any warranty, expressed or implied. #include #include #include +#include "../../ctdl_module.h" +#include "../../config.h" + -/* - * Command to enter user bio (profile) in plain text. - * This is deprecated , or at least it will be when its replacement is written :) - * I want commands to get/set bio in full MIME wonderfulness. - */ +// Command to enter user bio (profile) in plain text. +// This is deprecated , or at least it will be when its replacement is written :) +// I want commands to get/set bio in full MIME wonderfulness. void cmd_ebio(char *cmdbuf) { char buf[SIZ]; @@ -46,7 +36,7 @@ void cmd_ebio(char *cmdbuf) { StrBufAppendBufPlain(NewProfile, HKEY("\n"), 0); } - /* we have read the new profile from the user , now save it */ + // we have read the new profile from the user , now save it long old_msgnum = CC->user.msgnum_bio; char userconfigroomname[ROOMNAMELEN]; CtdlMailboxName(userconfigroomname, sizeof userconfigroomname, &CC->user, USERCONFIGROOM); @@ -62,13 +52,10 @@ void cmd_ebio(char *cmdbuf) { } -/* - * Command to read user bio (profile) in plain text. - * This is deprecated , or at least it will be when its replacement is written :) - * I want commands to get/set bio in full MIME wonderfulness. - */ -void cmd_rbio(char *cmdbuf) -{ +// Command to read user bio (profile) in plain text. +// This is deprecated , or at least it will be when its replacement is written :) +// I want commands to get/set bio in full MIME wonderfulness. +void cmd_rbio(char *cmdbuf) { struct ctdluser ruser; char buf[SIZ]; @@ -91,11 +78,8 @@ void cmd_rbio(char *cmdbuf) } -/* - * Import function called by import_old_bio_files() for a single user - */ -void import_one_bio_file(char *username, long usernum, char *path) -{ +// Import function called by import_old_bio_files() for a single user +void import_one_bio_file(char *username, long usernum, char *path) { syslog(LOG_DEBUG, "Import legacy bio for %s, usernum=%ld, filename=%s", username, usernum, path); FILE *fp = fopen(path, "r"); @@ -139,11 +123,8 @@ void import_one_bio_file(char *username, long usernum, char *path) } -/* - * Look for old-format "bio" files and import them into the message base - */ -void import_old_bio_files(void) -{ +// Look for old-format "bio" files and import them into the message base +void import_old_bio_files(void) { DIR *filedir = NULL; struct dirent *filedir_entry; size_t d_namelen; @@ -153,14 +134,12 @@ void import_old_bio_files(void) struct stat s; char path[PATH_MAX]; - syslog(LOG_DEBUG, "Importing old style bio files into the message base"); filedir = opendir("bio"); if (filedir == NULL) { return; } - while ( (filedir_entry = readdir(filedir)) , (filedir_entry != NULL)) - { + while ( (filedir_entry = readdir(filedir)) , (filedir_entry != NULL)) { #ifdef _DIRENT_HAVE_D_NAMLEN d_namelen = filedir_entry->d_namlen; @@ -222,6 +201,6 @@ char *ctdl_module_init_bio(void) { CtdlRegisterProtoHook(cmd_ebio, "EBIO", "Enter your bio"); CtdlRegisterProtoHook(cmd_rbio, "RBIO", "Read a user's bio"); } - /* return our module name for the log */ + // return our module name for the log return "bio"; }