aboutsummaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
Diffstat (limited to 'actions')
-rw-r--r--actions/friends/add.php8
-rw-r--r--actions/friends/remove.php2
2 files changed, 8 insertions, 2 deletions
diff --git a/actions/friends/add.php b/actions/friends/add.php
index c464a8162..e6efe1db1 100644
--- a/actions/friends/add.php
+++ b/actions/friends/add.php
@@ -26,7 +26,13 @@ if(check_entity_relationship($friend->guid, "friendrequest", $user->guid)
if (!$user->addFriend($friend_guid)) {
$errors = true;
}
- remove_entity_relationship($friend->guid, "friendrequest", $user->guid);
+
+ $ia = elgg_set_ignore_access(true);
+ $friend->addFriend($user->guid);
+ elgg_set_ignore_access($ia);
+
+ remove_entity_relationship($friend->guid, "friendrequest", $user->guid);
+
} catch (Exception $e) {
register_error(elgg_echo("friends:add:failure", array($friend->name)));
$errors = true;
diff --git a/actions/friends/remove.php b/actions/friends/remove.php
index 936f6f43b..62bccb891 100644
--- a/actions/friends/remove.php
+++ b/actions/friends/remove.php
@@ -17,7 +17,7 @@ try{
if ($friend instanceof ElggUser) {
elgg_get_logged_in_user_entity()->removeFriend($friend_guid);
$ia = elgg_set_ignore_access(true);
- $friend->removeFriend($elgg_get_logged_in_user_guid());
+ $friend->removeFriend(elgg_get_logged_in_user_guid());
elgg_set_ignore_access($ia);
} else {
register_error(elgg_echo("friends:remove:failure", array($friend->name)));