Re: Serious problems with multiple connections working with the same mailbox

Jerry Lundström <[email protected]> Mon, 19 Sep 2005 12:57:00 +0200
Newsgroups gmane.mail.imap.binc.devel
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--------------020709090709000607010205
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

Jerry Lundström wrote:
> Andreas Aardal Hanssen wrote:
> 
>> That looks strange, yes, but it's harmless. The first line is your
>> response, the second is a pending update. The pending update isn't
>> necessary, because your client already knows this message is Deleted. So
>> we could remove it for saving some bandwidth.
> 
> I think just setFlagsUnchanged() at the place where operator fetch 
> outputs the flags for the message would work nice.

Seemed we had more then one crooked code. Does this look ok:

-- 
Jerry Lundström, System Developer
Section for IT and Media, Stockholms University, Sweden
+46 (0)8 16 19 99 / http://www.it.su.se

--------------020709090709000607010205
Content-Type: text/plain;
 name="flags.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="flags.patch"

Index: src/operator-fetch.cc
===================================================================
--- src/operator-fetch.cc	(revision 337)
+++ src/operator-fetch.cc	(working copy)
@@ -184,6 +184,7 @@
 	com << prefix;
 
 	outputFlags(message);
+        message.setFlagsUnchanged();
       } else if (fatt.type == "UID") {
 	// UID
 	hasprinted = true;
@@ -392,14 +393,6 @@
     // FIXME: how are parse error passed back?
 
     com << ")" << endl;
-
-    if (message.hasFlagsChanged()) {
-      updateFlags = true;
-      com << "* " << i.getSqnr() << " FETCH (";
-      outputFlags(message);
-      com << ")" << endl;
-      message.setFlagsUnchanged();
-    }
   }
   
   if (updateFlags) mailbox->updateFlags();
@@ -409,7 +402,7 @@
 		      | PendingUpdates::EXISTS
 		      | PendingUpdates::RECENT
 		      | PendingUpdates::EXPUNGE,
-		      true)) {
+		      true, false, false, request.getUidMode())) {
     IO &logger = IOFactory::getInstance().get(2);
     logger << "when scanning mailbox: "
 	   << session.getLastError() << endl;

--------------020709090709000607010205--