Disable video calls when core.videoEnabled is false

This commit is contained in:
Benoit Martins 2025-12-18 10:42:28 +01:00
parent 4feae7fccd
commit 4c45a9bb1e
7 changed files with 121 additions and 100 deletions

View file

@ -2,6 +2,6 @@ import Foundation
public enum AppGitInfo { public enum AppGitInfo {
public static let branch = "master" public static let branch = "master"
public static let commit = "1501dae01" public static let commit = "4feae7fcc"
public static let tag = "6.1.0-alpha" public static let tag = "6.1.0-alpha"
} }

View file

@ -1956,6 +1956,7 @@ struct CallView: View {
Spacer() Spacer()
if !SharedMainViewModel.shared.disableVideoCall {
ZStack { ZStack {
Button { Button {
if optionsChangeLayout == 3 { if optionsChangeLayout == 3 {
@ -1986,6 +1987,7 @@ struct CallView: View {
} }
} }
.frame(width: buttonSize, height: buttonSize) .frame(width: buttonSize, height: buttonSize)
}
Button { Button {
callViewModel.toggleMuteMicrophone() callViewModel.toggleMuteMicrophone()

View file

@ -266,6 +266,7 @@ struct MeetingWaitingRoomFragment: View {
HStack { HStack {
Spacer() Spacer()
if !SharedMainViewModel.shared.disableVideoCall {
Button { Button {
!meetingWaitingRoomViewModel.videoDisplayed !meetingWaitingRoomViewModel.videoDisplayed
? meetingWaitingRoomViewModel.enableVideoPreview() : meetingWaitingRoomViewModel.disableVideoPreview() ? meetingWaitingRoomViewModel.enableVideoPreview() : meetingWaitingRoomViewModel.disableVideoPreview()
@ -283,6 +284,7 @@ struct MeetingWaitingRoomFragment: View {
.background(Color.gray500) .background(Color.gray500)
.cornerRadius(40) .cornerRadius(40)
.padding(.horizontal, 5) .padding(.horizontal, 5)
}
Button { Button {
meetingWaitingRoomViewModel.toggleMuteMicrophone() meetingWaitingRoomViewModel.toggleMuteMicrophone()

View file

@ -225,6 +225,7 @@ struct ContactInnerFragment: View {
Spacer() Spacer()
if !SharedMainViewModel.shared.disableVideoCall {
Button(action: { Button(action: {
CoreContext.shared.doOnCoreQueue { core in CoreContext.shared.doOnCoreQueue { core in
if contactAvatarModel.addresses.count == 1 { if contactAvatarModel.addresses.count == 1 {
@ -265,6 +266,7 @@ struct ContactInnerFragment: View {
Spacer() Spacer()
} }
}
.padding(.top, 20) .padding(.top, 20)
.frame(maxWidth: .infinity) .frame(maxWidth: .infinity)
.background(Color.gray100) .background(Color.gray100)

View file

@ -284,6 +284,7 @@ struct HistoryContactFragment: View {
}) })
} }
if !SharedMainViewModel.shared.disableVideoCall {
Spacer() Spacer()
Button(action: { Button(action: {
@ -306,6 +307,7 @@ struct HistoryContactFragment: View {
.frame(minWidth: 80) .frame(minWidth: 80)
} }
}) })
}
} else { } else {
Button(action: { Button(action: {
withAnimation { withAnimation {

View file

@ -48,6 +48,7 @@ class SharedMainViewModel: ObservableObject {
@Published var missedCallsCount: Int = 0 @Published var missedCallsCount: Int = 0
@Published var cardDavFriendsListsCount: Int = 0 @Published var cardDavFriendsListsCount: Int = 0
@Published var disableVideoCall: Bool = false
@Published var disableChatFeature: Bool = false @Published var disableChatFeature: Bool = false
@Published var disableMeetingFeature: Bool = false @Published var disableMeetingFeature: Bool = false
@ -95,8 +96,9 @@ class SharedMainViewModel: ObservableObject {
} }
updateMissedCallsCount() updateMissedCallsCount()
updateUnreadMessagesCount() updateDisableVideoCall()
updateDisableChatFeature() updateDisableChatFeature()
updateUnreadMessagesCount()
updateDisableMeetingFeature() updateDisableMeetingFeature()
getCardDavFriendsListsCount() getCardDavFriendsListsCount()
@ -225,6 +227,16 @@ class SharedMainViewModel: ObservableObject {
} }
} }
func updateDisableVideoCall() {
CoreContext.shared.doOnCoreQueue { core in
let disableVideoCallFeatureTmp = !core.videoEnabled
DispatchQueue.main.async {
self.disableVideoCall = disableVideoCallFeatureTmp
}
}
}
func updateDisableChatFeature() { func updateDisableChatFeature() {
CoreContext.shared.doOnCoreQueue { core in CoreContext.shared.doOnCoreQueue { core in
let disableChatFeatureTmp = CorePreferences.disableChatFeature let disableChatFeatureTmp = CorePreferences.disableChatFeature
@ -246,6 +258,7 @@ class SharedMainViewModel: ObservableObject {
} }
func updateConfigChanges() { func updateConfigChanges() {
updateDisableVideoCall()
updateDisableChatFeature() updateDisableChatFeature()
updateDisableMeetingFeature() updateDisableMeetingFeature()
} }

View file

@ -123,7 +123,7 @@
"location" : "https://gitlab.linphone.org/BC/public/linphone-sdk-swift-ios.git", "location" : "https://gitlab.linphone.org/BC/public/linphone-sdk-swift-ios.git",
"state" : { "state" : {
"branch" : "alpha", "branch" : "alpha",
"revision" : "1e266452f9e464d8d6ea8359722d9038c5f46b9d" "revision" : "e82eb03f276a3c6f4b9b4d87ca7faff5f5d42b8a"
} }
}, },
{ {