[dev] imp/lib/prefs.php [PATCH]

Marc Jauvin marc at r4l.com
Wed Dec 21 16:48:52 PST 2005


This fixes the namespace problem with folder creation under  
Options->Server and Folder Information:

Index: imp/lib/prefs.php
===================================================================
RCS file: /repository/imp/lib/prefs.php,v
retrieving revision 1.18
diff -u -r1.18 prefs.php
--- imp/lib/prefs.php   11 Nov 2005 06:13:20 -0000      1.18
+++ imp/lib/prefs.php   22 Dec 2005 00:43:53 -0000
@@ -12,6 +12,15 @@
   * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
   */

+function _appendNamespace($mbox)
+{
+    $ns_info = IMP::getNamespace($mbox, false);
+    if (is_null($ns_info)) {
+        $ns_info = IMP::defaultNamespace();
+    }
+    return $ns_info['name'] . $mbox;
+}
+
  function handle_sentmailselect($updated)
  {
      global $conf, $imp, $prefs, $identity;
@@ -53,7 +62,7 @@
                  $prefs->setValue($pref, '');
              } else {
                  if (empty($folder) && !empty($new)) {
-                    $folder = $new;
+                    $folder = _appendNamespace($new);
                      include_once IMP_BASE . '/lib/Folder.php';
                      $imp_folder = &IMP_Folder::singleton();
                      if (!$imp_folder->create($folder,  
$prefs->getValue('subscribe'))) {



-- 
Marc Jauvin
http://register4less.com
514-905-6500


More information about the dev mailing list