mutt_message _("Expunging messages from server..."); CTX_DATA->status = IMAP_EXPUNGE; imap_make_sequence (seq, sizeof (seq)); snprintf (buf, sizeof (buf), "%s EXPUNGE\r\n", seq); if (imap_exec (buf, sizeof (buf), CTX_DATA, seq, buf, 0) != 0)
if (mutt_bit_isset(CTX_DATA->rights, IMAP_ACL_DELETE))
int imap_sync_mailbox (CONTEXT *ctx){  char seq[8];  char buf[LONG_STRING];  char set_flags[LONG_STRING];  char unset_flags[LONG_STRING];  int n;  /* save status changes */  for (n = 0; n < ctx->msgcount; n++)  {    if (ctx->hdrs[n]->deleted || ctx->hdrs[n]->changed)    {      snprintf (buf, sizeof (buf), _("Saving message status flags... [%d/%d]"),		n+1, ctx->msgcount);      mutt_message (buf);            *set_flags = '\0';      *unset_flags = '\0';            _imap_set_flag (ctx, IMAP_ACL_SEEN, ctx->hdrs[n]->read, "\\Seen ", set_flags, unset_flags);      _imap_set_flag (ctx, IMAP_ACL_WRITE, ctx->hdrs[n]->flagged, "\\Flagged ", set_flags, unset_flags);      _imap_set_flag (ctx, IMAP_ACL_WRITE, ctx->hdrs[n]->replied, "\\Answered ", set_flags, unset_flags);      _imap_set_flag (ctx, IMAP_ACL_DELETE, ctx->hdrs[n]->deleted, "\\Deleted", set_flags, unset_flags);            mutt_remove_trailing_ws (set_flags);      mutt_remove_trailing_ws (unset_flags);            if (*set_flags)      {	imap_make_sequence (seq, sizeof (seq));	snprintf (buf, sizeof (buf), "%s STORE %d +FLAGS.SILENT (%s)\r\n", seq,		  ctx->hdrs[n]->index + 1, set_flags);	if (imap_exec (buf, sizeof (buf), CTX_DATA, seq, buf, 0) != 0)	{	  imap_error ("imap_sync_mailbox()", buf);	  return (-1);	}      }            if (*unset_flags)      {	imap_make_sequence (seq, sizeof (seq));	snprintf (buf, sizeof (buf), "%s STORE %d -FLAGS.SILENT (%s)\r\n", seq,		  ctx->hdrs[n]->index + 1, unset_flags);	if (imap_exec (buf, sizeof (buf), CTX_DATA, seq, buf, 0) != 0)	{	  imap_error ("imap_sync_mailbox()", buf);	  return (-1);	}      }    }  }  if (mutt_bit_isset(CTX_DATA->rights, IMAP_ACL_DELETE))  {    mutt_message _("Expunging messages from server...");    CTX_DATA->status = IMAP_EXPUNGE;    imap_make_sequence (seq, sizeof (seq));    snprintf (buf, sizeof (buf), "%s EXPUNGE\r\n", seq);    if (imap_exec (buf, sizeof (buf), CTX_DATA, seq, buf, 0) != 0)    {      imap_error ("imap_sync_mailbox()", buf);      return (-1);    }    CTX_DATA->status = 0;  }  for (n = 0; n < IMAP_CACHE_LEN; n++)  {    if (CTX_DATA->cache[n].path)    {      unlink (CTX_DATA->cache[n].path);      safe_free ((void **) &CTX_DATA->cache[n].path);    }  }  return 0;}