* Server functions which perform operations on room objects.
*
*/
+
+#ifdef DLL_EXPORT
+#define IN_LIBCIT
+#endif
+
#include "sysdep.h"
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <sys/stat.h>
#include <string.h>
-#include <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 <limits.h>
#include <errno.h>
#include "citadel.h"
#include "server.h"
+#include "dynloader.h"
#include "database.h"
#include "config.h"
#include "room_ops.h"
}
NEWMSG: /* By the way, we also check for the presence of new messages */
- if ((roombuf->QRhighest) > (vbuf.v_lastseen)) {
+ if (is_msg_in_mset(vbuf.v_seen, roombuf->QRhighest) == 0) {
retval = retval | UA_HASNEWMSGS;
}
return (retval);
struct quickroom qrbuf;
struct cdbdata *cdbqr;
- cdb_begin_transaction();
cdb_rewind(CDB_QUICKROOM);
while (cdbqr = cdb_next_item(CDB_QUICKROOM), cdbqr != NULL) {
if (qrbuf.QRflags & QR_INUSE)
(*CallBack)(&qrbuf, in_data);
}
- cdb_end_transaction();
}
if (num_msgs > 0) for (a = 0; a < num_msgs; ++a) {
if (msglist[a] > 0L) {
++total_messages;
- if (msglist[a] > vbuf.v_lastseen) {
+ if (is_msg_in_mset(vbuf.v_seen, msglist[a]) == 0) {
++new_messages;
}
}
if (ok == 1) {
if ((QRscratch.QRflags & QR_PASSWORDED) &&
((ra & UA_KNOWN) == 0) &&
- (strcasecmp(QRscratch.QRpasswd, password))
+ (strcasecmp(QRscratch.QRpasswd, password)) &&
+ (CC->usersupp.axlevel < 6)
) {
cprintf("%d wrong or missing passwd\n",
ERROR + PASSWORD_REQUIRED);
} else if ((QRscratch.QRflags & QR_PRIVATE) &&
((QRscratch.QRflags & QR_PASSWORDED) == 0) &&
((QRscratch.QRflags & QR_GUESSNAME) == 0) &&
- ((ra & UA_KNOWN) == 0)) {
+ ((ra & UA_KNOWN) == 0) &&
+ (CC->usersupp.axlevel < 6)
+ ) {
goto NOPE;
} else {
usergoto(towhere, 1, NULL, NULL);
struct usersupp temp;
struct cdbdata *cdbus;
- cdb_begin_transaction();
getuser(&CC->usersupp, CC->curr_user);
if (CtdlAccessCheck(ac_room_aide)) return;
)
cprintf("%s\n", temp.fullname);
}
- cdb_end_transaction();
cprintf("000\n");
}
*/
if (!really_create) return (qrbuf.QRflags);
- /* cdb_begin_transaction(); commented out because a transaction
- is already open when creating __CtdlSMTPspoolout__ while
- initializing serv_smtp.c
- */
-
qrbuf.QRnumber = get_new_room_number();
qrbuf.QRhighest = 0L; /* No messages in this room yet */
time(&qrbuf.QRgen); /* Use a timestamp as the generation number */
lputuser(&CC->usersupp);
/* resume our happy day */
- /* cdb_end_transaction(); */
return (qrbuf.QRflags);
}