}
+//
+// 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
//
}
+//
+// 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.
//
nntp_help();
}
+ else if (!strcasecmp(cmdname, "date")) {
+ nntp_date();
+ }
+
else if (!strcasecmp(cmdname, "capabilities")) {
nntp_capabilities();
}
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");
}