From f41a236d1b4a5304b81cec1dd419ea60c6b1306b Mon Sep 17 00:00:00 2001 From: QuentinArguillere Date: Thu, 10 Oct 2024 11:51:32 +0200 Subject: [PATCH] Remove debug traces, fixe indent --- .../ViewModel/ConversationViewModel.swift | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/Linphone/UI/Main/Conversations/ViewModel/ConversationViewModel.swift b/Linphone/UI/Main/Conversations/ViewModel/ConversationViewModel.swift index 99d01de51..940b0b95e 100644 --- a/Linphone/UI/Main/Conversations/ViewModel/ConversationViewModel.swift +++ b/Linphone/UI/Main/Conversations/ViewModel/ConversationViewModel.swift @@ -151,8 +151,8 @@ class ConversationViewModel: ObservableObject { } self.coreContext.doOnCoreQueue { _ in - let chatMessageDelegate = ChatMessageDelegateStub(onMsgStateChanged: { (message: ChatMessage, _: ChatMessage.State) in - var statusTmp: Message.Status? = .sending + let chatMessageDelegate = ChatMessageDelegateStub(onMsgStateChanged: { (message: ChatMessage, msgState: ChatMessage.State) in + var statusTmp: Message.Status? switch message.state { case .InProgress: statusTmp = .sending @@ -290,7 +290,7 @@ class ConversationViewModel: ObservableObject { } } - func getMessages() { + func getMessages() { self.getHistorySize() self.getUnreadMessagesCount() self.getParticipantConversationModel() @@ -1405,13 +1405,10 @@ class ConversationViewModel: ObservableObject { if self.displayedConversation != nil { CoreContext.shared.doOnCoreQueue { _ in - Log.info("debugtrace -- resetDisplayedChatRoom -- eventLogFirst") let eventLogFirst = self.displayedConversation!.chatRoom.findEventLog(messageId: self.conversationMessagesSection[0].rows.first!.eventModel.eventLog.chatMessage!.messageId) - Log.info("debugtrace -- resetDisplayedChatRoom -- eventLogLast") let eventLogLast = self.displayedConversation!.chatRoom.getHistoryRangeEvents(begin: 0, end: 1).first - Log.info("debugtrace -- resetDisplayedChatRoom -- eventLogList") var eventLogList = self.displayedConversation!.chatRoom.getHistoryRangeBetween( firstEvent: eventLogFirst, lastEvent: eventLogLast, @@ -1419,16 +1416,12 @@ class ConversationViewModel: ObservableObject { ) if eventLogLast != nil { - Log.info("debugtrace -- resetDisplayedChatRoom -- eventLogList.append(eventLogLast!)") eventLogList.append(eventLogLast!) if !eventLogList.isEmpty && (self.conversationMessagesSection[0].rows.first?.eventModel.eventLog.chatMessage?.messageId != eventLogLast!.chatMessage?.messageId) { - - Log.info("debugtrace -- resetDisplayedChatRoom -- getNewMessage") self.getNewMessages(eventLogs: eventLogList) } } - Log.info("debugtrace -- addConversationDelegate -- eventLogList.append(eventLogLast!)") self.addConversationDelegate() } } @@ -1476,7 +1469,7 @@ class ConversationViewModel: ObservableObject { } let urlName = pathThumbnail == nil - ? URL(string: "file://" + ? URL(string: "file://" + FileUtil.sharedContainerUrl().appendingPathComponent("Library/Images").absoluteString + "preview_" + (name.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed) ?? "") @@ -2040,7 +2033,7 @@ class AudioRecorder: NSObject, ObservableObject { } } } - + func stopVoiceRecorder() { if linphoneAudioRecorder.state == .Running { Log.info("[ConversationViewModel] [AudioRecorder] Closing voice recorder") @@ -2113,10 +2106,10 @@ class AudioRecorder: NSObject, ObservableObject { } } } - + Log.info("Found headset/headphones/hearingAid sound card [\(String(describing: headsetCard))], " + "bluetooth sound card [\(String(describing: bluetoothCard))] and microphone card [\(String(describing: microphoneCard))]") - + return headsetCard ?? bluetoothCard ?? microphoneCard } }