if (uid_validity != NULL && *uid_validity == idata->uid_validity) {
ctx->hdrs[msgno] =
mutt_hcache_restore ((unsigned char *) uid_validity, 0);
ctx->hdrs[msgno]->index = h.sid - 1;
if (h.sid != ctx->msgcount + 1)
if (uid_validity != NULL && *uid_validity == idata->uid_validity) {
ctx->hdrs[msgno] =
mutt_hcache_restore ((unsigned char *) uid_validity, 0);
ctx->hdrs[msgno]->index = h.sid - 1;
if (h.sid != ctx->msgcount + 1)
- dprint (1, (debugfile, "imap_append_message(): command failed: %s\n",
- idata->cmd.buf));
+ debug_print (1, ("command failed: %s\n", idata->cmd.buf));
- dprint (1, (debugfile, "imap_append_message(): command failed: %s\n",
- idata->cmd.buf));
+ debug_print (1, ("command failed: %s\n", idata->cmd.buf));
int imap_copy_messages (CONTEXT * ctx, HEADER * h, char *dest, int delete)
{
IMAP_DATA *idata;
int imap_copy_messages (CONTEXT * ctx, HEADER * h, char *dest, int delete)
{
IMAP_DATA *idata;
idata = (IMAP_DATA *) ctx->data;
if (imap_parse_path (dest, &mx)) {
idata = (IMAP_DATA *) ctx->data;
if (imap_parse_path (dest, &mx)) {
- dprint (1, (debugfile, "imap_copy_messages: bad destination %s\n", dest));
+ debug_print (1, ("bad destination %s\n", dest));
return -1;
}
/* check that the save-to folder is in the same account */
if (!mutt_account_match (&(CTX_DATA->conn->account), &(mx.account))) {
return -1;
}
/* check that the save-to folder is in the same account */
if (!mutt_account_match (&(CTX_DATA->conn->account), &(mx.account))) {
- dprint (3, (debugfile, "imap_copy_messages: %s not same server as %s\n",
- dest, ctx->path));
+ debug_print (3, ("%s not same server as %s\n", dest, ctx->path));
return 1;
}
imap_fix_path (idata, mx.mbox, mbox, sizeof (mbox));
return 1;
}
imap_fix_path (idata, mx.mbox, mbox, sizeof (mbox));
memset (&cmd, 0, sizeof (cmd));
mutt_buffer_addstr (&cmd, "UID COPY ");
memset (&cmd, 0, sizeof (cmd));
mutt_buffer_addstr (&cmd, "UID COPY ");
+
+ if (ctx->hdrs[n]->tagged && ctx->hdrs[n]->active &&
+ ctx->hdrs[n]->changed)
+ {
+ rc = imap_sync_message (idata, ctx->hdrs[n], &sync_cmd, &err_continue);
+ if (rc < 0)
+ {
+ debug_print (1, ("could not sync\n"));
+ goto fail;
+ }
+ }
}
rc = imap_make_msg_set (idata, &cmd, M_TAG, 0);
if (!rc) {
}
rc = imap_make_msg_set (idata, &cmd, M_TAG, 0);
if (!rc) {
mutt_message (_("Copying message %d to %s..."), h->index + 1, mbox);
snprintf (uid, sizeof (uid), "%u", HEADER_DATA (h)->uid);
mutt_buffer_addstr (&cmd, uid);
mutt_message (_("Copying message %d to %s..."), h->index + 1, mbox);
snprintf (uid, sizeof (uid), "%u", HEADER_DATA (h)->uid);
mutt_buffer_addstr (&cmd, uid);
+
+ if (h->active && h->changed)
+ {
+ rc = imap_sync_message (idata, h, &sync_cmd, &err_continue);
+ if (rc < 0)
+ {
+ debug_print (1, ("could not sync\n"));
+ goto fail;
+ }
+ }
snprintf (mmbox, sizeof (mmbox), _("Create %s?"), mbox);
if (option (OPTCONFIRMCREATE) && mutt_yesorno (mmbox, 1) < 1) {
mutt_clear_error ();
snprintf (mmbox, sizeof (mmbox), _("Create %s?"), mbox);
if (option (OPTCONFIRMCREATE) && mutt_yesorno (mmbox, 1) < 1) {
mutt_clear_error ();
memset (&newh, 0, sizeof (newh));
newh.data = safe_calloc (1, sizeof (IMAP_HEADER_DATA));
memset (&newh, 0, sizeof (newh));
newh.data = safe_calloc (1, sizeof (IMAP_HEADER_DATA));
/* sanity-check string */
if (ascii_strncasecmp ("FLAGS", s, 5) != 0) {
/* sanity-check string */
if (ascii_strncasecmp ("FLAGS", s, 5) != 0) {
- dprint (1, (debugfile, "msg_parse_flags: not a FLAGS response: %s\n", s));
+ debug_print (1, ("not a FLAGS response: %s\n", s));
- dprint (1, (debugfile, "msg_parse_flags: bogus FLAGS response: %s\n", s));
+ debug_print (1, ("bogus FLAGS response: %s\n", s));