#include <pwd.h>
#include <sys/types.h>
#include <sys/wait.h>
-#include <sys/time.h>
+
+#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 <string.h>
#include <syslog.h>
#include <limits.h>
((cdbvisit->len > sizeof(struct visit)) ?
sizeof(struct visit) : cdbvisit->len));
cdb_free(cdbvisit);
- return;
+ }
+
+ /* Set v_seen if necessary */
+ if (vbuf->v_seen[0] == 0) {
+ sprintf(vbuf->v_seen, "*:%ld", vbuf->v_lastseen);
}
}
long newlr;
struct visit vbuf;
- if (CtdlAccessCheck(ac_logged_in))
+ if (CtdlAccessCheck(ac_logged_in)) {
return;
+ }
if (!strncasecmp(new_ptr, "highest", 7)) {
newlr = CC->quickroom.QRhighest;
CtdlGetRelationship(&vbuf, &CC->usersupp, &CC->quickroom);
vbuf.v_lastseen = newlr;
+ sprintf(vbuf.v_seen, "*:%ld", newlr);
CtdlSetRelationship(&vbuf, &CC->usersupp, &CC->quickroom);
lputuser(&CC->usersupp);
}
+void cmd_seen(char *argbuf) {
+ long target_msgnum = 0L;
+ int target_setting = 0;
+
+ if (CtdlAccessCheck(ac_logged_in)) {
+ return;
+ }
+
+ if (num_parms(argbuf) != 2) {
+ cprintf("%d Invalid parameters\n", ERROR);
+ return;
+ }
+
+ target_msgnum = extract_long(argbuf, 0);
+ target_setting = extract_int(argbuf, 1);
+
+ CtdlSetSeen(target_msgnum, target_setting);
+ cprintf("%d OK\n", OK);
+}
+
+
/*
* INVT and KICK commands
*/