// Back end for the MSGS command: output header summary.
void headers_listing(long msgnum, void *userdata) {
struct CtdlMessage *msg;
- int output_mode = *(int *)userdata;
+ int output_mode = *(int *)userdata;
msg = CtdlFetchMessage(msgnum, 0);
if (msg == NULL) {
int cm_ref = 0;
int with_template = 0;
struct CtdlMessage *template = NULL;
- msg_filter filt;
+ msg_filter filt;
char search_string[1024];
ForEachMsgCallback CallBack;
if (with_template == 1) {
memset(buf, 0, 5);
unbuffer_output();
- cprintf("%d Send template then receive message list\n", START_CHAT_MODE);
+ cprintf("%d Send template then receive message list\n", SEND_THEN_RECV);
template = (struct CtdlMessage *) malloc(sizeof(struct CtdlMessage));
memset(template, 0, sizeof(struct CtdlMessage));
template->cm_magic = CTDLMESSAGE_MAGIC;
else if (with_template == 2) {
long i = 0;
memset(buf, 0, 5);
- cprintf("%d Send list of headers\n",
- START_CHAT_MODE);
+ cprintf("%d Send list of headers\n", SEND_THEN_RECV);
filt.Filter = NewHash(1, lFlathash);
filt.buffer = NewStrBufPlain(NULL, 1024);
while(client_getln(buf, sizeof buf) >= 0 && strcmp(buf,"000")) {
if (with_template < 2) {
CtdlForEachMessage(mode,
- ( (mode == MSGS_SEARCH) ? 0 : cm_ref ),
- ( (mode == MSGS_SEARCH) ? search_string : NULL ),
- NULL,
- template,
- CallBack,
- &output_mode);
+ ( (mode == MSGS_SEARCH) ? 0 : cm_ref ),
+ ( (mode == MSGS_SEARCH) ? search_string : NULL ),
+ NULL,
+ template,
+ CallBack,
+ &output_mode
+ );
if (template != NULL) CM_Free(template);
}
else {
CtdlForEachMessage(mode,
- ( (mode == MSGS_SEARCH) ? 0 : cm_ref ),
- ( (mode == MSGS_SEARCH) ? search_string : NULL ),
- NULL,
- NULL,
- CallBack,
- &filt);
+ ( (mode == MSGS_SEARCH) ? 0 : cm_ref ),
+ ( (mode == MSGS_SEARCH) ? search_string : NULL ),
+ NULL,
+ NULL,
+ CallBack,
+ &filt
+ );
DeleteHashPos(&filt.p);
DeleteHash(&filt.Filter);
FreeStrBuf(&filt.buffer);
if (IsEmptyStr(newusername)) {
strcpy(newusername, CC->user.fullname);
}
- if ( (CC->user.axlevel < AxAideU)
- && (strcasecmp(newusername, CC->user.fullname))
- && (strcasecmp(newusername, CC->cs_inet_fn))
+ if ( (CC->user.axlevel < AxAideU)
+ && (strcasecmp(newusername, CC->user.fullname))
+ && (strcasecmp(newusername, CC->cs_inet_fn))
) {
cprintf("%d You don't have permission to author messages as '%s'.\n",
ERROR + HIGHER_ACCESS_REQUIRED,
return;
}
- if ((RESTRICT_INTERNET == 1)
- && (valid_to->num_internet + valid_cc->num_internet + valid_bcc->num_internet > 0)
- && ((CC->user.flags & US_INTERNET) == 0)
- && (!CC->internal_pgm)) {
+ if ( (RESTRICT_INTERNET == 1)
+ && (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);
free_recipients(valid_to);
free_recipients(valid_cc);
// Read in the message from the client.
if (do_confirm) {
- cprintf("%d send message\n", START_CHAT_MODE);
+ cprintf("%d send message\n", SEND_THEN_RECV);
}
else {
cprintf("%d send message\n", SEND_LISTING);
}
- msg = CtdlMakeMessage(&CC->user, recp, cc,
- CC->room.QRname, anonymous, format_type,
- newusername, newuseremail, subject,
- ((!IsEmptyStr(supplied_euid)) ? supplied_euid : NULL),
- NULL, references);
+ msg = CtdlMakeMessage(
+ &CC->user, recp, cc,
+ CC->room.QRname, anonymous, format_type,
+ newusername, newuseremail, subject,
+ ((!IsEmptyStr(supplied_euid)) ? supplied_euid : NULL),
+ NULL, references
+ );
// Put together one big recipients struct containing to/cc/bcc all in one. This is for the envelope.
char *all_recps = malloc(SIZ * 3);
if (CC->user.usernum == CC->room.QRroomaide) permit = 1;
// Permit move/copy from personal rooms
- if ((CC->room.QRflags & QR_MAILBOX)
- && (qtemp.QRflags & QR_MAILBOX)) permit = 1;
+ if ( (CC->room.QRflags & QR_MAILBOX)
+ && (qtemp.QRflags & QR_MAILBOX)
+ ) {
+ permit = 1;
+ }
// Permit only copy from public to personal room
if ( (is_copy)
if (CC->room.QRflags2 & QR2_COLLABDEL) permit = 1;
// Users allowed to post into the target room may move into it too.
- if ((CC->room.QRflags & QR_MAILBOX) &&
- (qtemp.QRflags & UA_POSTALLOWED)) permit = 1;
+ if ( (CC->room.QRflags & QR_MAILBOX)
+ && (qtemp.QRflags & UA_POSTALLOWED)
+ ) {
+ permit = 1;
+ }
// User must have access to target room
- if (!(ra & UA_KNOWN)) permit = 0;
+ if (!(ra & UA_KNOWN)) {
+ permit = 0;
+ }
if (!permit) {
cprintf("%d Higher access required.\n", ERROR + HIGHER_ACCESS_REQUIRED);