Skip to:
Content

BuddyPress.org

Changeset 11969


Ignore:
Timestamp:
04/13/2018 02:01:08 PM (6 years ago)
Author:
dcavins
Message:

Allow pending invite to be cancelled without friendship requirement.

BP Legacy's function bp_legacy_theme_ajax_invite_user() was built to stop early if the invitee was not a friend of the inviter. In the case where you extend an invitation to a user, then cancel your friendship, you were prevented from running the uninvite task. This patch removes the friendship check from the uninvite task.

Props r-a-y.

Fixes #7726.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-legacy/buddypress-functions.php

    r11897 r11969  
    13281328        return;
    13291329
    1330     if ( ! friends_check_friendship( bp_loggedin_user_id(), $_POST['friend_id'] ) )
    1331         return;
    1332 
    13331330    $group_id = (int) $_POST['group_id'];
    13341331    $friend_id = (int) $_POST['friend_id'];
    13351332
    13361333    if ( 'invite' == $_POST['friend_action'] ) {
     1334        if ( ! friends_check_friendship( bp_loggedin_user_id(), $_POST['friend_id'] ) ) {
     1335            return;
     1336        }
     1337
    13371338        $group = groups_get_group( $group_id );
    13381339
Note: See TracChangeset for help on using the changeset viewer.