Skip to content

Commit f096ed0

Browse files
committed
fix: compile error
1 parent fe5339d commit f096ed0

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

MEGAData/Repository/Calls/CallsRepository.swift

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@ final class CallsRepository: NSObject, CallsRepositoryProtocol {
1414
private var call: MEGAChatCall?
1515

1616
func startListeningForCallInChat(_ chatId: MEGAHandle, callbacksDelegate: CallsCallbacksRepositoryProtocol) {
17-
if let call = chatSdk?.chatCall(forChatId: chatId) {
17+
if let call = chatSdk.chatCall(forChatId: chatId) {
1818
self.call = call
1919
self.callId = call.callId
2020
}
2121

22-
chatSdk?.add(self)
22+
chatSdk.add(self)
2323
self.callbacksDelegate = callbacksDelegate
2424
}
2525

2626
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
2929
if error?.type == .MEGAChatErrorTypeOk {
30-
guard let call = self?.chatSdk?.chatCall(forChatId: chatId) else {
30+
guard let call = self?.chatSdk.chatCall(forChatId: chatId) else {
3131
completion(.failure(.generic))
3232
return
3333
}
@@ -49,9 +49,9 @@ final class CallsRepository: NSObject, CallsRepositoryProtocol {
4949
}
5050

5151
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
5353
if error?.type == .MEGAChatErrorTypeOk {
54-
guard let call = self?.chatSdk?.chatCall(forChatId: chatId) else {
54+
guard let call = self?.chatSdk.chatCall(forChatId: chatId) else {
5555
completion(.failure(.generic))
5656
return
5757
}
@@ -70,7 +70,7 @@ final class CallsRepository: NSObject, CallsRepositoryProtocol {
7070
}
7171

7272
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 {
7474
completion(.failure(.generic))
7575
return
7676
}
@@ -84,9 +84,9 @@ final class CallsRepository: NSObject, CallsRepositoryProtocol {
8484
}
8585

8686
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
8888
if error?.type == .MEGAChatErrorTypeOk {
89-
self?.chatSdk?.addChatLocalVideo(chatId, delegate: delegate)
89+
self?.chatSdk.addChatLocalVideo(chatId, delegate: delegate)
9090
completion(.success)
9191
} else {
9292
completion(.failure(.chatLocalVideoNotEnabled))
@@ -95,9 +95,9 @@ final class CallsRepository: NSObject, CallsRepositoryProtocol {
9595
}
9696

9797
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
9999
if error?.type == .MEGAChatErrorTypeOk {
100-
self?.chatSdk?.addChatLocalVideo(chatId, delegate: delegate)
100+
self?.chatSdk.addChatLocalVideo(chatId, delegate: delegate)
101101
completion(.success)
102102
} else {
103103
completion(.failure(.chatLocalVideoNotDisabled))

MEGAData/Repository/UserAttributes/UserAttributesRepository.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ final class UserAttributesRepository: NSObject, UserAttributesRepositoryProtocol
44
private let chatSdk = MEGASdkManager.sharedMEGAChatSdk()
55

66
func loadUserAttributes(in chatId: MEGAHandle, for userHandles: [NSNumber], completion: @escaping (Result<MEGAChatRoom, CallsErrorEntity>) -> Void) {
7-
chatSdk?.loadUserAttributes(forChatId: chatId, usersHandles: userHandles, delegate: MEGAChatGenericRequestDelegate(completion: { (request, error) in
7+
chatSdk.loadUserAttributes(forChatId: chatId, usersHandles: userHandles, delegate: MEGAChatGenericRequestDelegate(completion: { (request, error) in
88
if error.type == .MEGAChatErrorTypeOk {
9-
guard let chatRoom = self.chatSdk?.chatRoom(forChatId: chatId) else {
9+
guard let chatRoom = self.chatSdk.chatRoom(forChatId: chatId) else {
1010
completion(.failure(.generic))
1111
return
1212
}

iMEGA/CallScene/CallViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,12 @@ extension CallsViewController: UICollectionViewDataSource {
127127
if cell.videoImageView.isHidden {
128128
cell.videoImageView.isHidden = false
129129
//Confirm that re adding remote video doesn't crash
130-
MEGASdkManager.sharedMEGAChatSdk()?.addChatRemoteVideo(participant.chatId, peerId: participant.participantId, cliendId: participant.clientId, delegate: cell.videoImageView)
130+
MEGASdkManager.sharedMEGAChatSdk().addChatRemoteVideo(participant.chatId, peerId: participant.participantId, cliendId: participant.clientId, delegate: cell.videoImageView)
131131
cell.avatarImageView.isHidden = true
132132
}
133133
} else {
134134
if cell.avatarImageView.isHidden {
135-
MEGASdkManager.sharedMEGAChatSdk()?.removeChatRemoteVideo(participant.chatId, peerId: participant.participantId, cliendId: participant.clientId, delegate: cell.videoImageView)
135+
MEGASdkManager.sharedMEGAChatSdk().removeChatRemoteVideo(participant.chatId, peerId: participant.participantId, cliendId: participant.clientId, delegate: cell.videoImageView)
136136
cell.avatarImageView.isHidden = false
137137
cell.videoImageView.isHidden = true
138138
}

0 commit comments

Comments
 (0)