From 1b82a5a49de91bbd3b765d2169f0e6082b29d0c1 Mon Sep 17 00:00:00 2001 From: Bozhko Terziev Date: Tue, 14 Aug 2018 18:28:33 +0300 Subject: [PATCH] Fixes NY- 2254 --- Nynja.xcodeproj/project.pbxproj | 28 --------------- .../AddParticipantsInteractor.swift | 10 +++--- .../Call/CallInProgressProtocols.swift | 7 ---- .../Interactor/CallInProgressInteractor.swift | 3 +- .../Presenter/CallInProgressPresenter.swift | 25 ------------- .../CallInProgressNavigationController.swift | 35 ------------------- .../View/CallInProgressViewController.swift | 20 ----------- 7 files changed, 7 insertions(+), 121 deletions(-) delete mode 100644 Nynja/Modules/Call/CallScreens/CallInProgress/View/CallInProgressNavigationController.swift diff --git a/Nynja.xcodeproj/project.pbxproj b/Nynja.xcodeproj/project.pbxproj index f66a59051..7c9f21b83 100644 --- a/Nynja.xcodeproj/project.pbxproj +++ b/Nynja.xcodeproj/project.pbxproj @@ -1002,7 +1002,6 @@ 99B9D27D2F0EFE051E6581ED /* CreateGroupProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDE9DC6ADA0E71241C49A328 /* CreateGroupProtocols.swift */; }; 9BC9657620FF042E00052AE1 /* CallInProgressProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BC9657520FF042D00052AE1 /* CallInProgressProtocols.swift */; }; 9BD8E3F120EF7898001384EC /* CallInProgressViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BD8E3EF20EF7898001384EC /* CallInProgressViewController.swift */; }; - 9BD8E3F820EF8874001384EC /* CallInProgressNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BD8E3F720EF8874001384EC /* CallInProgressNavigationController.swift */; }; 9BD8E40720F3576F001384EC /* CallInProgressWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BD8E40620F3576F001384EC /* CallInProgressWireframe.swift */; }; 9BD8E41120F39AE3001384EC /* CallInProgressPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BD8E41020F39AE3001384EC /* CallInProgressPresenter.swift */; }; 9BD8E41320F3A2E2001384EC /* CallInProgressInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BD8E41220F3A2E2001384EC /* CallInProgressInteractor.swift */; }; @@ -3013,7 +3012,6 @@ 9B810991D7143259040DCA31 /* LanguageSettingsViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = LanguageSettingsViewController.swift; sourceTree = ""; }; 9BC9657520FF042D00052AE1 /* CallInProgressProtocols.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CallInProgressProtocols.swift; sourceTree = ""; }; 9BD8E3EF20EF7898001384EC /* CallInProgressViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CallInProgressViewController.swift; sourceTree = ""; }; - 9BD8E3F720EF8874001384EC /* CallInProgressNavigationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CallInProgressNavigationController.swift; sourceTree = ""; }; 9BD8E40620F3576F001384EC /* CallInProgressWireframe.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CallInProgressWireframe.swift; sourceTree = ""; }; 9BD8E41020F39AE3001384EC /* CallInProgressPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CallInProgressPresenter.swift; sourceTree = ""; }; 9BD8E41220F3A2E2001384EC /* CallInProgressInteractor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CallInProgressInteractor.swift; sourceTree = ""; }; @@ -8432,7 +8430,6 @@ 9BD8E3FE20F354A7001384EC /* View */ = { isa = PBXGroup; children = ( - 9BD8E3F720EF8874001384EC /* CallInProgressNavigationController.swift */, 9BD8E3EF20EF7898001384EC /* CallInProgressViewController.swift */, ); path = View; @@ -8486,13 +8483,6 @@ path = WireFrame; sourceTree = ""; }; - A33FA59FE338E9660AB10CD1 /* Presenter */ = { - isa = PBXGroup; - children = ( - ); - path = Presenter; - sourceTree = ""; - }; A402A1C720DE68C0005BFA20 /* TopSwipable */ = { isa = PBXGroup; children = ( @@ -9882,13 +9872,6 @@ path = States; sourceTree = ""; }; - A4D0787972A19641165C28B6 /* WireFrame */ = { - isa = PBXGroup; - children = ( - ); - path = WireFrame; - sourceTree = ""; - }; A4ED79AE20C803E800A41F67 /* DataSource */ = { isa = PBXGroup; children = ( @@ -10319,9 +10302,6 @@ 5BC1D38320D3B670002A44B3 /* CallCreatorMediator.swift */, 9BC9657520FF042D00052AE1 /* CallInProgressProtocols.swift */, A895793051E246613AC4F30F /* View */, - A33FA59FE338E9660AB10CD1 /* Presenter */, - D6365C3D94F0150AFA59F586 /* Interactor */, - A4D0787972A19641165C28B6 /* WireFrame */, ); path = Call; sourceTree = ""; @@ -10579,13 +10559,6 @@ path = Interactor; sourceTree = ""; }; - D6365C3D94F0150AFA59F586 /* Interactor */ = { - isa = PBXGroup; - children = ( - ); - path = Interactor; - sourceTree = ""; - }; D6ABBEEBA2D71463B8110D50 /* WebView */ = { isa = PBXGroup; children = ( @@ -13942,7 +13915,6 @@ 268C341721074AD000F1472A /* TranscribeLongAudioProccessingOperation.swift in Sources */, 85018419204946C900F324A1 /* ThemeCollectionViewCell.swift in Sources */, A45F112120B4218D00F45004 /* InfoDateView.swift in Sources */, - 9BD8E3F820EF8874001384EC /* CallInProgressNavigationController.swift in Sources */, A4688DFA20650FF50013660D /* DBObserver.swift in Sources */, 263409342119CFE2002F8D8F /* RecordContainer.swift in Sources */, 853FB0682049B193000996C5 /* SupportProtocols.swift in Sources */, diff --git a/Nynja/Modules/AddParticipants/Interactor/AddParticipantsInteractor.swift b/Nynja/Modules/AddParticipants/Interactor/AddParticipantsInteractor.swift index cf58a6a04..c38d8579c 100644 --- a/Nynja/Modules/AddParticipants/Interactor/AddParticipantsInteractor.swift +++ b/Nynja/Modules/AddParticipants/Interactor/AddParticipantsInteractor.swift @@ -13,12 +13,14 @@ class AddParticipantsInteractor: BaseInteractor, AddParticipantsInteractorInputP var selectedContacts: [Contact]? var members: [Member]? var room: Room? - + var participants: [Participant] = [] var participantsMode: ParticipantsModeType private let localId = IdBuilder(format: .defaultId).build() + private let storageService = StorageService.sharedInstance + private let mqttService = MQTTService.sharedInstance required init(mode: ParticipantsModeType) { self.participantsMode = mode @@ -39,7 +41,7 @@ class AddParticipantsInteractor: BaseInteractor, AddParticipantsInteractorInputP } func getMySelf() -> Contact? { - guard let id = StorageService.sharedInstance.rosterId, let roster = RosterDAO.findRosterBy(id: id) else { return nil } + guard let id = storageService.rosterId, let roster = RosterDAO.findRosterBy(id: id) else { return nil } return roster.myContact } @@ -53,7 +55,7 @@ class AddParticipantsInteractor: BaseInteractor, AddParticipantsInteractorInputP } func sendRoom(with name: String, avatar: String?, members: [Member]) { - MQTTService.sharedInstance.createRoom(id: localId, name: name, avatar: avatar, members: members) + mqttService.createRoom(id: localId, name: name, avatar: avatar, members: members) } //MARK: - AddParticipantsInteractorInputProtocol @@ -109,7 +111,7 @@ class AddParticipantsInteractor: BaseInteractor, AddParticipantsInteractorInputP private func makeParticipant(with contact: Contact) -> Participant { let participant = Participant(contact: contact) participant.alias = members?.first(where: { $0.phone_id == contact.phone_id })?.alias - participant.isEnable = contact.phoneId != StorageService.sharedInstance.phoneId + participant.isEnable = contact.phoneId != storageService.phoneId participant.isSelected = (selectedContacts?.contains(where: { (contact) -> Bool in return contact.phoneId == participant.contact.phoneId })) ?? false diff --git a/Nynja/Modules/Call/CallInProgressProtocols.swift b/Nynja/Modules/Call/CallInProgressProtocols.swift index 28a07f462..6490a88af 100644 --- a/Nynja/Modules/Call/CallInProgressProtocols.swift +++ b/Nynja/Modules/Call/CallInProgressProtocols.swift @@ -31,11 +31,8 @@ protocol CallInProgressViewProtocol: class { */ func setupUI() func updateTime(text: String) - func remoteVideoStreamStopped() func changeUIToIncall() func update(participants: [NYNCallParticipant]) - func updateCallBy(status: CallStatus) - func callFailed() func askEndOrLeave() func didAddRemoteVideoStream() func didStartLocalCapturer() @@ -65,7 +62,6 @@ protocol CallInProgressPresenterProtocol: class { func toggleMicrophone() func isMuted()->Bool func switchCamera() - func viewShowed() func rejectCall() func updateCallParticipants() func showMenuWith(groupCollectionCell: GroupCollectionViewCell) @@ -89,7 +85,6 @@ protocol CallInProgressInteractorOutputProtocol: class { func remoteVideoStreamStopped() func updateTime(text: String) func update(participants: [NYNCallParticipant]) - func callFailed() func askEndOrLeave() func didAddRemoteVideoStream() func didStartLocalCapturer() @@ -124,6 +119,4 @@ protocol CallInProgressInteractorInputProtocol: class { protocol ManageCallInProgressParticipantsProtocol: class { func remove(participant: NYNCallParticipant?) - func mute(participant: NYNCallParticipant?) - func unmute(participant: NYNCallParticipant?) } diff --git a/Nynja/Modules/Call/CallScreens/CallInProgress/Interactor/CallInProgressInteractor.swift b/Nynja/Modules/Call/CallScreens/CallInProgress/Interactor/CallInProgressInteractor.swift index 31ec6174b..1eb2e7828 100644 --- a/Nynja/Modules/Call/CallScreens/CallInProgress/Interactor/CallInProgressInteractor.swift +++ b/Nynja/Modules/Call/CallScreens/CallInProgress/Interactor/CallInProgressInteractor.swift @@ -11,8 +11,8 @@ class CallInProgressInteractor: CallInProgressInteractorInputProtocol, NynjaCall weak var presenter: CallInProgressInteractorOutputProtocol! - var callService = NynjaCommunicatorService.sharedInstance var timer: Timer? + private let callService = NynjaCommunicatorService.sharedInstance init() { callService.callDelegate = self @@ -236,7 +236,6 @@ class CallInProgressInteractor: CallInProgressInteractorInputProtocol, NynjaCall self.startTimer() break case NYNCallState.failed: - self.presenter.callFailed() break case NYNCallState.disconnected: break diff --git a/Nynja/Modules/Call/CallScreens/CallInProgress/Presenter/CallInProgressPresenter.swift b/Nynja/Modules/Call/CallScreens/CallInProgress/Presenter/CallInProgressPresenter.swift index 8f9b6b1d1..82886b850 100644 --- a/Nynja/Modules/Call/CallScreens/CallInProgress/Presenter/CallInProgressPresenter.swift +++ b/Nynja/Modules/Call/CallScreens/CallInProgress/Presenter/CallInProgressPresenter.swift @@ -89,13 +89,6 @@ class CallInProgressPresenter: CallInProgressPresenterProtocol, CallInProgressIn } else { self.view.setupUI() } - - self.view.updateCallBy(status:.callInProgress) - } - - func callFailed() { - - self.view.callFailed() } func askEndOrLeave() { @@ -127,27 +120,21 @@ class CallInProgressPresenter: CallInProgressPresenterProtocol, CallInProgressIn } func remoteVideoStreamStopped() { - //self.view.remoteVideoStreamStopped() self.view.setupUI() - self.view.updateCallBy(status:.callInProgress) } - func setRingingWithoutVideo() { self.view.setupUI() - self.view.updateCallBy(status:.callStarting) } func setRingingStatus() { self.view.setupUI() - self.view.updateCallBy(status:.callOutgoingAudio) } func willShow() { self.view.setupUI() } - func updateTime(text: String) { self.view.updateTime(text: text) } @@ -157,9 +144,6 @@ class CallInProgressPresenter: CallInProgressPresenterProtocol, CallInProgressIn self.view.update(participants: participants) } - func viewShowed() { - } - // MARK: EditParticpantsDelegate func updateGroupCall(contacts: [Contact]) { @@ -186,13 +170,4 @@ class CallInProgressPresenter: CallInProgressPresenterProtocol, CallInProgressIn func remove(participant: NYNCallParticipant?) { interactor.removeCallMember(memberId: (participant?.memberId)!) } - - func mute(participant: NYNCallParticipant?) { - - } - - func unmute(participant: NYNCallParticipant?) { - - } - } diff --git a/Nynja/Modules/Call/CallScreens/CallInProgress/View/CallInProgressNavigationController.swift b/Nynja/Modules/Call/CallScreens/CallInProgress/View/CallInProgressNavigationController.swift deleted file mode 100644 index a3599bbac..000000000 --- a/Nynja/Modules/Call/CallScreens/CallInProgress/View/CallInProgressNavigationController.swift +++ /dev/null @@ -1,35 +0,0 @@ -// -// CallInProgressNavigationController.swift -// Nynja -// -// Created by Bozhko Terziev on 6.07.18. -// Copyright © 2018 TecSynt Solutions. All rights reserved. -// - -import UIKit - -class CallInProgressNavigationController: UINavigationController { - - override func viewDidLoad() { - super.viewDidLoad() - - // Do any additional setup after loading the view. - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - // Dispose of any resources that can be recreated. - } - - - /* - // MARK: - Navigation - - // In a storyboard-based application, you will often want to do a little preparation before navigation - override func prepare(for segue: UIStoryboardSegue, sender: Any?) { - // Get the new view controller using segue.destinationViewController. - // Pass the selected object to the new view controller. - } - */ - -} diff --git a/Nynja/Modules/Call/CallScreens/CallInProgress/View/CallInProgressViewController.swift b/Nynja/Modules/Call/CallScreens/CallInProgress/View/CallInProgressViewController.swift index 1688f4407..fb58cfb88 100644 --- a/Nynja/Modules/Call/CallScreens/CallInProgress/View/CallInProgressViewController.swift +++ b/Nynja/Modules/Call/CallScreens/CallInProgress/View/CallInProgressViewController.swift @@ -166,7 +166,6 @@ class CallInProgressViewController: BaseVC, CallInProgressViewProtocol, BottomCa return btn }() - lazy var collectionView: UICollectionView = { let layout = UICollectionViewFlowLayout() layout.scrollDirection = .vertical @@ -629,22 +628,6 @@ class CallInProgressViewController: BaseVC, CallInProgressViewProtocol, BottomCa updateTitle() } - func updateCallBy(status: CallStatus) { - - } - - func callFailed() { - } - - func remoteVideoStreamStopped() { - -// backgtoundVideoImage.isHidden = false -// backgtoundVideoImage.image = backgtoundImage.image -// -// partnerVideoView.isHidden = true - } - - @objc func resizeButtonAction() { presenter.messageAcion(with: roomId, isVideo: true) } @@ -654,8 +637,6 @@ class CallInProgressViewController: BaseVC, CallInProgressViewProtocol, BottomCa // Note: need to prevent weird animation which appears when incoming/outcoming call appears. self.view.layoutIfNeeded() - - self.presenter.viewShowed() if self.needLocalRenderer { self.didStartLocalCapturer() @@ -831,7 +812,6 @@ class CallInProgressViewController: BaseVC, CallInProgressViewProtocol, BottomCa func changeUIToIncall() { - self.updateCallBy(status: .callInProgress) self.setupUI() } -- GitLab