public static function confirm_contact_request(int $userid, int $requesteduserid) {
        global $DB;

        if ($request = $DB->get_record('message_contact_requests', ['userid' => $userid,
                'requesteduserid' => $requesteduserid])) {
            self::add_contact($userid, $requesteduserid);

            $DB->delete_records('message_contact_requests', ['id' => $request->id]);
        }
    }
public static function confirm_contact_request(int $userid, int $requesteduserid) {
        global $DB;

        if ($request = $DB->get_record('message_contact_requests', ['userid' => $userid,
                'requesteduserid' => $requesteduserid])) {
            self::add_contact($userid, $requesteduserid);

            $DB->delete_records('message_contact_requests', ['id' => $request->id]);
        }
    }
public static function confirm_contact_request ( int $ userid , int $ requesteduserid ) { global $ DB ; if ( $ request = $ DB -> get_record ( 'message_contact_requests' , [ 'userid' => $ userid , 'requesteduserid' => $ requesteduserid ] ) ) { self :: add_contact ( $ userid , $ requesteduserid ) ; $ DB -> delete_records ( 'message_contact_requests' , [ 'id' => $ request -> id ] ) ; } }
Handles confirming a contact request.

@param int $userid The id of the user who created the contact request
@param int $requesteduserid The id of the user confirming the request
Handles confirming a contact request .