Sfoglia il codice sorgente

fixed a couple of bugs in folder manipulation, in particular:
- creating of folders wasn't using the folder delimeter
- deleting of folders was broken
- renaming folders didn't keep you subscribed to the folder on Cyrus
- the left frame wasn't checking the right thing when looking to see if
a folder was a special folder or not.

nehresma 25 anni fa
parent
commit
7b936caff8
3 ha cambiato i file con 6 aggiunte e 37 eliminazioni
  1. 1 1
      src/folders_create.php
  2. 4 35
      src/folders_rename_do.php
  3. 1 1
      src/left_main.php

+ 1 - 1
src/folders_create.php

@@ -27,7 +27,7 @@
    if (trim($subfolder) == "[ None ]") {
       createFolder($imapConnection, "$folder_name");
    } else {
-      createFolder($imapConnection, "$subfolder$folder_name");
+      createFolder($imapConnection, "$subfolder$dm$folder_name");
    }
    fputs($imapConnection, "1 logout\n");
 

+ 4 - 35
src/folders_rename_do.php

@@ -23,42 +23,11 @@
    fputs ($imapConnection, ". RENAME \"$orig\" \"$newone\"\n");
    $data = imapReadData($imapConnection, ".", true, $a, $b);
 
-/*   fputs ($imapConnection, ". RENAME \"$old_name\" \"$mailbox\"\n";
+   // Renaming a folder doesn't renames the folder but leaves you unsubscribed
+   //    at least on Cyrus IMAP servers.
+   fputs ($imapConnection, "sub SUBSCRIBE $newone\n");
+   $data = imapReadData($imapConnection, "sub", true, $a, $b);
 
-   selectMailbox($imapConnection, $orig, $numMessages);
-   getFolderList($imapConnection, $boxesFormatted, $boxesUnformatted, $boxesRaw);
-
-   $mailbox = "$subfolder.$new_name";
-   $old_name = substr($orig, strrpos($orig, ".")+1, strlen($orig));
-   $old_parent = substr($orig, 0, strrpos($orig, "."));
-
-   for ($i = 0; $i < count($boxesUnformatted); $i++) {
-      if (substr($boxesUnformatted[$i], 0, strlen($orig)) == $orig) {
-         $after = substr($boxesUnformatted[$i], strlen($orig)+1, strlen($boxesUnformatted[$i]));
-         selectMailbox($imapConnection, $boxesUnformatted[$i], $numMessages);
-         if (strlen($after) > 0) {
-            createFolder($imapConnection, "$mailbox.$after");
-            if ($numMessages > 0)
-               $success = copyMessages($imapConnection, 1, $numMessages, "$mailbox.$after");
-            else
-               $success = true;
-
-            if ($success == true)
-               removeFolder($imapConnection, "$boxesUnformatted[$i]");
-         }
-         else {
-            createFolder($imapConnection, "$mailbox");
-            if ($numMessages > 0)
-               $success = copyMessages($imapConnection, 1, $numMessages, "$mailbox");
-            else
-               $success = true;
-
-            if ($success == true)
-               removeFolder($imapConnection, "$boxesUnformatted[$i]");
-         }
-      }
-   }
-*/
    /** Log out this session **/
    fputs($imapConnection, "1 logout");
 

+ 1 - 1
src/left_main.php

@@ -33,7 +33,7 @@
 
       $special_color = false;
       for ($i = 0; $i < count($special_folders); $i++) {
-         if (($special_folders[$i] == $mailbox) && ($use_special_folder_color == true))
+         if (($special_folders[$i] == $real_box) && ($use_special_folder_color == true))
             $special_color = true;
       }