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

Diff of /imapfilter/request.c

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

revision 1.17.2.2 by lefcha, Wed Dec 5 21:17:11 2001 UTC revision 1.17.2.3 by lefcha, Mon Jan 21 15:43:42 2002 UTC
# Line 365  int apply_action(char *mesgs, unsigned i Line 365  int apply_action(char *mesgs, unsigned i
365          action_delete(mesgs, args);          action_delete(mesgs, args);
366          break;          break;
367      case FILTER_ACTION_COPY:      case FILTER_ACTION_COPY:
368          info("%d message%s copied to mailbox %s.\n", cnt, plural(cnt),          info("%d message%s copied to mailbox \"%s\".\n", cnt, plural(cnt),
369               destmbox);               destmbox);
370          action_copy(mesgs, apply_namespace(destmbox, namesp.prefix,          action_copy(mesgs, apply_namespace(destmbox, namesp.prefix,
371                                             namesp.delim), args);                                             namesp.delim), args);
372          break;          break;
373      case FILTER_ACTION_MOVE:      case FILTER_ACTION_MOVE:
374          info("%d message%s moved to mailbox %s.\n", cnt, plural(cnt),          info("%d message%s moved to mailbox \"%s\".\n", cnt, plural(cnt),
375               destmbox);               destmbox);
376          action_move(mesgs, apply_namespace(destmbox, namesp.prefix,          action_move(mesgs, apply_namespace(destmbox, namesp.prefix,
377                                             namesp.delim), args);                                             namesp.delim), args);
# Line 425  int action_delete(char *mesgs, char *arg Line 425  int action_delete(char *mesgs, char *arg
425   */   */
426  int action_copy(char *mesgs, char *destmbox, char *args)  int action_copy(char *mesgs, char *destmbox, char *args)
427  {  {
428        int r = 0;
429      const char *delim = " ";      const char *delim = " ";
430      char *tok, *mcp, *m, *acp = NULL, *occur;      char *tok, *mcp, *m, *acp = NULL, *occur;
431    
# Line 440  int action_copy(char *mesgs, char *destm Line 441  int action_copy(char *mesgs, char *destm
441          if (*args)          if (*args)
442              fetch_response(imap_fetch(tok, acp, 0));              fetch_response(imap_fetch(tok, acp, 0));
443    
444          if (copy_response(imap_copy(tok, destmbox)) == RESPONSE_TRYCREATE)          if ((r = copy_response(imap_copy(tok, destmbox))) == RESPONSE_TRYCREATE)
445              if (!server_response(imap_create(destmbox)))              if (!server_response(imap_create(destmbox)))
446                  copy_response(imap_copy(tok, destmbox));                  r = copy_response(imap_copy(tok, destmbox));
447      }      }
448    
449      free(mcp);      free(mcp);
# Line 450  int action_copy(char *mesgs, char *destm Line 451  int action_copy(char *mesgs, char *destm
451      if (*args)      if (*args)
452          free(acp);          free(acp);
453    
454      return 0;      return r;
455  }  }
456    
457    
# Line 459  int action_copy(char *mesgs, char *destm Line 460  int action_copy(char *mesgs, char *destm
460   */   */
461  int action_move(char *mesgs, char *destmbox, char *args)  int action_move(char *mesgs, char *destmbox, char *args)
462  {  {
463      action_copy(mesgs, destmbox, args);      if (!action_copy(mesgs, destmbox, args))
464      action_delete(mesgs, "\0");          action_delete(mesgs, "\0");
465    
466      /* CLOSE -> SELECT much faster than EXPUNGE -> SELECT */      /* CLOSE -> SELECT much faster than EXPUNGE -> SELECT */
467      /* server_response(imap_expunge()); */      /* server_response(imap_expunge()); */

Legend:
Removed from v.1.17.2.2  
changed lines
  Added in v.1.17.2.3

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26