[haiku-commits] r40979 - haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib

  • From: clemens.zeidler@xxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 16 Mar 2011 21:24:14 +0100 (CET)

Author: czeidler
Date: 2011-03-16 21:24:13 +0100 (Wed, 16 Mar 2011)
New Revision: 40979
Changeset: http://dev.haiku-os.org/changeset/40979

Modified:
   
haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPFolders.cpp
   
haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPFolders.h
   
haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPHandler.cpp
   
haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPHandler.h
   
haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPMailbox.cpp
Log:
Check first if the QUOTA extension is available.



Modified: 
haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPFolders.cpp
===================================================================
--- 
haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPFolders.cpp
 2011-03-16 20:01:28 UTC (rev 40978)
+++ 
haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPFolders.cpp
 2011-03-16 20:24:13 UTC (rev 40979)
@@ -10,7 +10,7 @@
 
 IMAPFolders::IMAPFolders()
 {
-
+       fHandlerList.AddItem(&fCapabilityHandler);
 }
 
 
@@ -18,7 +18,7 @@
        :
        IMAPProtocol(connection)
 {
-       
+       fHandlerList.AddItem(&fCapabilityHandler);
 }
 
 
@@ -88,6 +88,11 @@
 status_t
 IMAPFolders::GetQuota(double& used, double& total)
 {
+       if (fCapabilityHandler.Capabilities() == "")
+               ProcessCommand(fCapabilityHandler.Command());
+       if (fCapabilityHandler.Capabilities().FindFirst("QUOTA") < 0)
+               return B_ERROR;
+
        GetQuotaCommand quotaCommand;
        status_t status = ProcessCommand(&quotaCommand);
        if (status != B_OK)

Modified: 
haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPFolders.h
===================================================================
--- 
haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPFolders.h
   2011-03-16 20:01:28 UTC (rev 40978)
+++ 
haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPFolders.h
   2011-03-16 20:24:13 UTC (rev 40979)
@@ -43,6 +43,8 @@
 private:
                        status_t                        
_GetAllFolders(StringList& folders);
                        status_t                        
_GetSubscribedFolders(StringList& folders);
+
+                       CapabilityHandler       fCapabilityHandler;
 };
 
 

Modified: 
haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPHandler.cpp
===================================================================
--- 
haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPHandler.cpp
 2011-03-16 20:01:28 UTC (rev 40978)
+++ 
haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPHandler.cpp
 2011-03-16 20:24:13 UTC (rev 40979)
@@ -105,10 +105,8 @@
 }
 
 
-CapabilityHandler::CapabilityHandler(IMAPMailbox& mailbox)
+CapabilityHandler::CapabilityHandler()
        :
-       IMAPMailboxCommand(mailbox),
-
        fCapabilities("")
 {
        

Modified: 
haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPHandler.h
===================================================================
--- 
haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPHandler.h
   2011-03-16 20:01:28 UTC (rev 40978)
+++ 
haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPHandler.h
   2011-03-16 20:24:13 UTC (rev 40979)
@@ -59,9 +59,9 @@
 };
 
 
-class CapabilityHandler : public IMAPMailboxCommand {
+class CapabilityHandler : public IMAPCommand {
 public:
-                                                               
CapabilityHandler(IMAPMailbox& mailbox);
+                                                               
CapabilityHandler();
 
                        BString                         Command();
                        bool                            Handle(const BString& 
response);

Modified: 
haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPMailbox.cpp
===================================================================
--- 
haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPMailbox.cpp
 2011-03-16 20:01:28 UTC (rev 40978)
+++ 
haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPMailbox.cpp
 2011-03-16 20:24:13 UTC (rev 40979)
@@ -33,7 +33,6 @@
        fStorage(storage),
 
        fMailboxSelectHandler(*this),
-       fCapabilityHandler(*this),
        fExistsHandler(*this),
        fExpungeHandler(*this),
        fFlagsHandler(*this),


Other related posts:

  • » [haiku-commits] r40979 - haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib - clemens . zeidler