original_string: 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]);
          }
      }
code: 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]);
          }
      }
code_tokens: 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 ] ) ; } }
docstring: 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
docstring_tokens: Handles confirming a contact request .