aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/notification.php
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-01-22 15:31:38 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-01-22 15:31:38 +0000
commit32cb70870c2cd5bd1d01031982eba4fbaaa5989b (patch)
tree15bb6a8ab7c0dbcf9ba70db3bc6547aa3570db87 /engine/lib/notification.php
parent7fb95f609a42da3964188b8093d0b66e439e33d0 (diff)
downloadelgg-32cb70870c2cd5bd1d01031982eba4fbaaa5989b.tar.gz
elgg-32cb70870c2cd5bd1d01031982eba4fbaaa5989b.tar.bz2
Added more granular notification hook
git-svn-id: https://code.elgg.org/elgg/trunk@2598 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/notification.php')
-rw-r--r--engine/lib/notification.php18
1 files changed, 16 insertions, 2 deletions
diff --git a/engine/lib/notification.php b/engine/lib/notification.php
index 65d5f6a75..a70d051ff 100644
--- a/engine/lib/notification.php
+++ b/engine/lib/notification.php
@@ -375,8 +375,22 @@
if ($interested_users = get_entities_from_relationship('notify',$object->container_guid,true,'user','',0,'',99999)) {
if (is_array($interested_users))
foreach($interested_users as $user) {
- if ($user instanceof ElggUser)
- notify_user($user->guid,$object->container_guid,$descr,$string);
+ if ($user instanceof ElggUser) {
+ $tmp = (array)get_user_notification_settings($guid);
+ $methods = array();
+
+ // TODO: get the specific method to contact each user with - for now just go with their prefs
+ foreach($tmp as $k => $v)
+ if ($v) {
+
+ $string = trigger_plugin_hook('notify:message',$entity->getType(),array(
+ 'entity' => $object,
+ 'to_entity' => $user,
+ 'method' => $v
+ ),$string);
+ notify_user($user->guid,$object->container_guid,$descr,$string,NULL,array($v));
+ }
+ }
}
}