From 59bef58621c50a3ae532d18e6b7ecbd0108acf77 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Sat, 11 Jun 2022 19:27:53 -0400 Subject: [PATCH] If you can't handle me at my worst, you don't deserve me at my best. --- citadel/configure | 18 +- citadel/server/citadel_dirs.h | 14 +- .../autocompletion/serv_autocompletion.c | 1 + citadel/server/modules/bio/serv_bio.c | 2 +- citadel/server/modules/blog/serv_blog.c | 2 +- .../server/modules/calendar/serv_calendar.c | 4 +- .../modules/checkpoint/serv_checkpoint.c | 1 + citadel/server/modules/clamav/serv_virus.c | 1 + citadel/server/modules/ctdlproto/serv_file.c | 6 +- .../server/modules/ctdlproto/serv_messages.c | 6 +- citadel/server/modules/ctdlproto/serv_rooms.c | 5 +- .../server/modules/ctdlproto/serv_session.c | 5 +- .../server/modules/ctdlproto/serv_syscmds.c | 5 +- citadel/server/modules/ctdlproto/serv_user.c | 6 +- citadel/server/modules/expire/serv_expire.c | 1 + .../server/modules/fulltext/serv_fulltext.c | 3 +- citadel/server/modules/image/serv_image.c | 2 +- citadel/server/modules/imap/serv_imap.c | 247 +++++++----------- .../modules/inboxrules/serv_inboxrules.c | 1 + citadel/server/modules/inetcfg/serv_inetcfg.c | 6 +- citadel/server/modules/instmsg/serv_instmsg.c | 4 +- .../modules/listdeliver/serv_listdeliver.c | 2 +- citadel/server/modules/listsub/serv_listsub.c | 4 +- citadel/server/modules/migrate/serv_migrate.c | 5 +- citadel/server/modules/newuser/serv_newuser.c | 1 + citadel/server/modules/nntp/serv_nntp.c | 2 + citadel/server/modules/notes/serv_notes.c | 1 + .../server/modules/openid/serv_openid_rp.c | 9 +- citadel/server/modules/pop3/serv_pop3.c | 1 + .../modules/pop3client/serv_pop3client.c | 3 +- .../server/modules/roomchat/serv_roomchat.c | 1 + .../server/modules/rssclient/serv_rssclient.c | 1 + citadel/server/modules/rwho/serv_rwho.c | 1 + citadel/server/modules/smtp/serv_smtp.c | 1 + citadel/server/modules/smtp/serv_smtpclient.c | 2 +- citadel/server/modules/spam/serv_spam.c | 2 +- citadel/server/modules/test/serv_test.c | 1 + citadel/server/modules/upgrade/serv_upgrade.c | 1 + citadel/server/modules/vcard/serv_vcard.c | 3 +- citadel/server/modules/wiki/serv_wiki.c | 4 +- citadel/server/modules/xmpp/serv_xmpp.c | 3 + citadel/server/modules_init.h | 2 +- 42 files changed, 160 insertions(+), 230 deletions(-) diff --git a/citadel/configure b/citadel/configure index 7d1b524fc..a6c2def3e 100755 --- a/citadel/configure +++ b/citadel/configure @@ -16,7 +16,9 @@ echo echo Running the configure script to create config.mk echo +######################################################################## # Parse the command line arguments +######################################################################## for x in $* do a=$1 @@ -41,7 +43,10 @@ do shift done -# Set any missing values (FIXME remove the ultra-fatal -W options when finished converting from autotools) + +######################################################################## +# Set any missing values +######################################################################## # Accept PREFIX as a substitute for CTDLDIR, but only if CTDLDIR is not already set [ "$CTDLDIR" = "" ] && [ "$PREFIX" != "" ] && CTDLDIR=$PREFIX @@ -50,9 +55,10 @@ done [ "$CTDLDIR" = "" ] && CTDLDIR=/usr/local/citadel # Permit override of CFLAGS and LDFLAGS using environment variables -[ "$CFLAGS" = "" ] && CFLAGS='-ggdb -Werror -Wfatal-errors -Wno-discarded-qualifiers' +[ "$CFLAGS" = "" ] && CFLAGS='-ggdb -Wno-discarded-qualifiers' [ "$LDFLAGS" = "" ] && LDFLAGS='' + ######################################################################## # Test for OpenSSL ######################################################################## @@ -107,13 +113,17 @@ cc $tempcc -o $tempfile && { } +######################################################################## # FIXME do a real build id here +######################################################################## CFLAGS=${CFLAGS}' -DBUILD_ID=\"unknown\"' -# Output the config.mk +######################################################################## +# Output the config.mk +######################################################################## ( - echo # config.mk is generated by configure + echo '# config.mk is generated by configure' echo "CTDLDIR := ${CTDLDIR}" echo "CFLAGS := ${CFLAGS}" echo "LDFLAGS := ${LDFLAGS}" diff --git a/citadel/server/citadel_dirs.h b/citadel/server/citadel_dirs.h index ad422bf05..f4c2b6c6f 100644 --- a/citadel/server/citadel_dirs.h +++ b/citadel/server/citadel_dirs.h @@ -1,9 +1,15 @@ +// Copyright (c) 1987-2021 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. + #ifndef __CITADEL_DIRS_H #define __CITADEL_DIRS_H #include -/* Fixed directory names (some of these are obsolete and used only for migration) */ +// Fixed directory names (some of these are obsolete and used only for migration) #define ctdl_home_directory "." #define ctdl_db_dir "data" #define ctdl_file_dir "files" @@ -21,7 +27,7 @@ #define ctdl_bin_dir "." #define ctdl_utilbin_dir "." -/* Fixed file names (some of these are obsolete and used only for migration) */ +// Fixed file names (some of these are obsolete and used only for migration) #define file_citadel_config "citadel.config" #define file_lmtp_socket "lmtp.socket" #define file_lmtp_unfiltered_socket "lmtp-unfiltered.socket" @@ -36,10 +42,10 @@ #define file_guesstimezone "guesstimezone.sh" -/* externs */ +// externs extern int create_run_directories(long UID, long GUID); extern size_t assoc_file_name(char *buf, size_t n, struct ctdlroom *qrbuf, const char *prefix); extern FILE *create_digest_file(struct ctdlroom *room, int forceCreate); extern void remove_digest_file(struct ctdlroom *room); -#endif /* __CITADEL_DIRS_H */ +#endif // __CITADEL_DIRS_H diff --git a/citadel/server/modules/autocompletion/serv_autocompletion.c b/citadel/server/modules/autocompletion/serv_autocompletion.c index 732bd7145..7ce241d03 100644 --- a/citadel/server/modules/autocompletion/serv_autocompletion.c +++ b/citadel/server/modules/autocompletion/serv_autocompletion.c @@ -216,6 +216,7 @@ void cmd_auto(char *argbuf) { } +// Initialization function, called from modules_init.c char *ctdl_module_init_autocompletion(void) { if (!threading) { CtdlRegisterProtoHook(cmd_auto, "AUTO", "Do recipient autocompletion"); diff --git a/citadel/server/modules/bio/serv_bio.c b/citadel/server/modules/bio/serv_bio.c index b973bb5a9..cf3823210 100644 --- a/citadel/server/modules/bio/serv_bio.c +++ b/citadel/server/modules/bio/serv_bio.c @@ -215,7 +215,7 @@ void import_old_bio_files(void) } - +// Initialization function, called from modules_init.c char *ctdl_module_init_bio(void) { if (!threading) { import_old_bio_files(); diff --git a/citadel/server/modules/blog/serv_blog.c b/citadel/server/modules/blog/serv_blog.c index e4cfca5fc..4751e35c0 100644 --- a/citadel/server/modules/blog/serv_blog.c +++ b/citadel/server/modules/blog/serv_blog.c @@ -69,7 +69,7 @@ int blog_upload_beforesave(struct CtdlMessage *msg, struct recptypes *recp) { } -// Module initialization +// Initialization function, called from modules_init.c char *ctdl_module_init_blog(void) { if (!threading) { CtdlRegisterMessageHook(blog_upload_beforesave, EVT_BEFORESAVE); diff --git a/citadel/server/modules/calendar/serv_calendar.c b/citadel/server/modules/calendar/serv_calendar.c index 682045898..61f3d73ca 100644 --- a/citadel/server/modules/calendar/serv_calendar.c +++ b/citadel/server/modules/calendar/serv_calendar.c @@ -2531,9 +2531,7 @@ void ical_fixed_output(char *ptr, int len) { } -/* - * Register this module with the Citadel server. - */ +// Initialization function, called from modules_init.c char *ctdl_module_init_calendar(void) { if (!threading) { diff --git a/citadel/server/modules/checkpoint/serv_checkpoint.c b/citadel/server/modules/checkpoint/serv_checkpoint.c index 090bfd6af..96cc8e132 100644 --- a/citadel/server/modules/checkpoint/serv_checkpoint.c +++ b/citadel/server/modules/checkpoint/serv_checkpoint.c @@ -32,6 +32,7 @@ #include "../../ctdl_module.h" #include "../../context.h" +// Initialization function, called from modules_init.c char *ctdl_module_init_checkpoint(void) { if (threading) { CtdlRegisterSessionHook(cdb_checkpoint, EVT_TIMER, PRIO_CLEANUP + 10); diff --git a/citadel/server/modules/clamav/serv_virus.c b/citadel/server/modules/clamav/serv_virus.c index 2913006cb..0ec85682b 100644 --- a/citadel/server/modules/clamav/serv_virus.c +++ b/citadel/server/modules/clamav/serv_virus.c @@ -168,6 +168,7 @@ bail: close(sock); } +// Initialization function, called from modules_init.c char *ctdl_module_init_virus(void) { if (!threading) { CtdlRegisterMessageHook(clamd, EVT_SMTPSCAN); diff --git a/citadel/server/modules/ctdlproto/serv_file.c b/citadel/server/modules/ctdlproto/serv_file.c index d26657810..177a957d6 100644 --- a/citadel/server/modules/ctdlproto/serv_file.c +++ b/citadel/server/modules/ctdlproto/serv_file.c @@ -659,10 +659,8 @@ void cmd_emsg(char *mname) fclose(mfp); } -/*****************************************************************************/ -/* MODULE INITIALIZATION STUFF */ -/*****************************************************************************/ +// Initialization function, called from modules_init.c char *ctdl_module_init_file_ops(void) { if (!threading) { CtdlRegisterSessionHook(files_logout_hook, EVT_LOGOUT, PRIO_LOGOUT + 8); @@ -679,6 +677,6 @@ char *ctdl_module_init_file_ops(void) { CtdlRegisterProtoHook(cmd_mesg, "MESG", "fetch system banners"); CtdlRegisterProtoHook(cmd_emsg, "EMSG", "submit system banners"); } - /* return our Subversion id for the Log */ + // return a module name for the log return "file_ops"; } diff --git a/citadel/server/modules/ctdlproto/serv_messages.c b/citadel/server/modules/ctdlproto/serv_messages.c index 4036c9e0a..c5124aacd 100644 --- a/citadel/server/modules/ctdlproto/serv_messages.c +++ b/citadel/server/modules/ctdlproto/serv_messages.c @@ -815,9 +815,7 @@ void cmd_move(char *args) { } -/*****************************************************************************/ -/* MODULE INITIALIZATION STUFF */ -/*****************************************************************************/ +// Initialization function, called from modules_init.c char *ctdl_module_init_ctdl_message(void) { if (!threading) { CtdlRegisterProtoHook(cmd_msgs, "MSGS", "Output a list of messages in the current room"); @@ -832,6 +830,6 @@ char *ctdl_module_init_ctdl_message(void) { CtdlRegisterProtoHook(cmd_move, "MOVE", "Move or copy a message to another room"); } - /* return our Subversion id for the Log */ + // return a module name for the log return "ctdl_message"; } diff --git a/citadel/server/modules/ctdlproto/serv_rooms.c b/citadel/server/modules/ctdlproto/serv_rooms.c index 16c69b7e0..840f08c93 100644 --- a/citadel/server/modules/ctdlproto/serv_rooms.c +++ b/citadel/server/modules/ctdlproto/serv_rooms.c @@ -1016,10 +1016,7 @@ void cmd_stat(char *gargs) { } -/*****************************************************************************/ -/* MODULE INITIALIZATION STUFF */ -/*****************************************************************************/ - +// Initialization function, called from modules_init.c char *ctdl_module_init_rooms(void) { if (!threading) { CtdlRegisterProtoHook(cmd_lrms, "LRMS", "List rooms"); diff --git a/citadel/server/modules/ctdlproto/serv_session.c b/citadel/server/modules/ctdlproto/serv_session.c index cb41b535d..cc36bd4a0 100644 --- a/citadel/server/modules/ctdlproto/serv_session.c +++ b/citadel/server/modules/ctdlproto/serv_session.c @@ -208,10 +208,7 @@ void cmd_time(char *argbuf) } -/*****************************************************************************/ -/* MODULE INITIALIZATION STUFF */ -/*****************************************************************************/ - +// Initialization function, called from modules_init.c char *ctdl_module_init_serv_session(void) { if (!threading) { CtdlRegisterProtoHook(cmd_noop, "NOOP", "no operation"); diff --git a/citadel/server/modules/ctdlproto/serv_syscmds.c b/citadel/server/modules/ctdlproto/serv_syscmds.c index a397149a4..c788f1e00 100644 --- a/citadel/server/modules/ctdlproto/serv_syscmds.c +++ b/citadel/server/modules/ctdlproto/serv_syscmds.c @@ -71,10 +71,7 @@ void cmd_scdn(char *argbuf) { } -// **************************************************************************** -// * MODULE INITIALIZATION STUFF * -// **************************************************************************** - +// Initialization function, called from modules_init.c char *ctdl_module_init_syscmd(void) { if (!threading) { CtdlRegisterProtoHook(cmd_down, "DOWN", "perform a server shutdown"); diff --git a/citadel/server/modules/ctdlproto/serv_user.c b/citadel/server/modules/ctdlproto/serv_user.c index d88731745..9e438625c 100644 --- a/citadel/server/modules/ctdlproto/serv_user.c +++ b/citadel/server/modules/ctdlproto/serv_user.c @@ -774,11 +774,7 @@ void cmd_lout(char *argbuf) { } -/*****************************************************************************/ -/* MODULE INITIALIZATION STUFF */ -/*****************************************************************************/ - - +// Initialization function, called from modules_init.c char *ctdl_module_init_serv_user(void) { if (!threading) { CtdlRegisterProtoHook(cmd_user, "USER", "Submit username for login"); diff --git a/citadel/server/modules/expire/serv_expire.c b/citadel/server/modules/expire/serv_expire.c index f204751cb..ca51edd09 100644 --- a/citadel/server/modules/expire/serv_expire.c +++ b/citadel/server/modules/expire/serv_expire.c @@ -823,6 +823,7 @@ void cmd_tdap(char *argbuf) { } +// Initialization function, called from modules_init.c char *ctdl_module_init_expire(void) { if (!threading) { CtdlRegisterProtoHook(cmd_tdap, "TDAP", "Manually initiate auto-purger"); diff --git a/citadel/server/modules/fulltext/serv_fulltext.c b/citadel/server/modules/fulltext/serv_fulltext.c index 5ecba6077..f5a63029c 100644 --- a/citadel/server/modules/fulltext/serv_fulltext.c +++ b/citadel/server/modules/fulltext/serv_fulltext.c @@ -460,8 +460,7 @@ void ft_delete_remove(char *room, long msgnum) } -/*****************************************************************************/ - +// Initialization function, called from modules_init.c char *ctdl_module_init_fulltext(void) { if (!threading) { initialize_ft_cache(); diff --git a/citadel/server/modules/image/serv_image.c b/citadel/server/modules/image/serv_image.c index e6b520f82..dfdec40fa 100644 --- a/citadel/server/modules/image/serv_image.c +++ b/citadel/server/modules/image/serv_image.c @@ -339,7 +339,7 @@ void import_old_userpic_files(void) { } - +// Initialization function, called from modules_init.c char *ctdl_module_init_image(void) { if (!threading) { import_old_userpic_files(); diff --git a/citadel/server/modules/imap/serv_imap.c b/citadel/server/modules/imap/serv_imap.c index 048e470c2..d9cbab282 100644 --- a/citadel/server/modules/imap/serv_imap.c +++ b/citadel/server/modules/imap/serv_imap.c @@ -1,23 +1,21 @@ -/* - * IMAP server for the Citadel system - * - * Copyright (C) 2000-2022 by Art Cancro and others. - * This code is released under the terms of the GNU General Public License. - * - * WARNING: the IMAP protocol is badly designed. No implementation of it - * is perfect. Indeed, with so much gratuitous complexity, *all* IMAP - * implementations have bugs. - * - * 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. - */ +// IMAP server for the Citadel system +// +// Copyright (C) 2000-2022 by Art Cancro and others. +// This code is released under the terms of the GNU General Public License. +// +// WARNING: the IMAP protocol is badly designed. No implementation of it +// is perfect. Indeed, with so much gratuitous complexity, *all* IMAP +// implementations have bugs. +// +// 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 "../../sysdep.h" #include @@ -163,8 +161,7 @@ void imap_free_msgids(void) /* * If there is a transmitted message in memory, free it */ -void imap_free_transmitted_message(void) -{ +void imap_free_transmitted_message(void) { FreeStrBuf(&IMAP->TransmittedMessage); } @@ -179,8 +176,7 @@ void imap_free_transmitted_message(void) * room, or some other value if we're only interested in an incremental * update. */ -void imap_set_seen_flags(int first_msg) -{ +void imap_set_seen_flags(int first_msg) { citimap *Imap = IMAP; visit vbuf; int i; @@ -263,8 +259,7 @@ void imap_set_seen_flags(int first_msg) * allocate space in the list for REALLOC_INCREMENT messages at a time. This * allows the mapping to proceed much faster. */ -void imap_add_single_msgid(long msgnum, void *userdata) -{ +void imap_add_single_msgid(long msgnum, void *userdata) { citimap *Imap = IMAP; ++Imap->num_msgs; @@ -282,8 +277,7 @@ void imap_add_single_msgid(long msgnum, void *userdata) /* * Set up a message ID map for the current room (folder) */ -void imap_load_msgids(void) -{ +void imap_load_msgids(void) { struct CitContext *CCC = CC; struct cdbdata *cdbfr; citimap *Imap = CCCIMAP; @@ -318,8 +312,7 @@ void imap_load_msgids(void) /* * Re-scan the selected room (folder) and see if it's been changed at all */ -void imap_rescan_msgids(void) -{ +void imap_rescan_msgids(void) { struct CitContext *CCC = CC; citimap *Imap = CCCIMAP; int original_num_msgs = 0; @@ -380,41 +373,28 @@ void imap_rescan_msgids(void) if (message_still_exists == 0) { IAPrintf("* %d EXPUNGE\r\n", i + 1); - /* Here's some nice stupid nonsense. When a - * message is expunged, we have to slide all - * the existing messages up in the message - * array. - */ + // When a message is expunged, we have to slide all the existing messages up in the message array. --Imap->num_msgs; - memmove(&Imap->msgids[i], - &Imap->msgids[i + 1], - (sizeof(long) * - (Imap->num_msgs - i))); - memmove(&Imap->flags[i], - &Imap->flags[i + 1], - (sizeof(unsigned int) * - (Imap->num_msgs - i))); + memmove(&Imap->msgids[i], &Imap->msgids[i + 1], (sizeof(long) * (Imap->num_msgs - i))); + memmove(&Imap->flags[i], &Imap->flags[i + 1], (sizeof(unsigned int) * (Imap->num_msgs - i))); --i; } } } - /* - * Remember how many messages were here before we re-scanned. - */ + // Remember how many messages were here before we re-scanned. original_num_msgs = Imap->num_msgs; if (Imap->num_msgs > 0) { original_highest = Imap->msgids[Imap->num_msgs - 1]; - } else { + } + else { original_highest = 0L; } - /* - * Now peruse the room for *new* messages only. - * This logic is probably the cause of Bug # 368 - * [ http://bugzilla.citadel.org/show_bug.cgi?id=368 ] - */ + // Now peruse the room for *new* messages only. + // This logic is probably the cause of Bug # 368 + // [ http://bugzilla.citadel.org/show_bug.cgi?id=368 ] if (num_msgs > 0) { for (j = 0; j < num_msgs; ++j) { if (msglist[j] > original_highest) { @@ -450,8 +430,7 @@ void imap_rescan_msgids(void) * This cleanup function blows away the temporary memory and files used by * the IMAP server. */ -void imap_cleanup_function(void) -{ +void imap_cleanup_function(void) { struct CitContext *CCC = CC; citimap *Imap = CCCIMAP; @@ -525,8 +504,7 @@ void imap_output_capability_string(void) { /* * implements the CAPABILITY command */ -void imap_capability(int num_parms, ConstStr *Params) -{ +void imap_capability(int num_parms, ConstStr *Params) { IAPuts("* "); imap_output_capability_string(); IAPuts("\r\n"); @@ -543,8 +521,7 @@ void imap_capability(int num_parms, ConstStr *Params) * making use of this extension. * */ -void imap_id(int num_parms, ConstStr *Params) -{ +void imap_id(int num_parms, ConstStr *Params) { IAPuts("* ID NIL\r\n"); IReply("OK ID completed"); } @@ -553,8 +530,7 @@ void imap_id(int num_parms, ConstStr *Params) /* * Here's where our IMAP session begins its happy day. */ -void imap_greeting(void) -{ +void imap_greeting(void) { citimap *Imap; CitContext *CCC = CC; @@ -567,8 +543,7 @@ void imap_greeting(void) Imap->cached_rfc822_withbody = 0; Imap->Reply = NewStrBufPlain(NULL, SIZ * 10); /* 40k */ - if (CCC->nologin) - { + if (CCC->nologin) { IAPuts("* BYE; Server busy, try later\r\n"); CCC->kill_me = KILLME_NOLOGIN; IUnbuffer(); @@ -597,8 +572,7 @@ void imaps_greeting(void) { /* * implements the LOGIN command (ordinary username/password login) */ -void imap_login(int num_parms, ConstStr *Params) -{ +void imap_login(int num_parms, ConstStr *Params) { switch (num_parms) { case 3: @@ -641,8 +615,7 @@ void imap_login(int num_parms, ConstStr *Params) /* * Implements the AUTHENTICATE command */ -void imap_authenticate(int num_parms, ConstStr *Params) -{ +void imap_authenticate(int num_parms, ConstStr *Params) { char UsrBuf[SIZ]; if (num_parms != 3) { @@ -686,8 +659,7 @@ void imap_authenticate(int num_parms, ConstStr *Params) } -void imap_auth_plain(void) -{ +void imap_auth_plain(void) { citimap *Imap = IMAP; const char *decoded_authstring; char ident[256] = ""; @@ -701,8 +673,7 @@ void imap_auth_plain(void) memset(pass, 0, sizeof(pass)); decoded_len = StrBufDecodeBase64(Imap->Cmd.CmdBuf); - if (decoded_len > 0) - { + if (decoded_len > 0) { decoded_authstring = ChrPtr(Imap->Cmd.CmdBuf); len = safestrncpy(ident, decoded_authstring, sizeof ident); @@ -710,16 +681,14 @@ void imap_auth_plain(void) decoded_len -= len - 1; decoded_authstring += len + 1; - if (decoded_len > 0) - { + if (decoded_len > 0) { len = safestrncpy(user, decoded_authstring, sizeof user); decoded_authstring += len + 1; decoded_len -= len - 1; } - if (decoded_len > 0) - { + if (decoded_len > 0) { plen = safestrncpy(pass, decoded_authstring, sizeof pass); if (plen < 0) @@ -745,12 +714,11 @@ void imap_auth_plain(void) } -void imap_auth_login_user(long state) -{ +void imap_auth_login_user(long state) { char PWBuf[SIZ]; citimap *Imap = IMAP; - switch (state){ + switch (state) { case imap_as_expecting_username: StrBufDecodeBase64(Imap->Cmd.CmdBuf); CtdlLoginExistingUser(ChrPtr(Imap->Cmd.CmdBuf)); @@ -773,8 +741,7 @@ void imap_auth_login_user(long state) } -void imap_auth_login_pass(long state) -{ +void imap_auth_login_pass(long state) { citimap *Imap = IMAP; const char *pass = NULL; long len = 0; @@ -796,7 +763,8 @@ void imap_auth_login_pass(long state) if (CtdlTryPassword(pass, len) == pass_ok) { IAPrintf("%s OK authentication succeeded\r\n", Imap->authseq); - } else { + } + else { IAPrintf("%s NO authentication failed\r\n", Imap->authseq); } Imap->authstate = imap_as_normal; @@ -807,8 +775,7 @@ void imap_auth_login_pass(long state) /* * implements the STARTTLS command (Citadel API version) */ -void imap_starttls(int num_parms, ConstStr *Params) -{ +void imap_starttls(int num_parms, ConstStr *Params) { char ok_response[SIZ]; char nosup_response[SIZ]; char error_response[SIZ]; @@ -823,8 +790,7 @@ void imap_starttls(int num_parms, ConstStr *Params) /* * implements the SELECT command */ -void imap_select(int num_parms, ConstStr *Params) -{ +void imap_select(int num_parms, ConstStr *Params) { citimap *Imap = IMAP; char towhere[ROOMNAMELEN]; char augmented_roomname[ROOMNAMELEN]; @@ -885,7 +851,8 @@ void imap_select(int num_parms, ConstStr *Params) if (!strcasecmp(Params[1].Key, "EXAMINE")) { Imap->readonly = 1; - } else { + } + else { Imap->readonly = 0; } @@ -919,8 +886,7 @@ void imap_select(int num_parms, ConstStr *Params) /* * Does the real work for expunge. */ -int imap_do_expunge(void) -{ +int imap_do_expunge(void) { struct CitContext *CCC = CC; citimap *Imap = CCCIMAP; int i; @@ -959,8 +925,7 @@ int imap_do_expunge(void) /* * implements the EXPUNGE command syntax */ -void imap_expunge(int num_parms, ConstStr *Params) -{ +void imap_expunge(int num_parms, ConstStr *Params) { int num_expunged = 0; num_expunged = imap_do_expunge(); @@ -971,8 +936,7 @@ void imap_expunge(int num_parms, ConstStr *Params) /* * implements the CLOSE command */ -void imap_close(int num_parms, ConstStr *Params) -{ +void imap_close(int num_parms, ConstStr *Params) { /* Yes, we always expunge on close. */ if (IMAP->selected) { @@ -989,8 +953,7 @@ void imap_close(int num_parms, ConstStr *Params) /* * Implements the NAMESPACE command. */ -void imap_namespace(int num_parms, ConstStr *Params) -{ +void imap_namespace(int num_parms, ConstStr *Params) { long len; int i; struct floor *fl; @@ -1002,7 +965,7 @@ void imap_namespace(int num_parms, ConstStr *Params) /* All personal folders are subordinate to INBOX. */ IAPuts("((\"INBOX/\" \"/\")) "); - /* Other users' folders ... coming soon! FIXME */ + /* Other users' folders ... eventually? FIXME */ IAPuts("NIL "); /* Show all floors as shared namespaces. Neato! */ @@ -1030,8 +993,7 @@ void imap_namespace(int num_parms, ConstStr *Params) * Implements the CREATE command * */ -void imap_create(int num_parms, ConstStr *Params) -{ +void imap_create(int num_parms, ConstStr *Params) { int ret; char roomname[ROOMNAMELEN]; int floornum; @@ -1071,7 +1033,8 @@ void imap_create(int num_parms, ConstStr *Params) if (flags & IR_MAILBOX) { newroomtype = 4; /* private mailbox */ newroomview = VIEW_MAILBOX; - } else { + } + else { newroomtype = 0; /* public folder */ newroomview = VIEW_BBS; } @@ -1081,11 +1044,11 @@ void imap_create(int num_parms, ConstStr *Params) ret = CtdlCreateRoom(roomname, newroomtype, "", floornum, 1, 0, newroomview); if (ret == 0) { - /*** DO NOT CHANGE THIS ERROR MESSAGE IN ANY WAY! BYNARI CONNECTOR DEPENDS ON IT! ***/ IReply("NO Mailbox already exists, or create failed"); - } else { + } + else { IReply("OK CREATE completed"); - /* post a message in Aide> describing the new room */ + // post a message in Aide> describing the new room notification_message = malloc(1024); snprintf(notification_message, 1024, "A new room called \"%s\" has been created by %s%s%s%s\n", @@ -1106,8 +1069,7 @@ void imap_create(int num_parms, ConstStr *Params) * Locate a room by its IMAP folder name, and check access to it. * If zapped_ok is nonzero, we can also look for the room in the zapped list. */ -int imap_grabroom(char *returned_roomname, const char *foldername, int zapped_ok) -{ +int imap_grabroom(char *returned_roomname, const char *foldername, int zapped_ok) { int ret; char augmented_roomname[ROOMNAMELEN]; char roomname[ROOMNAMELEN]; @@ -1162,8 +1124,7 @@ int imap_grabroom(char *returned_roomname, const char *foldername, int zapped_ok * Implements the STATUS command (sort of) * */ -void imap_status(int num_parms, ConstStr *Params) -{ +void imap_status(int num_parms, ConstStr *Params) { long len; int ret; char roomname[ROOMNAMELEN]; @@ -1220,8 +1181,7 @@ void imap_status(int num_parms, ConstStr *Params) * Implements the SUBSCRIBE command * */ -void imap_subscribe(int num_parms, ConstStr *Params) -{ +void imap_subscribe(int num_parms, ConstStr *Params) { int ret; char roomname[ROOMNAMELEN]; char savedroom[ROOMNAMELEN]; @@ -1262,8 +1222,7 @@ void imap_subscribe(int num_parms, ConstStr *Params) * Implements the UNSUBSCRIBE command * */ -void imap_unsubscribe(int num_parms, ConstStr *Params) -{ +void imap_unsubscribe(int num_parms, ConstStr *Params) { int ret; char roomname[ROOMNAMELEN]; char savedroom[ROOMNAMELEN]; @@ -1306,8 +1265,7 @@ void imap_unsubscribe(int num_parms, ConstStr *Params) * Implements the DELETE command * */ -void imap_delete(int num_parms, ConstStr *Params) -{ +void imap_delete(int num_parms, ConstStr *Params) { int ret; char roomname[ROOMNAMELEN]; char savedroom[ROOMNAMELEN]; @@ -1352,8 +1310,7 @@ void imap_delete(int num_parms, ConstStr *Params) /* * Back end function for imap_rename() */ -void imap_rename_backend(struct ctdlroom *qrbuf, void *data) -{ +void imap_rename_backend(struct ctdlroom *qrbuf, void *data) { char foldername[SIZ]; char newfoldername[SIZ]; char newroomname[ROOMNAMELEN]; @@ -1382,8 +1339,7 @@ void imap_rename_backend(struct ctdlroom *qrbuf, void *data) * Implements the RENAME command * */ -void imap_rename(int num_parms, ConstStr *Params) -{ +void imap_rename(int num_parms, ConstStr *Params) { char old_room[ROOMNAMELEN]; char new_room[ROOMNAMELEN]; int newr; @@ -1476,8 +1432,7 @@ void imap_rename(int num_parms, ConstStr *Params) /* * Main command loop for IMAP sessions. */ -void imap_command_loop(void) -{ +void imap_command_loop(void) { struct CitContext *CCC = CC; struct timeval tv1, tv2; suseconds_t total_time = 0; @@ -1518,10 +1473,7 @@ void imap_command_loop(void) pchs = ChrPtr(Imap->Cmd.CmdBuf); pche = pchs + StrLength(Imap->Cmd.CmdBuf); - while ((pche > pchs) && - ((*pche == '\n') || - (*pche == '\r'))) - { + while ((pche > pchs) && ((*pche == '\n') || (*pche == '\r'))) { pche --; StrBufCutRight(Imap->Cmd.CmdBuf, 1); } @@ -1560,30 +1512,11 @@ void imap_command_loop(void) /* Grab the tag, command, and parameters. */ imap_parameterize(&Imap->Cmd); -#if 0 -/* debug output the parsed vector */ - { - int i; - syslog(LOG_DEBUG, "----- %ld params", Imap->Cmd.num_parms); - - for (i=0; i < Imap->Cmd.num_parms; i++) { - if (Imap->Cmd.Params[i].len != strlen(Imap->Cmd.Params[i].Key)) - syslog(LOG_DEBUG, "*********** %ld != %ld : %s", - Imap->Cmd.Params[i].len, - strlen(Imap->Cmd.Params[i].Key), - Imap->Cmd.Params[i].Key); - else - syslog(LOG_DEBUG, "%ld : %s", - Imap->Cmd.Params[i].len, - Imap->Cmd.Params[i].Key); - }} -#endif /* Now for the command set. */ h = imap_lookup(Imap->Cmd.num_parms, Imap->Cmd.Params); - if (h == NULL) - { + if (h == NULL) { IReply("BAD command unrecognized"); goto BAIL; } @@ -1591,14 +1524,12 @@ void imap_command_loop(void) /* RFC3501 says that we cannot output untagged data during these commands */ if ((h->Flags & I_FLAG_UNTAGGED) == 0) { - /* we can put any additional untagged stuff right here in the future */ + // we can put any additional untagged stuff right here in the future - /* - * Before processing the command that was just entered... if we happen - * to have a folder selected, we'd like to rescan that folder for new - * messages, and for deletions/changes of existing messages. This - * could probably be optimized better with some deep thought... - */ + // Before processing the command that was just entered... if we happen + // to have a folder selected, we'd like to rescan that folder for new + // messages, and for deletions/changes of existing messages. This + // could probably be optimized better with some deep thought... if (Imap->selected) { imap_rescan_msgids(); } @@ -1632,13 +1563,13 @@ BAIL: ); } -void imap_noop (int num_parms, ConstStr *Params) -{ + +void imap_noop(int num_parms, ConstStr *Params) { IReply("OK No operation"); } -void imap_logout(int num_parms, ConstStr *Params) -{ + +void imap_logout(int num_parms, ConstStr *Params) { if (IMAP->selected) { imap_do_expunge(); /* yes, we auto-expunge at logout */ } @@ -1648,12 +1579,12 @@ void imap_logout(int num_parms, ConstStr *Params) return; } + const char *CitadelServiceIMAP="IMAP"; const char *CitadelServiceIMAPS="IMAPS"; -/* - * This function is called to register the IMAP extension with Citadel. - */ + +// Initialization function, called from modules_init.c char *ctdl_module_init_imap(void) { if (ImapCmds == NULL) { ImapCmds = NewHash(1, NULL); @@ -1705,15 +1636,13 @@ char *ctdl_module_init_imap(void) { RegisterImapCMD("CLOSE", "", imap_close, I_FLAG_LOGGED_IN | I_FLAG_SELECT); if (!threading) { - CtdlRegisterServiceHook(CtdlGetConfigInt("c_imap_port"), - NULL, imap_greeting, imap_command_loop, NULL, CitadelServiceIMAP); + CtdlRegisterServiceHook(CtdlGetConfigInt("c_imap_port"), NULL, imap_greeting, imap_command_loop, NULL, CitadelServiceIMAP); #ifdef HAVE_OPENSSL - CtdlRegisterServiceHook(CtdlGetConfigInt("c_imaps_port"), - NULL, imaps_greeting, imap_command_loop, NULL, CitadelServiceIMAPS); + CtdlRegisterServiceHook(CtdlGetConfigInt("c_imaps_port"), NULL, imaps_greeting, imap_command_loop, NULL, CitadelServiceIMAPS); #endif CtdlRegisterSessionHook(imap_cleanup_function, EVT_STOP, PRIO_STOP + 30); } - /* return our module name for the log */ + // return our module name for the log return "imap"; } diff --git a/citadel/server/modules/inboxrules/serv_inboxrules.c b/citadel/server/modules/inboxrules/serv_inboxrules.c index 17340a1c2..fb6bdd66e 100644 --- a/citadel/server/modules/inboxrules/serv_inboxrules.c +++ b/citadel/server/modules/inboxrules/serv_inboxrules.c @@ -967,6 +967,7 @@ void cmd_pibr(char *argbuf) { } +// Initialization function, called from modules_init.c char *ctdl_module_init_sieve(void) { if (!threading) { CtdlRegisterProtoHook(cmd_gibr, "GIBR", "Get InBox Rules"); diff --git a/citadel/server/modules/inetcfg/serv_inetcfg.c b/citadel/server/modules/inetcfg/serv_inetcfg.c index ee763a920..de095a2f8 100644 --- a/citadel/server/modules/inetcfg/serv_inetcfg.c +++ b/citadel/server/modules/inetcfg/serv_inetcfg.c @@ -122,11 +122,7 @@ void inetcfg_init(void) { } -/*****************************************************************************/ -/* MODULE INITIALIZATION STUFF */ -/*****************************************************************************/ - - +// Initialization function, called from modules_init.c char *ctdl_module_init_inetcfg(void) { if (!threading) { CtdlRegisterMessageHook(inetcfg_aftersave, EVT_AFTERSAVE); diff --git a/citadel/server/modules/instmsg/serv_instmsg.c b/citadel/server/modules/instmsg/serv_instmsg.c index 1e2d0f043..978efef6d 100644 --- a/citadel/server/modules/instmsg/serv_instmsg.c +++ b/citadel/server/modules/instmsg/serv_instmsg.c @@ -558,15 +558,17 @@ void flush_conversations_to_disk(time_t if_older_than) { } - void instmsg_timer(void) { flush_conversations_to_disk(300); /* Anything that hasn't peeped in more than 5 minutes */ } + void instmsg_shutdown(void) { flush_conversations_to_disk(0); /* Get it ALL onto disk NOW. */ } + +// Initialization function, called from modules_init.c char *ctdl_module_init_instmsg(void) { if (!threading) { CtdlRegisterProtoHook(cmd_gexp, "GEXP", "Get instant messages"); diff --git a/citadel/server/modules/listdeliver/serv_listdeliver.c b/citadel/server/modules/listdeliver/serv_listdeliver.c index e3b1d23d7..61df918cf 100644 --- a/citadel/server/modules/listdeliver/serv_listdeliver.c +++ b/citadel/server/modules/listdeliver/serv_listdeliver.c @@ -238,7 +238,7 @@ void listdeliver_sweep(void) { } -// Module entry point +// Initialization function, called from modules_init.c char *ctdl_module_init_listdeliver(void) { if (!threading) { CtdlRegisterSessionHook(listdeliver_sweep, EVT_TIMER, PRIO_AGGR + 50); diff --git a/citadel/server/modules/listsub/serv_listsub.c b/citadel/server/modules/listsub/serv_listsub.c index 80adb60f0..70f6174e3 100644 --- a/citadel/server/modules/listsub/serv_listsub.c +++ b/citadel/server/modules/listsub/serv_listsub.c @@ -291,9 +291,7 @@ void cmd_lsub(char *cmdbuf) { } -/* - * Module entry point - */ +// Initialization function, called from modules_init.c char *ctdl_module_init_listsub(void) { if (!threading) { CtdlRegisterProtoHook(cmd_lsub, "LSUB", "List subscribe/unsubscribe"); diff --git a/citadel/server/modules/migrate/serv_migrate.c b/citadel/server/modules/migrate/serv_migrate.c index 698cf1cbc..994d90875 100644 --- a/citadel/server/modules/migrate/serv_migrate.c +++ b/citadel/server/modules/migrate/serv_migrate.c @@ -1114,10 +1114,7 @@ void cmd_migr(char *cmdbuf) { } -// ****************************************************************************** -// * Module Hook * -// ****************************************************************************** - +// Initialization function, called from modules_init.c char *ctdl_module_init_migrate() { if (!threading) { CtdlRegisterProtoHook(cmd_migr, "MIGR", "Across-the-wire migration"); diff --git a/citadel/server/modules/newuser/serv_newuser.c b/citadel/server/modules/newuser/serv_newuser.c index 751ecb314..37563c08a 100644 --- a/citadel/server/modules/newuser/serv_newuser.c +++ b/citadel/server/modules/newuser/serv_newuser.c @@ -81,6 +81,7 @@ void CopyNewUserGreetings(void) { } +// Initialization function, called from modules_init.c char *ctdl_module_init_newuser(void) { if (!threading) { CtdlRegisterSessionHook(CopyNewUserGreetings, EVT_LOGIN, PRIO_LOGIN + 1); diff --git a/citadel/server/modules/nntp/serv_nntp.c b/citadel/server/modules/nntp/serv_nntp.c index 5db995d74..e2c7bd75d 100644 --- a/citadel/server/modules/nntp/serv_nntp.c +++ b/citadel/server/modules/nntp/serv_nntp.c @@ -1142,6 +1142,8 @@ void nntp_cleanup_function(void) { const char *CitadelServiceNNTP="NNTP"; const char *CitadelServiceNNTPS="NNTPS"; + +// Initialization function, called from modules_init.c char *ctdl_module_init_nntp(void) { if (!threading) { CtdlRegisterServiceHook(CtdlGetConfigInt("c_nntp_port"), diff --git a/citadel/server/modules/notes/serv_notes.c b/citadel/server/modules/notes/serv_notes.c index 2f32faef6..1351db3da 100644 --- a/citadel/server/modules/notes/serv_notes.c +++ b/citadel/server/modules/notes/serv_notes.c @@ -145,6 +145,7 @@ int serv_notes_beforesave(struct CtdlMessage *msg, struct recptypes *recp) } +// Initialization function, called from modules_init.c char *ctdl_module_init_notes(void) { if (!threading) { CtdlRegisterMessageHook(serv_notes_beforesave, EVT_BEFORESAVE); diff --git a/citadel/server/modules/openid/serv_openid_rp.c b/citadel/server/modules/openid/serv_openid_rp.c index 7f34b601f..2942223df 100644 --- a/citadel/server/modules/openid/serv_openid_rp.c +++ b/citadel/server/modules/openid/serv_openid_rp.c @@ -1137,14 +1137,7 @@ void cmd_oidf(char *argbuf) { } - -/**************************************************************************/ -/* */ -/* Functions in this section handle module initialization and shutdown */ -/* */ -/**************************************************************************/ - - +// Initialization function, called from modules_init.c char *ctdl_module_init_openid_rp(void) { if (!threading) { /* Only enable the OpenID command set when native mode authentication is in use. */ diff --git a/citadel/server/modules/pop3/serv_pop3.c b/citadel/server/modules/pop3/serv_pop3.c index 7eca60dc9..e6b018d5a 100644 --- a/citadel/server/modules/pop3/serv_pop3.c +++ b/citadel/server/modules/pop3/serv_pop3.c @@ -573,6 +573,7 @@ const char *CitadelServicePop3="POP3"; const char *CitadelServicePop3S="POP3S"; +// Initialization function, called from modules_init.c char *ctdl_module_init_pop3(void) { if (!threading) { CtdlRegisterServiceHook(CtdlGetConfigInt("c_pop3_port"), diff --git a/citadel/server/modules/pop3client/serv_pop3client.c b/citadel/server/modules/pop3client/serv_pop3client.c index d8fc9270e..05a5cffa6 100644 --- a/citadel/server/modules/pop3client/serv_pop3client.c +++ b/citadel/server/modules/pop3client/serv_pop3client.c @@ -250,11 +250,12 @@ void pop3client_scan(void) { } +// Initialization function, called from modules_init.c char *ctdl_module_init_pop3client(void) { if (!threading) { CtdlRegisterSessionHook(pop3client_scan, EVT_TIMER, PRIO_AGGR + 50); } - /* return our module id for the log */ + /* return our module name for the log */ return "pop3client"; } diff --git a/citadel/server/modules/roomchat/serv_roomchat.c b/citadel/server/modules/roomchat/serv_roomchat.c index 4f3a71eae..4adb1a492 100644 --- a/citadel/server/modules/roomchat/serv_roomchat.c +++ b/citadel/server/modules/roomchat/serv_roomchat.c @@ -238,6 +238,7 @@ void cmd_rcht(char *argbuf) } +// Initialization function, called from modules_init.c char *ctdl_module_init_roomchat(void) { if (!threading) { CtdlRegisterProtoHook(cmd_rcht, "RCHT", "Participate in real time chat in a room"); diff --git a/citadel/server/modules/rssclient/serv_rssclient.c b/citadel/server/modules/rssclient/serv_rssclient.c index e23463a77..b1c42f292 100644 --- a/citadel/server/modules/rssclient/serv_rssclient.c +++ b/citadel/server/modules/rssclient/serv_rssclient.c @@ -451,6 +451,7 @@ void rssclient_scan(void) { } +// Initialization function, called from modules_init.c char *ctdl_module_init_rssclient(void) { if (!threading) { syslog(LOG_INFO, "rssclient: using %s", curl_version()); diff --git a/citadel/server/modules/rwho/serv_rwho.c b/citadel/server/modules/rwho/serv_rwho.c index ef1b7dac4..557f6042d 100644 --- a/citadel/server/modules/rwho/serv_rwho.c +++ b/citadel/server/modules/rwho/serv_rwho.c @@ -177,6 +177,7 @@ void cmd_stel(char *cmdbuf) } +// Initialization function, called from modules_init.c char *ctdl_module_init_rwho(void) { if (!threading) { CtdlRegisterProtoHook(cmd_rwho, "RWHO", "Display who is online"); diff --git a/citadel/server/modules/smtp/serv_smtp.c b/citadel/server/modules/smtp/serv_smtp.c index 3a89d4e08..8707406bf 100644 --- a/citadel/server/modules/smtp/serv_smtp.c +++ b/citadel/server/modules/smtp/serv_smtp.c @@ -1018,6 +1018,7 @@ const char *CitadelServiceSMTP_LMTP="LMTP"; const char *CitadelServiceSMTP_LMTP_UNF="LMTP-UnF"; +// Initialization function, called from modules_init.c char *ctdl_module_init_smtp(void) { if (!threading) { CtdlRegisterServiceHook(CtdlGetConfigInt("c_smtp_port"), /* SMTP MTA */ diff --git a/citadel/server/modules/smtp/serv_smtpclient.c b/citadel/server/modules/smtp/serv_smtpclient.c index 1ff3d6d3b..b6bb3ad65 100644 --- a/citadel/server/modules/smtp/serv_smtpclient.c +++ b/citadel/server/modules/smtp/serv_smtpclient.c @@ -558,7 +558,7 @@ void smtp_do_queue(void) { } -// Module entry point +// Initialization function, called from modules_init.c char *ctdl_module_init_smtpclient(void) { if (!threading) { CtdlRegisterMessageHook(smtp_aftersave, EVT_AFTERSAVE); diff --git a/citadel/server/modules/spam/serv_spam.c b/citadel/server/modules/spam/serv_spam.c index 97d1e23b6..0a576a37b 100644 --- a/citadel/server/modules/spam/serv_spam.c +++ b/citadel/server/modules/spam/serv_spam.c @@ -170,7 +170,7 @@ bail: close(sock); } - +// Initialization function, called from modules_init.c char *ctdl_module_init_spam(void) { if (!threading) { CtdlRegisterMessageHook(spam_assassin, EVT_SMTPSCAN); diff --git a/citadel/server/modules/test/serv_test.c b/citadel/server/modules/test/serv_test.c index 7445ac0bc..91602997d 100644 --- a/citadel/server/modules/test/serv_test.c +++ b/citadel/server/modules/test/serv_test.c @@ -47,6 +47,7 @@ void LoginTest(void) { syslog(LOG_DEBUG, "--- Hello, %s ---\n", CC->curr_user); } +// Initialization function, called from modules_init.c // To insert this module into the server activate the next block by changing the #if 0 to #if 1 char *ctdl_module_init_test() { #if 0 diff --git a/citadel/server/modules/upgrade/serv_upgrade.c b/citadel/server/modules/upgrade/serv_upgrade.c index d8369963b..722ba5752 100644 --- a/citadel/server/modules/upgrade/serv_upgrade.c +++ b/citadel/server/modules/upgrade/serv_upgrade.c @@ -566,6 +566,7 @@ void post_startup_upgrades(void) { } +// Initialization function, called from modules_init.c char *ctdl_module_init_upgrade(void) { if (!threading) { post_startup_upgrades(); diff --git a/citadel/server/modules/vcard/serv_vcard.c b/citadel/server/modules/vcard/serv_vcard.c index 61d9ef7d8..cd1bcde31 100644 --- a/citadel/server/modules/vcard/serv_vcard.c +++ b/citadel/server/modules/vcard/serv_vcard.c @@ -1206,9 +1206,10 @@ void vcard_fixed_output(char *ptr, int len) { vcard_free(v); } - const char *CitadelServiceDICT_TCP="DICT_TCP"; + +// Initialization function, called from modules_init.c char *ctdl_module_init_vcard(void) { struct ctdlroom qr; diff --git a/citadel/server/modules/wiki/serv_wiki.c b/citadel/server/modules/wiki/serv_wiki.c index a4bc7c699..427c8a2c4 100644 --- a/citadel/server/modules/wiki/serv_wiki.c +++ b/citadel/server/modules/wiki/serv_wiki.c @@ -712,9 +712,7 @@ void cmd_wiki(char *argbuf) { -/* - * Module initialization - */ +// Initialization function, called from modules_init.c char *ctdl_module_init_wiki() { if (!threading) { CtdlRegisterMessageHook(wiki_upload_beforesave, EVT_BEFORESAVE); diff --git a/citadel/server/modules/xmpp/serv_xmpp.c b/citadel/server/modules/xmpp/serv_xmpp.c index c81720ca0..1a0ec98c2 100644 --- a/citadel/server/modules/xmpp/serv_xmpp.c +++ b/citadel/server/modules/xmpp/serv_xmpp.c @@ -651,6 +651,9 @@ void xmpp_logout_hook(void) { const char *CitadelServiceXMPP="XMPP"; + + +// Initialization function, called from modules_init.c char *ctdl_module_init_xmpp() { if (!threading) { CtdlRegisterServiceHook(CtdlGetConfigInt("c_xmpp_c2s_port"), diff --git a/citadel/server/modules_init.h b/citadel/server/modules_init.h index 0513dcde7..426253240 100644 --- a/citadel/server/modules_init.h +++ b/citadel/server/modules_init.h @@ -61,4 +61,4 @@ char *ctdl_module_init_vcard(void); char *ctdl_module_init_wiki(void); char *ctdl_module_init_xmpp(void); char *ctdl_module_init_netconfig(void); -#endif /* MODULES_INIT_H */ +#endif // MODULES_INIT_H -- 2.39.2