diff options
| author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-04-05 16:08:42 +0000 | 
|---|---|---|
| committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-04-05 16:08:42 +0000 | 
| commit | 36ef345eb6425106f061fb866d9fa66d051e16df (patch) | |
| tree | 53fb2bd05f8b5e2010f9e3d1e93075ad7071ec1e /engine/lib/notification.php | |
| parent | 5571ca5b350fd1735f13af7ddfbb88afa6befb0c (diff) | |
| download | elgg-36ef345eb6425106f061fb866d9fa66d051e16df.tar.gz elgg-36ef345eb6425106f061fb866d9fa66d051e16df.tar.bz2 | |
Merged 5530:5604 from 1.7 to trunk.
git-svn-id: http://code.elgg.org/elgg/trunk@5622 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/notification.php')
| -rw-r--r-- | engine/lib/notification.php | 18 | 
1 files changed, 18 insertions, 0 deletions
| 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 @@ -51,6 +51,19 @@ function register_notification_handler($method, $handler, $params = NULL) {  }  /** + * 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.   *   * @param mixed $to Either a guid or an array of guid's to notify. @@ -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; | 
