+/*
+ * Output the [COPYUID xxx yyy] response code required by RFC2359
+ * to tell the client the UID's of the messages that were copied (if any).
+ * We are assuming that the IMAP_SELECTED flag is still set on any relevant
+ * messages in our source room. Since the Citadel system uses UID's that
+ * are both globally unique and persistent across a room-to-room copy, we
+ * can get this done quite easily.
+ */
+void imap_output_copyuid_response(void) {
+ int i;
+ int num_output = 0;
+
+ for (i = 0; i < IMAP->num_msgs; ++i) {
+ if (IMAP->flags[i] & IMAP_SELECTED) {
+ ++num_output;
+ if (num_output == 1) {
+ cprintf("[COPYUID ");
+ }
+ else if (num_output > 1) {
+ cprintf(",");
+ }
+ cprintf("%ld", IMAP->msgids[i]);
+ }
+ }
+ if (num_output > 0) {
+ cprintf("] ");
+ }
+}
+