X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/17932f7aea1c21cf17738f47996345d9d0a6ce51..ef1ba39e8dae81091b6c3e73e72825ef6edea3c6:/uip/rmm.c diff --git a/uip/rmm.c b/uip/rmm.c index 64d85cea..8644a02f 100644 --- a/uip/rmm.c +++ b/uip/rmm.c @@ -37,13 +37,7 @@ main (int argc, char **argv) struct msgs_array msgs = { 0, 0, NULL }; struct msgs *mp; -#ifdef LOCALE - setlocale(LC_ALL, ""); -#endif - invo_name = r1bindex (argv[0], '/'); - - /* read user profile/context */ - context_read(); + if (nmh_init(argv[0], 1)) { return 1; } arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; @@ -118,24 +112,16 @@ main (int argc, char **argv) seq_setprev (mp); /* set the previous-sequence */ /* - * This is hackish. If we are using a external rmmproc, - * then we need to update the current folder in the - * context so the external rmmproc will remove files - * from the correct directory. This should be moved to - * folder_delmsgs(). + * As part of the new world locking order, folder_delmsgs() now updates + * the sequence and context for us. But since folder_delmsgs() doesn't + * have access to the folder name, change the context now. */ - if (rmmproc) { - context_replace (pfolder, folder); - context_save (); - fflush (stdout); - } + + context_replace (pfolder, folder); /* "remove" the SELECTED messages */ folder_delmsgs (mp, unlink_msgs, 0); - seq_save (mp); /* synchronize message sequences */ - context_replace (pfolder, folder); /* update current folder */ - context_save (); /* save the context file */ folder_free (mp); /* free folder structure */ done (0); return 1;