Merge pull request #332 from loki-project/voice-messages

Fix Voice Messages Issue
This commit is contained in:
Niels Andriesse 2021-01-12 13:45:59 +11:00 committed by GitHub
commit f3a4a22ed1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 9 deletions

View File

@ -65,9 +65,9 @@
<key>NSContactsUsageDescription</key>
<string>Signal uses your contacts to find users you know. We do not store your contacts on the server.</string>
<key>NSFaceIDUsageDescription</key>
<string>Session's Screen Lock feature uses Face ID.</string>
<string>Session&apos;s Screen Lock feature uses Face ID.</string>
<key>NSMicrophoneUsageDescription</key>
<string>Session needs access to your microphone to record videos.</string>
<string>Session needs access to your microphone to record media.</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Session needs access to your library to save photos.</string>
<key>NSPhotoLibraryUsageDescription</key>

View File

@ -2,7 +2,6 @@ import SessionUtilitiesKit
@objc(SNJobQueue)
public final class JobQueue : NSObject, JobDelegate {
private var hasResumedPendingJobs = false // Just for debugging
@objc public static let shared = JobQueue()
@ -21,12 +20,6 @@ public final class JobQueue : NSObject, JobDelegate {
}
@objc public func resumePendingJobs() {
if hasResumedPendingJobs {
#if DEBUG
preconditionFailure("resumePendingJobs() should only be called once.")
#endif
}
hasResumedPendingJobs = true
let allJobTypes: [Job.Type] = [ AttachmentDownloadJob.self, AttachmentUploadJob.self, MessageReceiveJob.self, MessageSendJob.self, NotifyPNServerJob.self ]
allJobTypes.forEach { type in
let allPendingJobs = SNMessagingKitConfiguration.shared.storage.getAllPendingJobs(of: type)

View File

@ -115,6 +115,8 @@ NS_ASSUME_NONNULL_BEGIN
self.delegate.audioPlaybackState = AudioPlaybackState_Playing;
[[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayback error: nil];
if (!self.audioPlayer) {
NSError *error;
self.audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:self.mediaUrl error:&error];