X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmodules%2Fnntp%2Fserv_nntp.c;h=86368596002aeb59d8aef9b99daa6d974b8010e3;hb=2ffa7f5d58eec15aa17f6b7372740f0e15d81d64;hp=398e63dcc6ab14df66e837486a8142f65cee13a0;hpb=f4e179d6deea2b421905b9048894d968e1286774;p=citadel.git diff --git a/citadel/modules/nntp/serv_nntp.c b/citadel/modules/nntp/serv_nntp.c index 398e63dcc..863685960 100644 --- a/citadel/modules/nntp/serv_nntp.c +++ b/citadel/modules/nntp/serv_nntp.c @@ -234,10 +234,11 @@ void nntp_starttls(void) void nntp_capabilities(void) { cprintf("101 Capability list:\r\n"); + cprintf("IMPLEMENTATION Citadel v%d.%02d\r\n", (REV_LEVEL/100), (REV_LEVEL%100)); cprintf("VERSION 2\r\n"); cprintf("READER\r\n"); + cprintf("MODE-READER\r\n"); cprintf("LIST ACTIVE NEWSGROUPS\r\n"); - cprintf("IMPLEMENTATION Citadel v%d.%02d\r\n", (REV_LEVEL/100), (REV_LEVEL%100)); #ifdef HAVE_OPENSSL cprintf("STARTTLS\r\n"); #endif @@ -551,14 +552,6 @@ void nntp_help(void) { } - -struct listgroup_range { - long lo; - long hi; -}; - - - /* * back end for the LISTGROUP command , called for each message number */ @@ -662,6 +655,25 @@ void nntp_group(const char *cmd) { } +/* + * Implements the MODE command + */ +void nntp_mode(const char *cmd) { + + char which_mode[16]; + + extract_token(which_mode, cmd, 1, ' ', sizeof which_mode); + + if (!strcasecmp(which_mode, "reader")) { + cprintf("201 Reader mode FIXME implement posting and change to 200\r\n"); + } + else { + cprintf("501 unknown mode\r\n"); + } +} + + + /* * Main command loop for NNTP server sessions. */ @@ -720,6 +732,10 @@ void nntp_command_loop(void) nntp_group(ChrPtr(Cmd)); } + else if (!strcasecmp(cmdname, "mode")) { + nntp_mode(ChrPtr(Cmd)); + } + else { cprintf("500 I'm afraid I can't do that.\r\n"); } @@ -774,9 +790,3 @@ CTDL_MODULE_INIT(nntp) /* return our module name for the log */ return "nntp"; } - - - - - -