int done (int);
int ext_hook(char *, char *, char *);
int fdcompare (int, int);
-int folder_addmsg (struct msgs **, char *, int, int, int, int);
+int folder_addmsg (struct msgs **, char *, int, int, int, int, char *);
int folder_delmsgs (struct msgs *, int, int);
void folder_free (struct msgs *);
int folder_pack (struct msgs **, int);
int
folder_addmsg (struct msgs **mpp, char *msgfile, int selected,
- int unseen, int preserve, int deleting)
+ int unseen, int preserve, int deleting, char *from_dir)
{
int infd, outfd, linkerr, first_time, msgnum;
char *nmsg, newmsg[BUFSIZ];
if (link (msgfile, newmsg) != -1) {
if (deleting) {
- (void)snprintf(oldmsg, sizeof (oldmsg), "%s/%s", pwd(), msgfile);
+ (void)snprintf(oldmsg, sizeof (oldmsg), "%s/%s", from_dir, msgfile);
(void)ext_hook("ref-hook", oldmsg, newmsg);
}
else
close (outfd);
if (deleting) {
- (void)snprintf(oldmsg, sizeof (oldmsg), "%s/%s", pwd(), msgfile);
+ (void)snprintf(oldmsg, sizeof (oldmsg), "%s/%s", from_dir, msgfile);
(void)ext_hook("ref-hook", oldmsg, newmsg);
}
else
/* Read the folder. */
if ((mp = folder_read (folder))) {
/* Link file into folder */
- msgnum = folder_addmsg (&mp, filename, 0, 0, 0, 0);
+ msgnum = folder_addmsg (&mp, filename, 0, 0, 0, 0, (char *)0);
} else {
advise (NULL, "unable to read folder %s", folder);
return NOTOK;
* Link message into folder, and possibly add
* to the Unseen-Sequence's.
*/
- if ((msgnum = folder_addmsg (&mp, tmpfilenam, 0, unseensw, 0, 0)) == -1)
+ if ((msgnum = folder_addmsg (&mp, tmpfilenam, 0, unseensw, 0, 0, (char *)0)) == -1)
done (1);
/*
struct st_fold *fp, *ep;
for (fp = folders, ep = folders + nfolders; fp < ep; fp++) {
- if ((msgnum = folder_addmsg (&fp->f_mp, msgfile, 1, 0, preserve, nfolders == 1 && refile)) == -1)
+ if ((msgnum = folder_addmsg (&fp->f_mp, msgfile, 1, 0, preserve, nfolders == 1 && refile, maildir)) == -1)
return 1;
}
return 0;