X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=sbr%2Ffolder_delmsgs.c;h=4567f6d1912f2514df61dbdc79865e04280d213e;hp=3d2e5497a68b45381965b3dbe66b7d524bef6666;hb=a259594cc41e41bfbb90562d3977b8194d1446f5;hpb=982194e9f1c9e4718b4857b300fc3ab8b16c8f6b diff --git a/sbr/folder_delmsgs.c b/sbr/folder_delmsgs.c index 3d2e549..4567f6d 100644 --- a/sbr/folder_delmsgs.c +++ b/sbr/folder_delmsgs.c @@ -22,11 +22,12 @@ */ int -folder_delmsgs (struct msgs *mp, int unlink_msgs) +folder_delmsgs (struct msgs *mp, int unlink_msgs, int nohook) { pid_t pid; int msgnum, vecp, retval = 0; char buf[100], *dp, **vec; + char msgpath[BUFSIZ]; /* * If "rmmproc" is defined, exec it to remove messages. @@ -83,6 +84,19 @@ folder_delmsgs (struct msgs *mp, int unlink_msgs) unset_selected (mp, msgnum); mp->numsel--; + /* + * Run the external hook on the message if one was specified in the context. + * All we have is the message number; we have changed to the directory + * containing the message. So, we need to extract that directory to form + * the complete path. Note that the caller knows the directory, but has + * no way of passing that to us. + */ + + if (!nohook) { + (void)snprintf(msgpath, sizeof (msgpath), "%s/%d", getcwd(msgpath, sizeof (msgpath)), msgnum); + (void)ext_hook("del-hook", msgpath, (char *)0); + } + dp = m_name (msgnum); if (unlink_msgs) {