]> code.citadel.org Git - citadel.git/commitdiff
cmd_move() now uses CtdlDeleteMessages().
authorArt Cancro <ajc@citadel.org>
Sat, 24 Jul 1999 22:14:22 +0000 (22:14 +0000)
committerArt Cancro <ajc@citadel.org>
Sat, 24 Jul 1999 22:14:22 +0000 (22:14 +0000)
WARNING: build is temporarily broken.  Currently removing all references
to the "msglist" kept in CitContext.  It's ugly and must die.

citadel/ChangeLog
citadel/msgbase.c

index d08abaa22d2bc709e5d1a14d855aca3feef84c34..4b9e2a86755cffe96c7d04ecb6ee7bdf05e37c3e 100644 (file)
@@ -1,4 +1,9 @@
 $Log$
+Revision 1.328  1999/07/24 22:14:21  ajc
+cmd_move() now uses CtdlDeleteMessages().
+WARNING: build is temporarily broken.  Currently removing all references
+to the "msglist" kept in CitContext.  It's ugly and must die.
+
 Revision 1.327  1999/07/24 21:32:01  ajc
 Test of automatically updating ChangeLog
 
@@ -1100,3 +1105,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
        * Initial CVS import
+
index 41a06eed01328babac66d0f8883db04268289df0..6f52404a44d52cf71ade7efc011b629555e3d808 100644 (file)
@@ -1536,7 +1536,6 @@ void cmd_move(char *args)
 {
        long num;
        char targ[32];
-       int a;
        struct quickroom qtemp;
        int foundit;
 
@@ -1554,33 +1553,19 @@ void cmd_move(char *args)
                cprintf("%d '%s' does not exist.\n", ERROR, targ);
                return;
        }
+
        /* yank the message out of the current room... */
-       lgetroom(&CC->quickroom, CC->quickroom.QRname);
-       get_msglist(&CC->quickroom);
+       foundit = CtdlDeleteMessages(CC->quickroom.QRname, num, NULL);
 
-       foundit = 0;
-       for (a = 0; a < (CC->num_msgs); ++a) {
-               if (MessageFromList(a) == num) {
-                       foundit = 1;
-                       SetMessageInList(a, 0L);
-               }
-       }
        if (foundit) {
-               CC->num_msgs = sort_msglist(CC->msglist, CC->num_msgs);
-               put_msglist(&CC->quickroom);
-               CC->quickroom.QRhighest = MessageFromList((CC->num_msgs) - 1);
-       }
-       lputroom(&CC->quickroom);
-       if (!foundit) {
+               /* put the message into the target room */
+               lgetroom(&qtemp, targ);
+               qtemp.QRhighest = AddMessageToRoom(&qtemp, num);
+               lputroom(&qtemp);
+               cprintf("%d Message moved.\n", OK);
+       } else {
                cprintf("%d msg %ld does not exist.\n", ERROR, num);
-               return;
        }
-       /* put the message into the target room */
-       lgetroom(&qtemp, targ);
-       qtemp.QRhighest = AddMessageToRoom(&qtemp, num);
-       lputroom(&qtemp);
-
-       cprintf("%d Message moved.\n", OK);
 }
 
 
@@ -1732,7 +1717,10 @@ void CtdlWriteObject(    char *req_room,         /* Room to stuff it in */
        /* If the caller specified this object as unique, delete all
         * other objects of this type that are currently in the room.
         */
-       CtdlDeleteMessages(roomname, 0L, content_type);
+       if (is_unique) {
+               lprintf(9, "Deleted %d other msgs of this type\n",
+                       CtdlDeleteMessages(roomname, 0L, content_type) );
+       }
 
        /* Now write the data */
        save_message(filename, "", roomname, MES_LOCAL, 1);