Skip to content

Commit

Permalink
fix(mobile-clients): Require supported mobile clients when E2EE calls…
Browse files Browse the repository at this point in the history
… are enforced

Signed-off-by: Joas Schilling <coding@schilljs.com>
  • Loading branch information
nickvergessen authored and Antreesy committed Jan 15, 2025
1 parent 4d5379a commit 292aa49
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/Middleware/CanUseTalkMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ class CanUseTalkMiddleware extends Middleware {
public const TALK_DESKTOP_MIN_VERSION_RECORDING_CONSENT = '0.16.0';
public const TALK_ANDROID_MIN_VERSION = '15.0.0';
public const TALK_ANDROID_MIN_VERSION_RECORDING_CONSENT = '18.0.0';
public const TALK_ANDROID_MIN_VERSION_E2EE_CALLS = '22.0.0';

public const TALK_IOS_MIN_VERSION = '15.0.0';
public const TALK_IOS_MIN_VERSION_RECORDING_CONSENT = '18.0.0';
public const TALK_IOS_MIN_VERSION_E2EE_CALLS = '22.0.0';


public function __construct(
Expand Down Expand Up @@ -139,14 +141,18 @@ protected function throwIfUnsupportedClientVersion(string $client, string $userA
$versionRegex = IRequest::USER_AGENT_TALK_ANDROID;
$minVersion = self::TALK_ANDROID_MIN_VERSION;

if ($this->talkConfig->recordingConsentRequired()) {
if ($this->talkConfig->isCallEndToEndEncryptionEnabled()) {
$minVersion = self::TALK_ANDROID_MIN_VERSION_E2EE_CALLS;
} elseif ($this->talkConfig->recordingConsentRequired()) {
$minVersion = self::TALK_ANDROID_MIN_VERSION_RECORDING_CONSENT;
}
} elseif ($client === 'ios') {
$versionRegex = IRequest::USER_AGENT_TALK_IOS;
$minVersion = self::TALK_IOS_MIN_VERSION;

if ($this->talkConfig->recordingConsentRequired()) {
if ($this->talkConfig->isCallEndToEndEncryptionEnabled()) {
$minVersion = self::TALK_IOS_MIN_VERSION_E2EE_CALLS;
} elseif ($this->talkConfig->recordingConsentRequired()) {
$minVersion = self::TALK_IOS_MIN_VERSION_RECORDING_CONSENT;
}
} else {
Expand Down

0 comments on commit 292aa49

Please sign in to comment.