Commit 13dccf0a authored by Nigel McNie's avatar Nigel McNie
Browse files

[#2915] Remove any friend relationships from users who are being deleted.

parent f4d8dc79
......@@ -674,6 +674,14 @@ function delete_user($userid) {
delete_records('group_member_request', 'member', $userid);
delete_records('group_member_invite', 'member', $userid);
// Remove any friend relationships the user is in
execute_sql('DELETE FROM {usr_friend}
WHERE usr1 = ?
OR usr2 = ?', array($userid, $userid));
execute_sql('DELETE FROM {usr_friend_request}
WHERE owner = ?
OR requester = ?', array($userid, $userid));
db_commit();
handle_event('deleteuser', $userid);
......
Supports Markdown
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