HIROSHIMA Naoki
Fri, 30 May 2003 11:34:36 -0700
first question is, how can i make two differnt instance of Mailbox at the same time?
You must invoke
mailbox->imapSelect(path)
first to scan the folder (depot.get will only give you an object of the right Mailbox type) IIRC.
Mailbox* foo = depot.get("INBOX/foo");
foo->imapSelect(depot.mailboxToFilename("INBOX/foo"));
Mailbox::iterator e1 = foo->end();
for (Mailbox::iterator i1 = foo->begin(); i1 != e1;++i1) {
Message & message = *i1;
logger << "INBOX/foo: " << message.getID() << endl; Mailbox* bar = depot.get("INBOX/bar");
bar->imapSelect(depot.mailboxToFilename("INBOX/bar"));
Mailbox::iterator e2 = bar->end();
for (Mailbox::iterator i2 = bar->begin(); i2 != e2;++i2) {
Message & message = *i2;
logger << "INBOX/bar: " << message.getID() << endl;
}
}second one is, how can i make an instance of Message from its `id' when i know it.
As of today, you can access the messages only by using the Iterator. In which cases do you know the id first, and have _not_ used the iterator somehow to get hold of the id? Anyway, I think we should consider making the get() method public. The Mailbox class contains quite a lot of code now, and I think we should consider refactoring it (at least the cache part of the Mailbox class).
anyway, how would you hack operator-copy.cc to let COPY behave properly? isn't it trickier than it might sound, huh?