Jerry Lundstr�m wrote:
Well no, more like operator-close.cc should set the depot selected mailbox to 0 so that any futhur depot.getSelected() returns 0.

Something like this:

--
Jerry Lundstr�m
Sektionen f�r IT och media, Stockholms universitet
+46 (0)8 16 19 99 / http://www.it.su.se
diff -urN -x '*~' bincimap-1.2.12final.orig/src/depot.cc 
bincimap-1.2.12final.no_mailbox/src/depot.cc
--- bincimap-1.2.12final.orig/src/depot.cc      2005-01-08 11:20:48.000000000 
+0100
+++ bincimap-1.2.12final.no_mailbox/src/depot.cc        2005-05-23 
15:41:15.000000000 +0200
@@ -192,6 +192,12 @@
 }
 
 //--------------------------------------------------------------------
+void Depot::resetSelected(void) const
+{
+  selectedmailbox = 0;
+}
+
+//--------------------------------------------------------------------
 Mailbox *Depot::getDefault(void) const
 {
   return defaultmailbox;
diff -urN -x '*~' bincimap-1.2.12final.orig/src/depot.h 
bincimap-1.2.12final.no_mailbox/src/depot.h
--- bincimap-1.2.12final.orig/src/depot.h       2005-01-08 11:20:48.000000000 
+0100
+++ bincimap-1.2.12final.no_mailbox/src/depot.h 2005-05-23 15:40:16.000000000 
+0200
@@ -114,6 +114,7 @@
 
     bool setSelected(Mailbox *);
     Mailbox *getSelected(void) const;
+    void resetSelected(void) const;
 
     bool getStatus(const std::string &s_in, Status &dest) const;
 
diff -urN -x '*~' bincimap-1.2.12final.orig/src/operator-close.cc 
bincimap-1.2.12final.no_mailbox/src/operator-close.cc
--- bincimap-1.2.12final.orig/src/operator-close.cc     2005-01-08 
11:20:48.000000000 +0100
+++ bincimap-1.2.12final.no_mailbox/src/operator-close.cc       2005-05-23 
15:39:56.000000000 +0200
@@ -74,6 +74,7 @@
   Mailbox *mailbox = depot.getSelected();
   mailbox->expungeMailbox();
   mailbox->closeMailbox();
+  depot.resetSelected();
 
   Session &session = Session::getInstance();
   session.setState(Session::AUTHENTICATED);
diff -urN -x '*~' bincimap-1.2.12final.orig/src/operator-noop-pending.cc 
bincimap-1.2.12final.no_mailbox/src/operator-noop-pending.cc
--- bincimap-1.2.12final.orig/src/operator-noop-pending.cc      2005-01-08 
11:20:48.000000000 +0100
+++ bincimap-1.2.12final.no_mailbox/src/operator-noop-pending.cc        
2005-05-23 14:28:49.000000000 +0200
@@ -65,7 +65,8 @@
                                                     Request &command)
 {
   Mailbox *mailbox = depot.getSelected();
-  if (!pendingUpdates(mailbox, 
+  if (mailbox &&
+      !pendingUpdates(mailbox, 
                      PendingUpdates::EXPUNGE
                      | PendingUpdates::EXISTS 
                      | PendingUpdates::RECENT 

Reply via email to