From c130ad6a571b233a9ba7380a9e19cd5b03bf4de0 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Tue, 20 Sep 2011 00:22:21 +0300 Subject: [PATCH] * mu_store_add_path now takes a maildir arg --- src/mu-store-write.cc | 5 +++-- src/mu-store.h | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/mu-store-write.cc b/src/mu-store-write.cc index 809e5219..31fea53f 100644 --- a/src/mu-store-write.cc +++ b/src/mu-store-write.cc @@ -634,7 +634,8 @@ mu_store_update_msg (MuStore *store, unsigned docid, MuMsg *msg, GError **err) unsigned -mu_store_add_path (MuStore *store, const char *path, GError **err) +mu_store_add_path (MuStore *store, const char *path, const char *maildir, + GError **err) { MuMsg *msg; unsigned docid; @@ -643,7 +644,7 @@ mu_store_add_path (MuStore *store, const char *path, GError **err) g_return_val_if_fail (path, FALSE); err = NULL; - msg = mu_msg_new_from_file (path, NULL, err); + msg = mu_msg_new_from_file (path, maildir, err); if (!msg) return MU_STORE_INVALID_DOCID; diff --git a/src/mu-store.h b/src/mu-store.h index c0ae27ae..38be7d6b 100644 --- a/src/mu-store.h +++ b/src/mu-store.h @@ -198,11 +198,15 @@ unsigned mu_store_update_msg (MuStore *store, unsigned docid, MuMsg *msg, * * @param store a valid store * @param path full filesystem path to a valid message + * @param maildir set the maildir (e.g. "/drafts") for this message, or NULL + * note that you cannot mu_msg_move_msg_to_maildir unless maildir is set. + * @param err receives error information, if any, or NULL * * @return the docid of the stored message, or 0 * (MU_STORE_INVALID_DOCID) in case of error */ -unsigned mu_store_add_path (MuStore *store, const char *path, GError **err); +unsigned mu_store_add_path (MuStore *store, const char *path, + const char* maildir, GError **err); /** * remove a message from the database based on its path