@@ -14,20 +14,20 @@ final class CallsRepository: NSObject, CallsRepositoryProtocol {
14
14
private var call : MEGAChatCall ?
15
15
16
16
func startListeningForCallInChat( _ chatId: MEGAHandle , callbacksDelegate: CallsCallbacksRepositoryProtocol ) {
17
- if let call = chatSdk? . chatCall ( forChatId: chatId) {
17
+ if let call = chatSdk. chatCall ( forChatId: chatId) {
18
18
self . call = call
19
19
self . callId = call. callId
20
20
}
21
21
22
- chatSdk? . add ( self )
22
+ chatSdk. add ( self )
23
23
self . callbacksDelegate = callbacksDelegate
24
24
}
25
25
26
26
func answerIncomingCall( for chatId: MEGAHandle , completion: @escaping ( Result < MEGAChatCall , CallsErrorEntity > ) -> Void ) {
27
- if chatSdk? . chatConnectionState ( chatId) == . online {
28
- chatSdk? . answerChatCall ( chatId, enableVideo: false , delegate: MEGAChatAnswerCallRequestDelegate ( completion: { [ weak self] ( error) in
27
+ if chatSdk. chatConnectionState ( chatId) == . online {
28
+ chatSdk. answerChatCall ( chatId, enableVideo: false , delegate: MEGAChatAnswerCallRequestDelegate ( completion: { [ weak self] ( error) in
29
29
if error? . type == . MEGAChatErrorTypeOk {
30
- guard let call = self ? . chatSdk? . chatCall ( forChatId: chatId) else {
30
+ guard let call = self ? . chatSdk. chatCall ( forChatId: chatId) else {
31
31
completion ( . failure( . generic) )
32
32
return
33
33
}
@@ -49,9 +49,9 @@ final class CallsRepository: NSObject, CallsRepositoryProtocol {
49
49
}
50
50
51
51
func startChatCall( for chatId: MEGAHandle , withVideo enableVideo: Bool , completion: @escaping ( Result < MEGAChatCall , CallsErrorEntity > ) -> Void ) {
52
- chatSdk? . startChatCall ( chatId, enableVideo: enableVideo, delegate: MEGAChatStartCallRequestDelegate ( completion: { [ weak self] ( error) in
52
+ chatSdk. startChatCall ( chatId, enableVideo: enableVideo, delegate: MEGAChatStartCallRequestDelegate ( completion: { [ weak self] ( error) in
53
53
if error? . type == . MEGAChatErrorTypeOk {
54
- guard let call = self ? . chatSdk? . chatCall ( forChatId: chatId) else {
54
+ guard let call = self ? . chatSdk. chatCall ( forChatId: chatId) else {
55
55
completion ( . failure( . generic) )
56
56
return
57
57
}
@@ -70,7 +70,7 @@ final class CallsRepository: NSObject, CallsRepositoryProtocol {
70
70
}
71
71
72
72
func joinActiveCall( for chatId: MEGAHandle , withVideo enableVideo: Bool , completion: @escaping ( Result < MEGAChatCall , CallsErrorEntity > ) -> Void ) {
73
- guard let activeCall = chatSdk? . chatCall ( forChatId: chatId) else {
73
+ guard let activeCall = chatSdk. chatCall ( forChatId: chatId) else {
74
74
completion ( . failure( . generic) )
75
75
return
76
76
}
@@ -84,9 +84,9 @@ final class CallsRepository: NSObject, CallsRepositoryProtocol {
84
84
}
85
85
86
86
func enableLocalVideo( for chatId: MEGAHandle , delegate: MEGAChatVideoDelegate , completion: @escaping ( Result < Void , CallsErrorEntity > ) -> Void ) {
87
- chatSdk? . enableVideo ( forChat: chatId, delegate: MEGAChatEnableDisableVideoRequestDelegate ( completion: { [ weak self] ( error) in
87
+ chatSdk. enableVideo ( forChat: chatId, delegate: MEGAChatEnableDisableVideoRequestDelegate ( completion: { [ weak self] ( error) in
88
88
if error? . type == . MEGAChatErrorTypeOk {
89
- self ? . chatSdk? . addChatLocalVideo ( chatId, delegate: delegate)
89
+ self ? . chatSdk. addChatLocalVideo ( chatId, delegate: delegate)
90
90
completion ( . success)
91
91
} else {
92
92
completion ( . failure( . chatLocalVideoNotEnabled) )
@@ -95,9 +95,9 @@ final class CallsRepository: NSObject, CallsRepositoryProtocol {
95
95
}
96
96
97
97
func disableLocalVideo( for chatId: MEGAHandle , delegate: MEGAChatVideoDelegate , completion: @escaping ( Result < Void , CallsErrorEntity > ) -> Void ) {
98
- chatSdk? . disableVideo ( forChat: chatId, delegate: MEGAChatEnableDisableVideoRequestDelegate ( completion: { [ weak self] ( error) in
98
+ chatSdk. disableVideo ( forChat: chatId, delegate: MEGAChatEnableDisableVideoRequestDelegate ( completion: { [ weak self] ( error) in
99
99
if error? . type == . MEGAChatErrorTypeOk {
100
- self ? . chatSdk? . addChatLocalVideo ( chatId, delegate: delegate)
100
+ self ? . chatSdk. addChatLocalVideo ( chatId, delegate: delegate)
101
101
completion ( . success)
102
102
} else {
103
103
completion ( . failure( . chatLocalVideoNotDisabled) )
0 commit comments