Permalink
Browse files

fix(notifications): notifications about new friends work again

Friends library was using the [create, friend] event to track the
need to send notifications. The event is obsolete in Elgg 2.0, so
the notifications never got sent. Now the library is using the
[create, relationship] event instead.
  • Loading branch information...
juho-jaakkola committed Dec 24, 2015
1 parent 5c8efb3 commit a23683ee5e3a06fbb0d1234e5a9fea0ac49947fc
Showing with 5 additions and 1 deletion.
  1. +5 −1 engine/lib/friends.php
View
@@ -30,7 +30,7 @@ function _elgg_friends_init() {
elgg_register_event_handler('pagesetup', 'system', '_elgg_friends_page_setup');
elgg_register_event_handler('pagesetup', 'system', '_elgg_setup_collections_menu');
elgg_register_plugin_hook_handler('register', 'menu:user_hover', '_elgg_friends_setup_user_hover_menu');
elgg_register_event_handler('create', 'friend', '_elgg_send_friend_notification');
elgg_register_event_handler('create', 'relationship', '_elgg_send_friend_notification');
}
/**
@@ -204,6 +204,10 @@ function _elgg_setup_collections_menu() {
* @access private
*/
function _elgg_send_friend_notification($event, $type, $object) {
if ($object->relationship != 'friend') {
return true;
}
$user_one = get_entity($object->guid_one);
/* @var \ElggUser $user_one */

0 comments on commit a23683e

Please sign in to comment.