diff options
author | Damien Riegel <damien.riegel@gmail.com> | 2016-06-17 19:01:31 -0700 |
---|---|---|
committer | Damien Riegel <damien.riegel@gmail.com> | 2016-06-17 19:01:31 -0700 |
commit | 35c3ae29bfe4d97723e584323abab57808569c70 (patch) | |
tree | 70559d31129fbfbae92daacb339a2ba51f3d802e /imap | |
parent | f35f2c9845313bfe26ad0b4e3d738ccc1d6f650c (diff) |
Add open_msg to struct mx_ops
Add the callback to open an existing message to struct mx_ops. For mbox,
mmdf, maildir, and mh, the code was implemented directly into
mx_open_message, so it is moved in their respective source files. For
imap and pop, there were already <mailbox>_fetch_message functions, but
their argument order has been changed to pass the context as a first
argument.
Diffstat (limited to 'imap')
-rw-r--r-- | imap/imap.c | 1 | ||||
-rw-r--r-- | imap/imap.h | 1 | ||||
-rw-r--r-- | imap/imap_private.h | 2 | ||||
-rw-r--r-- | imap/message.c | 2 |
4 files changed, 4 insertions, 2 deletions
diff --git a/imap/imap.c b/imap/imap.c index 8d04012c..87a9ed59 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -2074,6 +2074,7 @@ int imap_complete(char* dest, size_t dlen, char* path) { struct mx_ops mx_imap_ops = { .open = imap_open_mailbox, .close = imap_close_mailbox, + .open_msg = imap_fetch_message, .open_new_msg = imap_open_new_message, .check = imap_check_mailbox_reopen, }; diff --git a/imap/imap.h b/imap/imap.h index 693008b1..ff0a1ba0 100644 --- a/imap/imap.h +++ b/imap/imap.h @@ -58,7 +58,6 @@ int imap_mailbox_rename (const char* mailbox); /* message.c */ int imap_append_message (CONTEXT* ctx, MESSAGE* msg); int imap_copy_messages (CONTEXT* ctx, HEADER* h, char* dest, int delete); -int imap_fetch_message (MESSAGE* msg, CONTEXT* ctx, int msgno); /* socket.c */ void imap_logout_all (void); diff --git a/imap/imap_private.h b/imap/imap_private.h index b5579744..f5dd83f3 100644 --- a/imap/imap_private.h +++ b/imap/imap_private.h @@ -268,6 +268,8 @@ char* imap_set_flags (IMAP_DATA* idata, HEADER* h, char* s); int imap_cache_del (IMAP_DATA* idata, HEADER* h); int imap_cache_clean (IMAP_DATA* idata); +int imap_fetch_message (CONTEXT *ctx, MESSAGE *msg, int msgno); + /* util.c */ #ifdef USE_HCACHE header_cache_t* imap_hcache_open (IMAP_DATA* idata, const char* path); diff --git a/imap/message.c b/imap/message.c index 5e66b1db..f6316171 100644 --- a/imap/message.c +++ b/imap/message.c @@ -391,7 +391,7 @@ error_out_0: return retval; } -int imap_fetch_message (MESSAGE *msg, CONTEXT *ctx, int msgno) +int imap_fetch_message (CONTEXT *ctx, MESSAGE *msg, int msgno) { IMAP_DATA* idata; HEADER* h; |