NeoMutt
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
msg_commit()

Save changes to an email. More...

+ Collaboration diagram for msg_commit():

Functions

static int comp_msg_commit (struct Mailbox *m, struct Message *msg)
 Save changes to an email - Implements MxOps::msg_commit() -.
 
int imap_msg_commit (struct Mailbox *m, struct Message *msg)
 Save changes to an email - Implements MxOps::msg_commit() -.
 
static int maildir_msg_commit (struct Mailbox *m, struct Message *msg)
 Save changes to an email - Implements MxOps::msg_commit() -.
 
static int mh_msg_commit (struct Mailbox *m, struct Message *msg)
 Save changes to an email - Implements MxOps::msg_commit() -.
 
static int mbox_msg_commit (struct Mailbox *m, struct Message *msg)
 Save changes to an email - Implements MxOps::msg_commit() -.
 
static int mmdf_msg_commit (struct Mailbox *m, struct Message *msg)
 Save changes to an email - Implements MxOps::msg_commit() -.
 
static int nm_msg_commit (struct Mailbox *m, struct Message *msg)
 Save changes to an email - Implements MxOps::msg_commit() -.
 

Detailed Description

Save changes to an email.

Parameters
mMailbox
msgMessage to commit
Return values
0Success
-1Failure
Precondition
m is not NULL
msg is not NULL

Function Documentation

◆ comp_msg_commit()

static int comp_msg_commit ( struct Mailbox m,
struct Message msg 
)
static

Save changes to an email - Implements MxOps::msg_commit() -.

Definition at line 791 of file compress.c.

792{
793 if (!m->compress_info)
794 return -1;
795
796 struct CompressInfo *ci = m->compress_info;
797
798 const struct MxOps *ops = ci->child_ops;
799 if (!ops)
800 return -1;
801
802 /* Delegate */
803 return ops->msg_commit(m, msg);
804}
Private data for compress.
Definition: lib.h:47
const struct MxOps * child_ops
callbacks of de-compressed file
Definition: lib.h:52
void * compress_info
Compressed mbox module private data.
Definition: mailbox.h:121
Definition: mxapi.h:91
int(* msg_commit)(struct Mailbox *m, struct Message *msg)
Definition: mxapi.h:247

◆ imap_msg_commit()

int imap_msg_commit ( struct Mailbox m,
struct Message msg 
)

Save changes to an email - Implements MxOps::msg_commit() -.

Note
May also return EOF Failure, see errno

Definition at line 2149 of file message.c.

2150{
2151 int rc = mutt_file_fclose(&msg->fp);
2152 if (rc != 0)
2153 return rc;
2154
2155 return imap_append_message(m, msg);
2156}
int mutt_file_fclose(FILE **fp)
Close a FILE handle (and NULL the pointer)
Definition: file.c:152
int imap_append_message(struct Mailbox *m, struct Message *msg)
Write an email back to the server.
Definition: message.c:1516
FILE * fp
pointer to the message data
Definition: message.h:35
+ Here is the call graph for this function:

◆ maildir_msg_commit()

static int maildir_msg_commit ( struct Mailbox m,
struct Message msg 
)
static

Save changes to an email - Implements MxOps::msg_commit() -.

Definition at line 1589 of file maildir.c.

1590{
1591 return maildir_commit_message(m, msg, NULL);
1592}
static int maildir_commit_message(struct Mailbox *m, struct Message *msg, struct Email *e)
Commit a message to a maildir folder.
Definition: maildir.c:259
+ Here is the call graph for this function:

◆ mh_msg_commit()

static int mh_msg_commit ( struct Mailbox m,
struct Message msg 
)
static

Save changes to an email - Implements MxOps::msg_commit() -.

Definition at line 1148 of file mh.c.

1149{
1150 return mh_commit_msg(m, msg, NULL, true);
1151}
static int mh_commit_msg(struct Mailbox *m, struct Message *msg, struct Email *e, bool updseq)
Commit a message to an MH folder.
Definition: mh.c:293
+ Here is the call graph for this function:

◆ mbox_msg_commit()

static int mbox_msg_commit ( struct Mailbox m,
struct Message msg 
)
static

Save changes to an email - Implements MxOps::msg_commit() -.

Definition at line 1509 of file mbox.c.

1510{
1511 if (fputc('\n', msg->fp) == EOF)
1512 return -1;
1513
1514 if ((fflush(msg->fp) == EOF) || (fsync(fileno(msg->fp)) == -1))
1515 {
1516 mutt_perror(_("Can't write message"));
1517 return -1;
1518 }
1519
1520 return 0;
1521}
#define mutt_perror(...)
Definition: logging2.h:93
#define _(a)
Definition: message.h:28

◆ mmdf_msg_commit()

static int mmdf_msg_commit ( struct Mailbox m,
struct Message msg 
)
static

Save changes to an email - Implements MxOps::msg_commit() -.

Definition at line 1661 of file mbox.c.

1662{
1663 if (fputs(MMDF_SEP, msg->fp) == EOF)
1664 return -1;
1665
1666 if ((fflush(msg->fp) == EOF) || (fsync(fileno(msg->fp)) == -1))
1667 {
1668 mutt_perror(_("Can't write message"));
1669 return -1;
1670 }
1671
1672 return 0;
1673}
#define MMDF_SEP
Definition: lib.h:62

◆ nm_msg_commit()

static int nm_msg_commit ( struct Mailbox m,
struct Message msg 
)
static

Save changes to an email - Implements MxOps::msg_commit() -.

Return values
-1Always

Definition at line 2372 of file notmuch.c.

2373{
2374 mutt_error(_("Can't write to virtual folder"));
2375 return -1;
2376}
#define mutt_error(...)
Definition: logging2.h:92