/*
* Text description of this software
*/
-#define CITADEL "Citadel 6.82"
+#define CITADEL "Citadel 6.83"
/*
* REV_LEVEL is the current version number (multiplied by 100 to avoid having
* usually more strict because you're not really supposed to dump/load and
* upgrade at the same time.
*/
-#define REV_LEVEL 682 /* This version */
+#define REV_LEVEL 683 /* This version */
#define REV_MIN 591 /* Oldest compatible database */
#define EXPORT_REV_MIN 655 /* Oldest compatible export files */
*/
void cmd_move(char *args)
{
- long num;
+ char msgset[SIZ];
+ char msgtok[32];
+ long *msgs;
+ int num_msgs = 0;
+
char targ[ROOMNAMELEN];
struct ctdlroom qtemp;
int err;
int is_copy = 0;
int ra;
int permit = 0;
+ int i;
+
+ extract_token(msgset, args, 0, '|', sizeof msgset);
+ num_msgs = num_tokens(msgset, ',');
+ if (num_msgs < 1) {
+ cprintf("%d Nothing to do.\n", CIT_OK);
+ return;
+ }
- num = extract_long(args, 0);
extract_token(targ, args, 1, '|', sizeof targ);
convert_room_name_macros(targ, sizeof targ);
targ[ROOMNAMELEN - 1] = 0;
return;
}
- err = CtdlCopyMsgsToRoom(&num, 1, targ);
+ /*
+ * Build our message set to be moved/copied
+ */
+ msgs = malloc(num_msgs * sizeof(long));
+ for (i=0; i<num_msgs; ++i) {
+ extract_token(msgtok, msgset, i, ',', sizeof msgtok);
+ msgs[i] = atol(msgtok);
+ }
+
+ /*
+ * Do the copy
+ */
+ err = CtdlCopyMsgsToRoom(msgs, num_msgs, targ);
if (err != 0) {
- cprintf("%d Cannot store message in %s: error %d\n",
+ cprintf("%d Cannot store message(s) in %s: error %d\n",
err, targ, err);
+ free(msgs);
return;
}
* if this is a 'move' rather than a 'copy' operation.
*/
if (is_copy == 0) {
- CtdlDeleteMessages(CC->room.QRname, &num, 1, "", 0);
+ CtdlDeleteMessages(CC->room.QRname, msgs, num_msgs, "", 0);
}
+ free(msgs);
- cprintf("%d Message %s.\n", CIT_OK, (is_copy ? "copied" : "moved") );
+ cprintf("%d Message(s) %s.\n", CIT_OK, (is_copy ? "copied" : "moved") );
}
Move or copy a message to a different room. This command expects to be
passed three arguments:
- 0: the message number of the message to be moved or copied.
+ 0: the message number(s) of the message to be moved or copied.
1: the name of the target room.
2: flag: 0 to move the message, 1 to copy it without deleting from the
source room.
This command never creates or deletes copies of a message; it merely moves
around links. When a message is moved, its reference count remains the same.
When a message is copied, its reference count is incremented.
+
+ You can move/copy multiple messages with a single command by separating the
+message numbers with commas; for example: MOVE 112,113,114|Trash|0
KILL (KILL current room)