X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmsgbase.c;h=7d325aeba17425fd405e900a980a58dfab59612c;hb=acddc5761717d2f004a8380bef154e7a5f954938;hp=4b2c9ed850cba46ba7e790739fec025329bd3c70;hpb=d6be8789cf70fea7b80d333f28ce63e370f1fd07;p=citadel.git diff --git a/citadel/msgbase.c b/citadel/msgbase.c index 4b2c9ed85..7d325aeba 100644 --- a/citadel/msgbase.c +++ b/citadel/msgbase.c @@ -20,6 +20,7 @@ #include "msgbase.h" #include "support.h" #include "sysdep_decls.h" +#include "citserver.h" #include "room_ops.h" #include "user_ops.h" #include "file_ops.h" @@ -35,6 +36,8 @@ #define MSGS_LAST 4 #define MSGS_GT 5 +#define desired_section ((char *)CtdlGetUserData(SYM_DESIRED_SECTION)) + extern struct config config; @@ -368,7 +371,7 @@ void mime_download(char *name, char *filename, char *partnum, char *disp, if (CC->download_fp != NULL) return; /* ...or if this is not the desired section */ - if (strcasecmp(CC->desired_section, partnum)) return; + if (strcasecmp(desired_section, partnum)) return; snprintf(tmpname, sizeof tmpname, "/tmp/CitServer.download.%4x.%4x", getpid(), ++seq); @@ -506,7 +509,7 @@ time_t output_message(char *msgid, int mode, int headers_only) { if (CC->download_fp == NULL) { cprintf("%d Section %s not found.\n", ERROR+FILE_NOT_FOUND, - CC->desired_section); + desired_section); } } cdb_free(dmsgtext); @@ -771,8 +774,10 @@ void cmd_opna(char *cmdbuf) { char msgid[256]; + CtdlAllocUserData(SYM_DESIRED_SECTION, 64); + extract(msgid, cmdbuf, 0); - extract(CC->desired_section, cmdbuf, 1); + extract(desired_section, cmdbuf, 1); output_message(msgid, MT_DOWNLOAD, 0); }