projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Nico Golde:
[apps/madmutt.git]
/
mh.c
diff --git
a/mh.c
b/mh.c
index
2770b8e
..
5c0d664
100644
(file)
--- a/
mh.c
+++ b/
mh.c
@@
-1093,7
+1093,7
@@
static int maildir_open_new_message (MESSAGE * msg, CONTEXT * dest, HEADER * hdr
*
*/
*
*/
-
int maildir_commit_message (CONTEXT * ctx, MESSAGE * msg
, HEADER * hdr)
+
static int maildir_commit_message (MESSAGE * msg, CONTEXT * ctx
, HEADER * hdr)
{
char subdir[4];
char suffix[16];
{
char subdir[4];
char suffix[16];
@@
-1161,7
+1161,7
@@
int maildir_commit_message (CONTEXT * ctx, MESSAGE * msg, HEADER * hdr)
*/
*/
-static int _mh_commit_message (
CONTEXT * ctx, MESSAGE * msg
, HEADER * hdr,
+static int _mh_commit_message (
MESSAGE * msg, CONTEXT * ctx
, HEADER * hdr,
short updseq)
{
DIR *dirp;
short updseq)
{
DIR *dirp;
@@
-1226,12
+1226,10
@@
static int _mh_commit_message (CONTEXT * ctx, MESSAGE * msg, HEADER * hdr,
return 0;
}
return 0;
}
-int mh_commit_message (CONTEXT * ctx, MESSAGE * msg, HEADER * hdr)
-{
- return _mh_commit_message (ctx, msg, hdr, 1);
+static int mh_commit_message (MESSAGE * msg, CONTEXT * ctx, HEADER * hdr) {
+ return _mh_commit_message (msg, ctx, hdr, 1);
}
}
-
/* Sync a message in an MH folder.
*
* This code is also used for attachment deletion in maildir
/* Sync a message in an MH folder.
*
* This code is also used for attachment deletion in maildir
@@
-1263,9
+1261,9
@@
static int mh_rewrite_message (CONTEXT * ctx, int msgno)
strfcpy (partpath, h->path, _POSIX_PATH_MAX);
if (ctx->magic == M_MAILDIR)
strfcpy (partpath, h->path, _POSIX_PATH_MAX);
if (ctx->magic == M_MAILDIR)
- rc = maildir_commit_message (
ctx, dest
, h);
+ rc = maildir_commit_message (
dest, ctx
, h);
else
else
- rc = _mh_commit_message (
ctx, dest
, h, 0);
+ rc = _mh_commit_message (
dest, ctx
, h, 0);
mx_close_message (&dest);
mx_close_message (&dest);
@@
-1312,7
+1310,8
@@
static int mh_sync_message (CONTEXT * ctx, int msgno)
{
HEADER *h = ctx->hdrs[msgno];
{
HEADER *h = ctx->hdrs[msgno];
- if (h->attach_del || h->refs_changed || h->irt_changed)
+ if (h->attach_del ||
+ (h->env && (h->env->refs_changed || h->env->irt_changed)))
if (mh_rewrite_message (ctx, msgno) != 0)
return -1;
if (mh_rewrite_message (ctx, msgno) != 0)
return -1;
@@
-1323,7
+1322,8
@@
static int maildir_sync_message (CONTEXT * ctx, int msgno)
{
HEADER *h = ctx->hdrs[msgno];
{
HEADER *h = ctx->hdrs[msgno];
- if (h->attach_del || h->refs_changed || h->irt_changed) {
+ if (h->attach_del ||
+ (h->env && (h->env->refs_changed || h->env->irt_changed))) {
/* when doing attachment deletion/rethreading, fall back to the MH case. */
if (mh_rewrite_message (ctx, msgno) != 0)
return (-1);
/* when doing attachment deletion/rethreading, fall back to the MH case. */
if (mh_rewrite_message (ctx, msgno) != 0)
return (-1);
@@
-1748,7
+1748,7
@@
static int mh_check_mailbox (CONTEXT * ctx, int *index_hint, int unused)
ctx->hdrs[i]->active = 0;
if ((p = hash_find (fnames, ctx->hdrs[i]->path)) && p->h &&
ctx->hdrs[i]->active = 0;
if ((p = hash_find (fnames, ctx->hdrs[i]->path)) && p->h &&
- (m
box_strict_cmp_headers
(ctx->hdrs[i], p->h))) {
+ (m
utt_cmp_header
(ctx->hdrs[i], p->h))) {
ctx->hdrs[i]->active = 1;
/* found the right message */
if (!ctx->hdrs[i]->changed)
ctx->hdrs[i]->active = 1;
/* found the right message */
if (!ctx->hdrs[i]->changed)
@@
-1976,6
+1976,14
@@
static mx_t* reg_mx (void) {
return (fmt);
}
return (fmt);
}
+static int mh_commit (MESSAGE* msg, CONTEXT* ctx) {
+ return (mh_commit_message (msg, ctx, NULL));
+}
+
+static int maildir_commit (MESSAGE* msg, CONTEXT* ctx) {
+ return (maildir_commit_message (msg, ctx, NULL));
+}
+
mx_t* mh_reg_mx (void) {
mx_t* fmt = reg_mx ();
fmt->type = M_MH;
mx_t* mh_reg_mx (void) {
mx_t* fmt = reg_mx ();
fmt->type = M_MH;
@@
-1984,6
+1992,7
@@
mx_t* mh_reg_mx (void) {
fmt->mx_open_mailbox = mh_read_dir;
fmt->mx_open_new_message = mh_open_new_message;
fmt->mx_check_mailbox = mh_check_mailbox;
fmt->mx_open_mailbox = mh_read_dir;
fmt->mx_open_new_message = mh_open_new_message;
fmt->mx_check_mailbox = mh_check_mailbox;
+ fmt->mx_commit_message = mh_commit;
return (fmt);
}
return (fmt);
}
@@
-1995,5
+2004,6
@@
mx_t* maildir_reg_mx (void) {
fmt->mx_open_mailbox = maildir_read_dir;
fmt->mx_open_new_message = maildir_open_new_message;
fmt->mx_check_mailbox = maildir_check_mailbox;
fmt->mx_open_mailbox = maildir_read_dir;
fmt->mx_open_new_message = maildir_open_new_message;
fmt->mx_check_mailbox = maildir_check_mailbox;
+ fmt->mx_commit_message = maildir_commit;
return (fmt);
}
return (fmt);
}