diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2010-11-22 22:26:29 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2010-11-22 23:20:16 +0200 |
commit | 46b844cf0c0623dd370573ce6da21dd8aa6fd907 (patch) | |
tree | 7f23032ee01646f43723910e35bf6cecd38155f4 /mh/comp.c | |
parent | e34d8c168f9031dbfc2441006e0eb24182ef4389 (diff) | |
download | mailutils-46b844cf0c0623dd370573ce6da21dd8aa6fd907.tar.gz mailutils-46b844cf0c0623dd370573ce6da21dd8aa6fd907.tar.bz2 |
Provide a library function for translating message UIDs to numbers and vice versa.
* include/mailutils/mailbox.h (MU_MAILBOX_UID_TO_MSGNO)
(MU_MAILBOX_MSGNO_TO_UID): New defines.
(mu_mailbox_translate): New proto.
* include/mailutils/sys/mailbox.h (_mu_mailbox) <_translate>: New
method.
* libmailutils/mailbox/mailbox.c (mu_mailbox_translate): New
function.
* libproto/mh/mbox.c (mh_translate): New function. Implements
the _translate method.
* mh/mh_msgset.c (mh_uid_to_msgno, mh_msgno_to_uid): Remove. All
callers updated to use mu_mailbox_translate instead.
(mh_search_message): Remove.
(mh_get_message): Rewrite using mu_mailbox_translate.
* mh/comp.c (copy_message): Check return from mu_mailbox_get_message.
* mh/mh_init.c (mh_draft_message): Rewrite using mu_url_sget_path.
* mh/tests/comp.at: Test draftfolder functionality.
Diffstat (limited to 'mh/comp.c')
-rw-r--r-- | mh/comp.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -161,7 +161,13 @@ copy_message (mu_mailbox_t mbox, size_t n, const char *file) mu_stream_t out; int rc; - mu_mailbox_get_message (mbox, n, &msg); + rc = mu_mailbox_get_message (mbox, n, &msg); + if (rc) + { + mu_diag_funcall (MU_DIAG_ERROR, "mu_mailbox_get_message", NULL, rc); + exit (1); + } + mu_message_get_streamref (msg, &in); if ((rc = mu_file_stream_create (&out, |