* GNU General Public License for more details.
*/
-#include "sysdep.h"
-#include <stdlib.h>
-#include <unistd.h>
#include <stdio.h>
-#include <sys/stat.h>
-#include <ctype.h>
-#include <string.h>
-#include <dirent.h> /* for cmd_rdir to read contents of the directory */
-
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-
-#include <limits.h>
-#include <errno.h>
-#include "citadel.h"
#include <libcitadel.h>
-#include "server.h"
-#include "database.h"
-#include "config.h"
-#include "room_ops.h"
-#include "sysdep_decls.h"
-#include "support.h"
-#include "msgbase.h"
+
#include "citserver.h"
-#include "control.h"
-#include "citadel_dirs.h"
-#include "threads.h"
#include "ctdl_module.h"
+#include "config.h"
+#include "control.h"
#include "user_ops.h"
+#include "room_ops.h"
struct floor *floorcache[MAXFLOORS];
/*
* CtdlGetRoomLock() - same as getroom() but locks the record (if supported)
*/
-int CtdlGetRoomLock(struct ctdlroom *qrbuf, char *room_name)
+int CtdlGetRoomLock(struct ctdlroom *qrbuf, const char *room_name)
{
register int retval;
retval = CtdlGetRoom(qrbuf, room_name);
* specified room exists and is ok to access.
*/
void CtdlUserGoto(char *where, int display_result, int transiently,
- int *retmsgs, int *retnew)
+ int *retmsgs, int *retnew, long *retoldest, long *retnewest)
{
struct CitContext *CCC = CC;
int a;
int new_messages = 0;
int old_messages = 0;
int total_messages = 0;
+ long oldest_message = 0;
+ long newest_message = 0;
int info = 0;
int rmailflag;
int raideflag;
if (msglist[a] > 0L) ++total_messages;
}
+ if (total_messages > 0) {
+ oldest_message = msglist[0];
+ newest_message = msglist[num_msgs - 1];
+ }
+
num_sets = num_tokens(vbuf.v_seen, ',');
for (s=0; s<num_sets; ++s) {
extract_token(setstr, vbuf.v_seen, s, ',', sizeof setstr);
if (retmsgs != NULL) *retmsgs = total_messages;
if (retnew != NULL) *retnew = new_messages;
- MSG_syslog(LOG_INFO, "<%s> %d new of %d total messages\n",
- CCC->room.QRname,
- new_messages, total_messages
- );
+ if (retoldest != NULL) *retoldest = oldest_message;
+ if (retnewest != NULL) *retnewest = newest_message;
+ MSG_syslog(LOG_INFO, "<%s> %d new of %d total messages, oldest=%ld, newest=%ld\n",
+ CCC->room.QRname, new_messages, total_messages, oldest_message, newest_message
+ );
CCC->curr_view = (int)vbuf.v_view;