From 12fd740c530106f4a74c5ff2c6ce6d0ea305ab70 Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Sat, 21 Feb 2009 12:53:43 +0200 Subject: 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. --- src/mail.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'src/mail.c') diff --git a/src/mail.c b/src/mail.c index e24b11c..196d517 100644 --- a/src/mail.c +++ b/src/mail.c @@ -198,20 +198,6 @@ resolve_message_template (const char *name) 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 () @@ -394,7 +380,8 @@ do_notify (struct file_triplet *trp, enum notification_event ev, } 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; -- cgit v1.2.1