Update of /cvsroot/mahogany/M/src/mail
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2104/src/mail

Modified Files:
        MailFolderCC.cpp 
Log Message:
better support for listing children of emulated dual use mailboxes

Index: MailFolderCC.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/mail/MailFolderCC.cpp,v
retrieving revision 1.706
retrieving revision 1.707
diff -b -u -2 -r1.706 -r1.707
--- MailFolderCC.cpp    16 Apr 2005 14:19:09 -0000      1.706
+++ MailFolderCC.cpp    30 Jun 2005 17:09:16 -0000      1.707
@@ -185,4 +185,11 @@
 #define ILLEGAL_DELIMITER ((char)-1)
 
+// special suffix which we use to implement mailboxes containing both messages
+// and other mailboxes with drivers which don't support this: if it's
+// impossible to put both messages and mailboxes in a mailbox "foo", we create
+// a mailbox "foo.messages" for the messages and use "foo" only for children
+static const char *MAILBOX_MSGS_SUFFIX = ".messages";
+static const size_t MAILBOX_MSGS_SUFFIX_LEN = strlen(MAILBOX_MSGS_SUFFIX);
+
 // ----------------------------------------------------------------------------
 // trace masks used (you have to wxLog::AddTraceMask() to enable the
@@ -5371,4 +5378,12 @@
    String spec = m_ImapSpec;
 
+   // hack: if the folder ends with this special suffix, the driver doesn't
+   // support "dual use" mailboxes and so any child mailboxes are put under
+   // "foo" and not "foo.messages" (see comment near MAILBOX_MSGS_SUFFIX)
+   if ( spec.Right(MAILBOX_MSGS_SUFFIX_LEN) == MAILBOX_MSGS_SUFFIX )
+   {
+      spec.RemoveLast(MAILBOX_MSGS_SUFFIX_LEN);
+   }
+
    // make sure that there is a folder name delimiter before pattern -- this is
    // convenient for the calling code however it makes it impossible to



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Mahogany-cvsupdates mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to