Commit 01c84500 authored by Francois Marier's avatar Francois Marier Committed by Gerrit Code Review
Browse files

Merge "Delete friend notifications when requester is deleted (bug #872641)"

parents eb1c4b67 0a9400b2
......@@ -84,6 +84,13 @@ class PluginNotificationInternal extends PluginNotification {
public static function deleteuser($event, $user) {
delete_records('notification_internal_activity', 'usr', $user['id']);
// Delete system messages from this user where the url points to their
// missing profile. They're mostly friend requests, which are now useless.
delete_records_select(
'notification_internal_activity',
'"from" = ? AND type = (SELECT id FROM {activity_type} WHERE name = ?) AND url = ?',
array($user['id'], 'maharamessage', get_config('wwwroot') . 'user/view.php?id=' . $user['id'])
);
}
/**
......
......@@ -98,6 +98,7 @@ function requestfriendship_submit(Pieform $form, $values) {
$n = new StdClass;
$n->url = get_config('wwwroot') . 'user/view.php?id=' . $loggedinid;
$n->users = array($user->id);
$n->fromuser = $loggedinid;
$lang = get_user_language($user->id);
$displayname = display_name($USER, $user);
$n->strings->urltext = (object) array('key' => 'Requests');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment