Skip to content

Commit

Permalink
Merge pull request #940 from tchapgouv/936-activer-les-appels-audio-s…
Browse files Browse the repository at this point in the history
…ur-mobile-pour-les-users-dinum-ios

Activer les appels audio sur mobile pour les users dinum ios
  • Loading branch information
NicolasBuquet authored Jan 23, 2024
2 parents 81be1c7 + afd6e7e commit 439b276
Show file tree
Hide file tree
Showing 21 changed files with 501 additions and 457 deletions.
2 changes: 1 addition & 1 deletion Btchap/Config/BuildSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ final class BuildSettings: NSObject {
// MARK: - Room Screen

static let roomScreenAllowVoIPForDirectRoom: Bool = true
static let roomScreenAllowVoIPForNonDirectRoom: Bool = true
static let roomScreenAllowVoIPForNonDirectRoom: Bool = false // Tchap: no Voip in non-direct rooms.
static let roomScreenAllowCameraAction: Bool = true
static let roomScreenAllowMediaLibraryAction: Bool = true
static let roomScreenAllowStickerAction: Bool = false
Expand Down
3 changes: 1 addition & 2 deletions Config/AppConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ class AppConfiguration: CommonConfiguration {
}

private func setupAppSettings() {
// Tchap: Disable CallKit.
MXKAppSettings.standard()?.isCallKitEnabled = false
MXKAppSettings.standard()?.isCallKitEnabled = true

// Get additional events (modular widget, voice broadcast...)
MXKAppSettings.standard()?.addSupportedEventTypes([kWidgetMatrixEventTypeString,
Expand Down
2 changes: 1 addition & 1 deletion Config/BuildSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ final class BuildSettings: NSObject {
// MARK: - Room Screen

static let roomScreenAllowVoIPForDirectRoom: Bool = true
static let roomScreenAllowVoIPForNonDirectRoom: Bool = true
static let roomScreenAllowVoIPForNonDirectRoom: Bool = false // Tchap: no Voip in non-direct rooms.
static let roomScreenAllowCameraAction: Bool = true
static let roomScreenAllowMediaLibraryAction: Bool = true
static let roomScreenAllowStickerAction: Bool = true
Expand Down
2 changes: 1 addition & 1 deletion DevTchap/Config/BuildSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ final class BuildSettings: NSObject {
// MARK: - Room Screen

static let roomScreenAllowVoIPForDirectRoom: Bool = true
static let roomScreenAllowVoIPForNonDirectRoom: Bool = true
static let roomScreenAllowVoIPForNonDirectRoom: Bool = false // Tchap: no Voip in non-direct rooms.
static let roomScreenAllowCameraAction: Bool = true
static let roomScreenAllowMediaLibraryAction: Bool = true
static let roomScreenAllowStickerAction: Bool = false
Expand Down
2 changes: 1 addition & 1 deletion Riot/Assets/fr.lproj/Vector.strings
Original file line number Diff line number Diff line change
Expand Up @@ -1465,7 +1465,7 @@

"voice_message_release_to_send" = "Maintenir pour enregistrer, relâcher pour envoyer";
"event_formatter_call_missed_video" = "Appel vidéo manqué";
"event_formatter_call_missed_voice" = "Appel audio manqué";
"event_formatter_call_missed_voice" = "Appel audio manqué\n\nActuellement sur iOS, vous ne pouvez que passer des appels et pas en recevoir."; // Tchap: temporary fix for VoIP beta-test
"event_formatter_call_active_video" = "Appel vidéo en cours";
"event_formatter_call_active_voice" = "Appel audio en cours";
"event_formatter_call_incoming_video" = "Appel vidéo entrant";
Expand Down
14 changes: 6 additions & 8 deletions Riot/Managers/PushNotification/PushNotificationService.m
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,10 @@ - (void)didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken

_isPushRegistered = YES;

// Tchap: Do not configure pushKit for the moment
// if (!_pushNotificationStore.pushKitToken)
// {
// [self configurePushKit];
// }
if (!_pushNotificationStore.pushKitToken)
{
[self configurePushKit];
}

if (self.registrationForRemoteNotificationsCompletion)
{
Expand Down Expand Up @@ -652,9 +651,8 @@ - (void)pushRegistry:(PKPushRegistry *)registry didReceiveIncomingPushWithPayloa
else if ([callInvite.type isEqualToString:kWidgetMatrixEventTypeString] ||
[callInvite.type isEqualToString:kWidgetModularEventTypeString])
{
// TODO: Tchap: VoIP support
// [[AppDelegate theDelegate].callPresenter processWidgetEvent:callInvite
// inSession:session];
[[AppDelegate theDelegate].callPresenter processWidgetEvent:callInvite
inSession:session];
}
else
{
Expand Down
19 changes: 7 additions & 12 deletions Riot/Modules/Application/LegacyAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
NSString *const kLegacyAppDelegateDidLogoutNotification = @"kLegacyAppDelegateDidLogoutNotification";
NSString *const kLegacyAppDelegateDidLoginNotification = @"kLegacyAppDelegateDidLoginNotification";

@interface LegacyAppDelegate () <GDPRConsentViewControllerDelegate, KeyVerificationCoordinatorBridgePresenterDelegate, PushNotificationServiceDelegate, SetPinCoordinatorBridgePresenterDelegate/*, CallPresenterDelegate, SpaceDetailPresenterDelegate, SecureBackupSetupCoordinatorBridgePresenterDelegate*/>
@interface LegacyAppDelegate () <GDPRConsentViewControllerDelegate, KeyVerificationCoordinatorBridgePresenterDelegate, PushNotificationServiceDelegate, SetPinCoordinatorBridgePresenterDelegate, CallPresenterDelegate/*, SpaceDetailPresenterDelegate, SecureBackupSetupCoordinatorBridgePresenterDelegate*/>
{
/**
Reachability observer
Expand Down Expand Up @@ -485,9 +485,8 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(

self.localAuthenticationService = [[LocalAuthenticationService alloc] initWithPinCodePreferences:[PinCodePreferences shared]];

// Tchap: Disable Calls
// self.callPresenter = [[CallPresenter alloc] init];
// self.callPresenter.delegate = self;
self.callPresenter = [[CallPresenter alloc] init];
self.callPresenter.delegate = self;

self.pushNotificationStore = [PushNotificationStore new];
self.pushNotificationService = [[PushNotificationService alloc] initWithPushNotificationStore:self.pushNotificationStore];
Expand Down Expand Up @@ -1982,8 +1981,7 @@ - (void)initMatrixSessions
else if (mxSession.state == MXSessionStateStoreDataReady)
{
// start the call service
// Tchap: Disable Calls
// [self.callPresenter start];
[self.callPresenter start];

// Register to user new device sign in notification
[self registerUserDidSignInOnNewDeviceNotificationForSession:mxSession];
Expand Down Expand Up @@ -2157,8 +2155,7 @@ - (void)addMatrixSession:(MXSession *)mxSession
[[WidgetManager sharedManager] addMatrixSession:mxSession];

// register the session to the call service
// Tchap: Disable Calls
// [_callPresenter addMatrixSession:mxSession];
[_callPresenter addMatrixSession:mxSession];

// Tchap: Disable UISI
// register the session to the uisi auto-reporter
Expand All @@ -2182,8 +2179,7 @@ - (void)removeMatrixSession:(MXSession*)mxSession
[[MXKContactManager sharedManager] removeMatrixSession:mxSession];

// remove session from the call service
// Tchap: Disable Calls
// [_callPresenter removeMatrixSession:mxSession];
[_callPresenter removeMatrixSession:mxSession];

// register the session to the uisi auto-reporter
// Tchap: Disable UISI
Expand All @@ -2207,8 +2203,7 @@ - (void)removeMatrixSession:(MXSession*)mxSession
if (!mxSessionArray.count)
{
// if no session left, stop the call service
// Tchap: Disable Calls
// [self.callPresenter stop];
[self.callPresenter stop];
}

[self.delegate legacyAppDelegate:self didRemoveMatrixSession:mxSession];
Expand Down
Loading

0 comments on commit 439b276

Please sign in to comment.