diff --git a/TandemPlugin.class.php b/TandemPlugin.class.php index a6bffaa40323be33efc70b300ace9b64a6b4ee9c..38b3e2697377b3d6c2b603121b8d4bb6af5b6384 100644 --- a/TandemPlugin.class.php +++ b/TandemPlugin.class.php @@ -275,7 +275,13 @@ class TandemPlugin extends StudIPPlugin implements SystemPlugin, PortalPlugin, H $pair_requests[$profile->id] = TandemPair::countByProfileAndStatus($profile, 0); if(!$pairs[$profile->id]) { //We're only looking for matches if no pairs have been found. - $match_count[$profile->id] = TandemMatching::countMatches($profile); + $matches = TandemMatching::findMatches($profile); + if (Config::get()->TANDEMPLUGIN_USE_LEVEL) { + $matches = array_filter($matches, function($match) use ($user_id) { + return $match->matchesSpokenLanguages($user_id); + }); + } + $match_count[$profile->id] = count($matches); if($match_count[$profile->id] > 0) { $matches_exist = true; }