Move IMAP operations that were done in mx_commit_message to a dedicated
imap_commit_message function.
/* message.c */
int imap_append_message (CONTEXT* ctx, MESSAGE* msg);
int imap_copy_messages (CONTEXT* ctx, HEADER* h, char* dest, int delete);
+int imap_commit_message (CONTEXT *ctx, MESSAGE *msg);
/* socket.c */
void imap_logout_all (void);
return safe_fclose (&msg->fp);
}
+int imap_commit_message (CONTEXT *ctx, MESSAGE *msg)
+{
+ int r = safe_fclose (&msg->fp);
+
+ if (r)
+ return r;
+
+ return imap_append_message (ctx, msg);
+}
+
int imap_append_message (CONTEXT *ctx, MESSAGE *msg)
{
IMAP_DATA* idata;
#ifdef USE_IMAP
case MUTT_IMAP:
{
- if ((r = safe_fclose (&msg->fp)) == 0)
- r = imap_append_message (ctx, msg);
+ r = imap_commit_message (ctx, msg);
break;
}
#endif