X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmodules%2Fnntp%2Fserv_nntp.c;h=26b0ccd4f9a7bc55e22846353e7d0800d15a4fba;hb=01ac2ae1ffc8fa65e6459d7c6fd9a2a368093504;hp=198261005328147f5f2e03695377f99c9ab74425;hpb=da653352ce377ce6a896b863f33ee19e3da6184e;p=citadel.git diff --git a/citadel/modules/nntp/serv_nntp.c b/citadel/modules/nntp/serv_nntp.c index 198261005..26b0ccd4f 100644 --- a/citadel/modules/nntp/serv_nntp.c +++ b/citadel/modules/nntp/serv_nntp.c @@ -531,6 +531,25 @@ void nntp_help(void) { } +// +// Implement DATE command. +// +void nntp_date(void) { + time_t now; + struct tm nowLocal; + struct tm nowUtc; + char tsFromUtc[32]; + + now = time(NULL); + localtime_r(&now, &nowLocal); + gmtime_r(&now, &nowUtc); + + strftime(tsFromUtc, sizeof(tsFromUtc), "%Y%m%d%H%M%S", &nowUtc); + + cprintf("111 %s\r\n", tsFromUtc); +} + + // // back end for the LISTGROUP command , called for each message number // @@ -921,6 +940,18 @@ void nntp_last_next(const char *cmd) { } +// +// XOVER is used by some clients, even if we don't offer it +// +void nntp_xover(const char *cmd) { + if (CtdlAccessCheck(ac_logged_in_or_guest)) return; + + // citnntp *nntpstate = (citnntp *) CC->session_specific_data; + + cprintf("500 not implemented yet FIXME\r\n"); +} + + // // Main command loop for NNTP server sessions. // @@ -949,6 +980,10 @@ void nntp_command_loop(void) nntp_help(); } + else if (!strcasecmp(cmdname, "date")) { + nntp_date(); + } + else if (!strcasecmp(cmdname, "capabilities")) { nntp_capabilities(); } @@ -999,6 +1034,10 @@ void nntp_command_loop(void) nntp_last_next(ChrPtr(Cmd)); } + else if (!strcasecmp(cmdname, "xover")) { + nntp_xover(ChrPtr(Cmd)); + } + else { cprintf("500 I'm afraid I can't do that.\r\n"); }