From 36ef345eb6425106f061fb866d9fa66d051e16df Mon Sep 17 00:00:00 2001 From: brettp Date: Mon, 5 Apr 2010 16:08:42 +0000 Subject: Merged 5530:5604 from 1.7 to trunk. git-svn-id: http://code.elgg.org/elgg/trunk@5622 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/notification.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'engine/lib/notification.php') diff --git a/engine/lib/notification.php b/engine/lib/notification.php index adc4ebace..024881e0f 100644 --- a/engine/lib/notification.php +++ b/engine/lib/notification.php @@ -50,6 +50,19 @@ function register_notification_handler($method, $handler, $params = NULL) { return false; } +/** + * This function unregisters a handler for a given notification type (eg "email") + * + * @param string $method The method + */ +function unregister_notification_handler($method) { + global $NOTIFICATION_HANDLERS; + + if (isset($NOTIFICATION_HANDLERS[$method])) { + unset($NOTIFICATION_HANDLERS[$method]); + } +} + /** * Notify a user via their preferences. * @@ -101,6 +114,11 @@ function notify_user($to, $from, $subject, $message, array $params = NULL, $meth if ($methods) { // Deliver foreach ($methods as $method) { + + if (!isset($NOTIFICATION_HANDLERS[$method])) { + continue; + } + // Extract method details from list $details = $NOTIFICATION_HANDLERS[$method]; $handler = $details->handler; -- cgit v1.2.3