Skip to content

Commit

Permalink
#4656 - Stop recording voice message and go into locked mode when the…
Browse files Browse the repository at this point in the history
… application becomes inactive.
  • Loading branch information
stefanceriu committed Aug 4, 2021
1 parent 53442ab commit 1410334
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Riot/Modules/Room/VoiceMessages/VoiceMessageController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ public class VoiceMessageController: NSObject, VoiceMessageToolbarViewDelegate,
NotificationCenter.default.addObserver(self, selector: #selector(updateTheme), name: .themeServiceDidChangeTheme, object: nil)
updateTheme()

NotificationCenter.default.addObserver(self, selector: #selector(applicationWillResignActive), name: UIApplication.willResignActiveNotification, object: nil)

updateUI()
}

Expand Down Expand Up @@ -312,6 +314,10 @@ public class VoiceMessageController: NSObject, VoiceMessageToolbarViewDelegate,
_voiceMessageToolbarView.update(theme: themeService.theme)
}

@objc private func applicationWillResignActive() {
finishRecording()
}

@objc private func handleDisplayLinkTick() {
updateUI()
}
Expand Down

0 comments on commit 1410334

Please sign in to comment.