]> code.citadel.org Git - citadel.git/blobdiff - citadel/room_ops.c
* added server command line option "-f" to defrag databases on startup
[citadel.git] / citadel / room_ops.c
index b1237e68ad0e7b9e365f40c140402623601ec947..3bca3a7c211cb8b0aba861f93c1977a089ecc204 100644 (file)
@@ -327,8 +327,9 @@ void get_msglist(struct quickroom *whichroom) {
  */
 void put_msglist(struct quickroom *whichroom) {
 
-       cdb_store(CDB_MSGLISTS, &whichroom->QRnumber, sizeof(long),
-               CC->msglist, CC->num_msgs * sizeof(long));
+       if (CC->msglist != NULL)
+               cdb_store(CDB_MSGLISTS, &whichroom->QRnumber, sizeof(long),
+                       CC->msglist, CC->num_msgs * sizeof(long));
        }
 
 
@@ -360,7 +361,8 @@ long AddMessageToRoom(struct quickroom *whichroom, long newmsgid) {
        int num_msgs;
        long *msglist;
        long highest_msg = 0L;
-       
+
+       lprintf(9, "AddMessageToRoom(%s, %ld)\n", whichroom->QRname, newmsgid); 
        cdbfr = cdb_fetch(CDB_MSGLISTS, &whichroom->QRnumber, sizeof(long));
        if (cdbfr == NULL) {
                msglist = NULL;
@@ -368,6 +370,7 @@ long AddMessageToRoom(struct quickroom *whichroom, long newmsgid) {
                }
        else {
                msglist = mallok(cdbfr->len);
+               if (msglist==NULL)  lprintf(3, "ERROR malloc msglist!\n");
                num_msgs = cdbfr->len / sizeof(long);
                memcpy(msglist, cdbfr->ptr, cdbfr->len);
                cdb_free(cdbfr);
@@ -1379,7 +1382,7 @@ void cmd_cre8(char *args)
                return;
                }
 
-       if (CC->usersupp.axlevel<3) {
+       if (CC->usersupp.axlevel < config.c_createax) {
                cprintf("%d You need higher access to create rooms.\n",
                        ERROR+HIGHER_ACCESS_REQUIRED);
                return;