This is an experiment in reducing the use of the "CC" macro
that appears everywhere in the server. Willi used to do a lot
of "struct CitContext *CCC = CC" but that still called the macro
once per function call and it added complexity to the code. This
method is the right way, actually passing the session context up
the stack like we do in WebCit-NG.
// Main source module for the Citadel server
//
// Main source module for the Citadel server
//
-// Copyright (c) 1987-2023 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.
//
// This program is open source software. Use, duplication, or disclosure
// is subject to the terms of the GNU General Public License, version 3.
// returns an asterisk if there are any instant messages waiting, space otherwise.
// returns an asterisk if there are any instant messages waiting, space otherwise.
-char CtdlCheckExpress(void) {
- if (CC->FirstExpressMessage == NULL) {
+char CtdlCheckExpress(struct CitContext *con) {
+ if (con->FirstExpressMessage == NULL) {
-// Copyright (c) 1987-2023 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.
//
// This program is open source software. Use, duplication, or disclosure
// is subject to the terms of the GNU General Public License, version 3.
void citproto_begin_session(void);
void citproto_begin_admin_session(void);
void help_subst (char *strbuf, char *source, char *dest);
void citproto_begin_session(void);
void citproto_begin_admin_session(void);
void help_subst (char *strbuf, char *source, char *dest);
-char CtdlCheckExpress(void);
+char CtdlCheckExpress(struct CitContext *con);
int CheckIfAlreadySeen(StrBuf *guid);
void ctdl_lockfile(int);
int CheckIfAlreadySeen(StrBuf *guid);
void ctdl_lockfile(int);
// Server functions which perform operations on room objects.
//
// Server functions which perform operations on room objects.
//
-// Copyright (c) 1987-2022 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 open source software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License, version 3.
CtdlGetRoom(&CC->room, CC->room.QRname);
cprintf("%d%c%s|%s|%s|%d|%d|%d|%d|%d|\n",
CIT_OK,
CtdlGetRoom(&CC->room, CC->room.QRname);
cprintf("%d%c%s|%s|%s|%d|%d|%d|%d|%d|\n",
CIT_OK,
((CC->room.QRflags & QR_MAILBOX) ? &CC->room.QRname[11] : CC->room.QRname),
((CC->room.QRflags & QR_PASSWORDED) ? CC->room.QRpasswd : ""),
((CC->room.QRflags & QR_DIRECTORY) ? CC->room.QRdirname : ""),
((CC->room.QRflags & QR_MAILBOX) ? &CC->room.QRname[11] : CC->room.QRname),
((CC->room.QRflags & QR_PASSWORDED) ? CC->room.QRpasswd : ""),
((CC->room.QRflags & QR_DIRECTORY) ? CC->room.QRdirname : ""),
// Server functions which perform operations on user objects.
//
// Server functions which perform operations on user objects.
//
-// 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 open source software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License, version 3.
void cmd_noop(char *argbuf) {
void cmd_noop(char *argbuf) {
- cprintf("%d%cok\n", CIT_OK, CtdlCheckExpress() );
+ cprintf("%d%cok\n", CIT_OK, CtdlCheckExpress(CC) );
/*
* This module handles instant messaging between users.
*
/*
* This module handles instant messaging between users.
*
- * Copyright (c) 2012-2022 by the citadel.org team
+ * Copyright (c) 2012-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 open source software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3.
- cprintf("%d%c \n", LISTING_FOLLOWS, CtdlCheckExpress() );
+ cprintf("%d%c \n", LISTING_FOLLOWS, CtdlCheckExpress(CC) );
nptr = CtdlGetContextArray(&nContexts) ; // grab a copy of the wholist
if (nptr) {
nptr = CtdlGetContextArray(&nContexts) ; // grab a copy of the wholist
if (nptr) {
// This module implements server commands related to the display and
// manipulation of the "Who's online" list.
//
// This module implements server commands related to the display and
// manipulation of the "Who's online" list.
//
-// 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.
//
// This program is open source software. Use, duplication, or disclosure
// is subject to the terms of the GNU General Public License, version 3.
nptr = CtdlGetContextArray(&nContexts) ;
if (!nptr) {
// Couldn't malloc so we have to bail but stick to the protocol
nptr = CtdlGetContextArray(&nContexts) ;
if (!nptr) {
// Couldn't malloc so we have to bail but stick to the protocol
- cprintf("%d%c \n", LISTING_FOLLOWS, CtdlCheckExpress() );
+ cprintf("%d%c \n", LISTING_FOLLOWS, CtdlCheckExpress(CC) );
cprintf("000\n");
return;
}
aide = ( (CC->user.axlevel >= AxAideU) || (CC->internal_pgm) ) ;
cprintf("000\n");
return;
}
aide = ( (CC->user.axlevel >= AxAideU) || (CC->internal_pgm) ) ;
- cprintf("%d%c \n", LISTING_FOLLOWS, CtdlCheckExpress() );
+ cprintf("%d%c \n", LISTING_FOLLOWS, CtdlCheckExpress(CC) );
for (i=0; i<nContexts; i++) {
flags[0] = '\0';
for (i=0; i<nContexts; i++) {
flags[0] = '\0';
if (display_result) {
cprintf("%d%c%s|%d|%d|%d|%d|%ld|%ld|%d|%d|%d|%d|%d|%d|%d|%d|%ld|\n",
if (display_result) {
cprintf("%d%c%s|%d|%d|%d|%d|%ld|%ld|%d|%d|%d|%d|%d|%d|%d|%d|%ld|\n",
- CIT_OK, CtdlCheckExpress(),
+ CIT_OK, CtdlCheckExpress(CC),
truncated_roomname,
(int)new_messages,
(int)total_messages,
truncated_roomname,
(int)new_messages,
(int)total_messages,