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

  • From: clemens.zeidler@xxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 18 Mar 2011 05:49:32 +0100 (CET)

Author: czeidler
Date: 2011-03-18 05:49:32 +0100 (Fri, 18 Mar 2011)
New Revision: 41018
Changeset: https://dev.haiku-os.org/changeset/41018

Modified:
   
haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPHandler.cpp
Log:
When fetching the message body also fetch the flags in one go. For example, 
gmail does not send flag change updates. If a message is 
marked as read by another client the haiku client at least updates the flags 
and mark it as read when fetching the body. Thats the way Opera is 
doing it.



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-17 22:21:55 UTC (rev 41017)
+++ 
haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPHandler.cpp
 2011-03-18 04:49:32 UTC (rev 41018)
@@ -454,7 +454,7 @@
 {
        BString command = "FETCH ";
        command << fMessage;
-       command += " BODY.PEEK[TEXT]";
+       command += " (FLAGS BODY.PEEK[TEXT])";
        return command;
 }
 
@@ -464,14 +464,17 @@
 {
        if (response.FindFirst("FETCH") < 0)
                return false;
+
        BString extracted = response;
        int32 message;
        if (!IMAPParser::RemoveUntagedFromLeft(extracted, "FETCH", message))
                return false;
-
        if (message != fMessage)
                return false;
 
+       int32 flags = FetchMinMessageCommand::ExtractFlags(extracted);
+       fStorage.SetFlags(fIMAPMailbox.MessageNumberToUID(message), flags);
+
        int32 textPos = extracted.FindFirst("BODY[TEXT]");
        if (textPos < 0)
                return false;


Other related posts:

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