]> code.citadel.org Git - citadel.git/commitdiff
* Began work on IMAP RENAME
authorArt Cancro <ajc@citadel.org>
Wed, 10 Apr 2002 03:58:40 +0000 (03:58 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 10 Apr 2002 03:58:40 +0000 (03:58 +0000)
citadel/ChangeLog
citadel/serv_imap.c

index d9124b135d589d755b544e3943acb0b4c0c6eb23..5b0f4a9c7945c346de0b17881a18c4af9d01e9e4 100644 (file)
@@ -1,4 +1,7 @@
  $Log$
+ Revision 591.6  2002/04/10 03:58:40  ajc
+ * Began work on IMAP RENAME
+
  Revision 591.5  2002/04/09 14:26:43  ajc
  * Allow INBOX to have subfolders.  There's no longer any reason not to.
 
@@ -3588,3 +3591,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import 
+
index dffdb5a5caa06f495da9fe3370e202ed82323373..f1a236210f40ab0cd0c17ae934b5a2fd2b9120d1 100644 (file)
@@ -895,17 +895,37 @@ void imap_delete(int num_parms, char *parms[]) {
 
 
 
+
 /*
- * Implements the RENAME command
+ * Implements the RENAME command (FIXME, finish implementing this)
  *
  */
 void imap_rename(int num_parms, char *parms[]) {
-       cprintf("%s NO The RENAME command is not yet implemented (FIXME)\r\n",
-               parms[0]);
+       char oldroom[ROOMNAMELEN];
+       char newroom[ROOMNAMELEN];
+       struct quickroom qrbuf;
+       int oldr, newr;
+
+       oldr = imap_roomname(oldroom, sizeof oldroom, parms[2]);
+       newr = imap_roomname(newroom, sizeof newroom, parms[3]);
+
+       if (getroom(&qrbuf, oldroom) != 0) {
+               cprintf("%s NO folder not found\r\n", parms[0]);
+               return;
+       }
+
+       if (getroom(&qrbuf, newroom) == 0) {
+               cprintf("%s NO name already in use\r\n", parms[0]);
+               return;
+       }
+
+       cprintf("%s NO RENAME FIXME\r\n", parms[0]);
+       /* cprintf("%s OK RENAME completed\r\n", parms[0]); */
 }
 
 
 
+
 /* 
  * Main command loop for IMAP sessions.
  */