/[imapfilter]/imapfilter/request.c
ViewVC logotype

Diff of /imapfilter/request.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.19 by lefcha, Mon Jan 14 18:14:33 2002 UTC revision 1.20 by lefcha, Fri Jan 25 17:10:17 2002 UTC
# Line 368  int apply_action(char *mesgs, unsigned i Line 368  int apply_action(char *mesgs, unsigned i
368          action_delete(mesgs, args);          action_delete(mesgs, args);
369          break;          break;
370      case FILTER_ACTION_COPY:      case FILTER_ACTION_COPY:
371          info("%d message%s copied to mailbox %s.\n", cnt, plural(cnt),          info("%d message%s copied to mailbox \"%s\".\n", cnt, plural(cnt),
372               destmbox);               destmbox);
373          action_copy(mesgs, apply_namespace(destmbox, namesp.prefix,          action_copy(mesgs, apply_namespace(destmbox, namesp.prefix,
374                                             namesp.delim), args);                                             namesp.delim), args);
375          break;          break;
376      case FILTER_ACTION_MOVE:      case FILTER_ACTION_MOVE:
377          info("%d message%s moved to mailbox %s.\n", cnt, plural(cnt),          info("%d message%s moved to mailbox \"%s\".\n", cnt, plural(cnt),
378               destmbox);               destmbox);
379          action_move(mesgs, apply_namespace(destmbox, namesp.prefix,          action_move(mesgs, apply_namespace(destmbox, namesp.prefix,
380                                             namesp.delim), args);                                             namesp.delim), args);
# Line 428  int action_delete(char *mesgs, char *arg Line 428  int action_delete(char *mesgs, char *arg
428   */   */
429  int action_copy(char *mesgs, char *destmbox, char *args)  int action_copy(char *mesgs, char *destmbox, char *args)
430  {  {
431        int r = 0;
432      const char *delim = " ";      const char *delim = " ";
433      char *tok, *mcp, *m, *acp = NULL, *occur;      char *tok, *mcp, *m, *acp = NULL, *occur;
434    
# Line 443  int action_copy(char *mesgs, char *destm Line 444  int action_copy(char *mesgs, char *destm
444          if (*args)          if (*args)
445              fetch_response(imap_fetch(tok, acp, 0));              fetch_response(imap_fetch(tok, acp, 0));
446    
447          if (copy_response(imap_copy(tok, destmbox)) == RESPONSE_TRYCREATE)          if ((r = copy_response(imap_copy(tok, destmbox))) == RESPONSE_TRYCREATE)
448              if (!server_response(imap_create(destmbox)))              if (!server_response(imap_create(destmbox)))
449                  copy_response(imap_copy(tok, destmbox));                  r = copy_response(imap_copy(tok, destmbox));
450      }      }
451    
452      xfree(mcp);      xfree(mcp);
# Line 453  int action_copy(char *mesgs, char *destm Line 454  int action_copy(char *mesgs, char *destm
454      if (*args)      if (*args)
455          xfree(acp);          xfree(acp);
456    
457      return 0;      return r;
458  }  }
459    
460    
# Line 462  int action_copy(char *mesgs, char *destm Line 463  int action_copy(char *mesgs, char *destm
463   */   */
464  int action_move(char *mesgs, char *destmbox, char *args)  int action_move(char *mesgs, char *destmbox, char *args)
465  {  {
466      action_copy(mesgs, destmbox, args);      if (!action_copy(mesgs, destmbox, args))
467      action_delete(mesgs, "\0");          action_delete(mesgs, "\0");
468    
469      /* CLOSE -> SELECT much faster than EXPUNGE -> SELECT */      /* CLOSE -> SELECT much faster than EXPUNGE -> SELECT */
470      /* server_response(imap_expunge()); */      /* server_response(imap_expunge()); */

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.20

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26