aboutsummaryrefslogtreecommitdiff
path: root/src/mail.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2009-02-21 12:53:43 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2009-02-21 12:53:43 +0200
commit12fd740c530106f4a74c5ff2c6ce6d0ea305ab70 (patch)
tree6064e3770a3fa4210443cfc9f8cd390b932aee94 /src/mail.c
parent62758ace16e756050f15b81e66ee5ab3bdd062ab (diff)
downloadwydawca-12fd740c530106f4a74c5ff2c6ce6d0ea305ab70.tar.gz
wydawca-12fd740c530106f4a74c5ff2c6ce6d0ea305ab70.tar.bz2
Implement per-directory notifications
* src/config.c (default_notification): New static. (cb_notify_event): Explicitly link new notification to the chain. (directory_kw): New keyword "notify-event". (cb_directory): Use previously defined global notifications. * src/mail.c (register_notification): Remove. (notify): Tak a list of notifications to run as an argument. * src/directive.c, src/gpg.c, src/verify.c: Update calls to notify. * src/wydawca.h (struct directory_pair.notification): New member. * tests/notify-upl.at: Define notifications before the directory pair in the configuration file.
Diffstat (limited to 'src/mail.c')
-rw-r--r--src/mail.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/mail.c b/src/mail.c
index e24b11c..196d517 100644
--- a/src/mail.c
+++ b/src/mail.c
@@ -195,26 +195,12 @@ resolve_message_template (const char *name)
return p ? p->text : NULL;
}
}
return name;
}
-
-static struct notification *notification_list;
-
-void
-register_notification (const struct notification *notif)
-{
- struct notification *newp = xmalloc (sizeof *newp);
- newp->ev = notif->ev;
- newp->tgt = notif->tgt;
- newp->msg = notif->msg;
- newp->next = notification_list;
- notification_list = newp;
-}
-
void
mail_stats ()
{
struct metadef exp[MAX_STAT + 2];
time_t t;
@@ -391,13 +377,14 @@ do_notify (struct file_triplet *trp, enum notification_event ev,
}
mu_address_destroy (&rcpt);
}
void
-notify (struct file_triplet *trp, enum notification_event ev)
+notify (struct notification *notification_list,
+ struct file_triplet *trp, enum notification_event ev)
{
struct notification *p;
fill_project_name (trp);
for (p = notification_list; p; p = p->next)
if (p->ev == ev)

Return to:

Send suggestions and report system problems to the System administrator.