summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlain Magloire <alainm@gnu.org>2001-11-15 04:51:29 +0000
committerAlain Magloire <alainm@gnu.org>2001-11-15 04:51:29 +0000
commit0634116cce82d7fa24a2065081661b78afee0f02 (patch)
tree44363bac137277d625e017f7245f756248c6137f
parent123ca3a362e8415f07127a188e74a458f9efb33f (diff)
downloadmailutils-0634116cce82d7fa24a2065081661b78afee0f02.tar.gz
mailutils-0634116cce82d7fa24a2065081661b78afee0f02.tar.bz2
* mailbox/wicket.c (_get_ticket): Reset the buffer.
* mailbox/mailbox.c (mailbox_get_stream): Get the stream for the mailbox object if it is null try the folder. (mailbox_set_stream): Always set it on the mailbox object.
-rw-r--r--ChangeLog3
-rw-r--r--mailbox/mailbox.c23
2 files changed, 20 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index e2f87161e..2cac4e6ca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,9 @@
2001-11-14 Alain Magloire
* mailbox/wicket.c (_get_ticket): Reset the buffer.
+ * mailbox/mailbox.c (mailbox_get_stream): Get the stream
+ for the mailbox object if it is null try the folder.
+ (mailbox_set_stream): Always set it on the mailbox object.
2001-11-14 Alain Magloire
diff --git a/mailbox/mailbox.c b/mailbox/mailbox.c
index 90cde914c..5ea4b77b2 100644
--- a/mailbox/mailbox.c
+++ b/mailbox/mailbox.c
@@ -314,23 +314,34 @@ mailbox_set_stream (mailbox_t mbox, stream_t stream)
{
if (mbox == NULL)
return EINVAL;
- /* The stream is set on the folder if exist, not the mailbox. */
- if (mbox->folder)
- return folder_set_stream (mbox->folder, stream);
if (mbox->stream)
stream_destroy (&(mbox->stream), mbox);
mbox->stream = stream;
return 0;
}
+/* FIXME: This is a problem. We provide a mailbox_get_stream ()
+ and this stream is special it should, in theory, represent
+ a "view" of a flow of messages. But providing this perspective
+ may make sense for local mailboxes but downright impossible
+ for a remote mailbox, short on downloading the entire mailbox
+ locally.
+ The question is : should this function be removed?
+ So far it as been used on local mailboxes to get offsets. */
int
mailbox_get_stream (mailbox_t mbox, stream_t *pstream)
{
if (mbox == NULL || pstream == NULL)
return EINVAL;
- /* The stream is set on the folder if exist, not the mailbox. */
- if (mbox->folder)
- return folder_get_stream (mbox->folder, pstream);
+
+ /* If null two cases:
+ - it is no open yet.
+ - it a remote stream and the socket stream is on the folder. */
+ if (mbox->stream == NULL)
+ {
+ if (mbox->folder)
+ return folder_get_stream (mbox->folder, pstream);
+ }
*pstream = mbox->stream;
return 0;
}

Return to:

Send suggestions and report system problems to the System administrator.