Make messages show up again

This commit is contained in:
Niels Andriesse 2020-11-17 16:23:13 +11:00 committed by nielsandriesse
parent f36f447bec
commit b030b5999b
129 changed files with 456 additions and 12950 deletions

View File

@ -3,7 +3,8 @@ import PromiseKit
extension Storage : SessionMessagingKitStorageProtocol {
// MARK: Signal Protocol
// MARK: - Signal Protocol
public func getOrGenerateRegistrationID(using transaction: Any) -> UInt32 {
SSKEnvironment.shared.tsAccountManager.getOrGenerateRegistrationId(transaction as! YapDatabaseReadWriteTransaction)
}
@ -18,7 +19,10 @@ extension Storage : SessionMessagingKitStorageProtocol {
return try! promise.wait()
}
// MARK: Shared Sender Keys
// MARK: - Shared Sender Keys
private static let closedGroupPrivateKeyCollection = "LokiClosedGroupPrivateKeyCollection"
public func getClosedGroupPrivateKey(for publicKey: String) -> String? {
@ -49,12 +53,28 @@ extension Storage : SessionMessagingKitStorageProtocol {
getUserClosedGroupPublicKeys().contains(publicKey)
}
// MARK: Jobs
public func persist(_ job: Job, using transaction: Any) { fatalError("Not implemented.") }
public func markJobAsSucceeded(_ job: Job, using transaction: Any) { fatalError("Not implemented.") }
public func markJobAsFailed(_ job: Job, using transaction: Any) { fatalError("Not implemented.") }
// MARK: Authorization
// MARK: - Jobs
private static let jobCollection = "SNJobCollection"
public func persist(_ job: Job, using transaction: Any) {
(transaction as! YapDatabaseReadWriteTransaction).setObject(job, forKey: job.id!, inCollection: Storage.jobCollection)
}
public func markJobAsSucceeded(_ job: Job, using transaction: Any) {
(transaction as! YapDatabaseReadWriteTransaction).removeObject(forKey: job.id!, inCollection: Storage.jobCollection)
}
public func markJobAsFailed(_ job: Job, using transaction: Any) {
(transaction as! YapDatabaseReadWriteTransaction).removeObject(forKey: job.id!, inCollection: Storage.jobCollection)
}
// MARK: - Authorization
private static func getAuthTokenCollection(for server: String) -> String {
return (server == FileServerAPI.server) ? "LokiStorageAuthTokenCollection" : "LokiGroupChatAuthTokenCollection"
}
@ -78,7 +98,10 @@ extension Storage : SessionMessagingKitStorageProtocol {
(transaction as! YapDatabaseReadWriteTransaction).removeObject(forKey: server, inCollection: collection)
}
// MARK: Open Group Public Keys
// MARK: - Open Group Public Keys
private static let openGroupPublicKeyCollection = "LokiOpenGroupPublicKeyCollection"
public func getOpenGroupPublicKey(for server: String) -> String? {
@ -93,7 +116,10 @@ extension Storage : SessionMessagingKitStorageProtocol {
(transaction as! YapDatabaseReadWriteTransaction).setObject(newValue, forKey: server, inCollection: Storage.openGroupPublicKeyCollection)
}
// MARK: Last Message Server ID
// MARK: - Last Message Server ID
private static let lastMessageServerIDCollection = "LokiGroupChatLastMessageServerIDCollection"
public func getLastMessageServerID(for group: UInt64, on server: String) -> UInt64? {
@ -112,7 +138,10 @@ extension Storage : SessionMessagingKitStorageProtocol {
(transaction as! YapDatabaseReadWriteTransaction).removeObject(forKey: "\(server).\(group)", inCollection: Storage.lastMessageServerIDCollection)
}
// MARK: Last Deletion Server ID
// MARK: - Last Deletion Server ID
private static let lastDeletionServerIDCollection = "LokiGroupChatLastDeletionServerIDCollection"
public func getLastDeletionServerID(for group: UInt64, on server: String) -> UInt64? {
@ -131,7 +160,10 @@ extension Storage : SessionMessagingKitStorageProtocol {
(transaction as! YapDatabaseReadWriteTransaction).removeObject(forKey: "\(server).\(group)", inCollection: Storage.lastDeletionServerIDCollection)
}
// MARK: Open Group Metadata
// MARK: - Open Group Metadata
private static let openGroupUserCountCollection = "LokiPublicChatUserCountCollection"
private static let openGroupMessageIDCollection = "LKMessageIDCollection"
@ -155,4 +187,53 @@ extension Storage : SessionMessagingKitStorageProtocol {
public func setLastProfilePictureUploadDate(_ date: Date) {
UserDefaults.standard[.lastProfilePictureUpload] = date
}
// MARK: - Message Handling
public func isBlocked(_ publicKey: String) -> Bool {
return SSKEnvironment.shared.blockingManager.isRecipientIdBlocked(publicKey)
}
public func updateProfile(for publicKey: String, from profile: VisibleMessage.Profile, using transaction: Any) {
// let transaction = transaction as! YapDatabaseReadWriteTransaction
// let profileManager = SSKEnvironment.shared.profileManager
// if let displayName = profile.displayName {
// profileManager.updateProfileForContact(withID: publicKey, displayName: displayName, with: transaction)
// }
// if let profileKey = profile.profileKey, let profilePictureURL = profile.profilePictureURL, profileKey.count == kAES256_KeyByteLength {
// profileManager.setProfileKeyData(profileKey, forRecipientId: publicKey, avatarURL: profilePictureURL)
// }
}
/// Returns the ID of the thread the message was stored under along with the `TSIncomingMessage` that was constructed.
public func persist(_ message: VisibleMessage, using transaction: Any) -> (String, Any) {
let transaction = transaction as! YapDatabaseReadWriteTransaction
let thread = TSContactThread.getOrCreateThread(withContactId: message.sender!, transaction: transaction)
let message = TSIncomingMessage.from(message, using: transaction)
message.save(with: transaction)
return (thread.uniqueId!, message)
}
public func cancelTypingIndicatorsIfNeeded(for threadID: String, senderPublicKey: String) {
guard let thread = TSThread.fetch(uniqueId: threadID) else { return }
func cancelTypingIndicatorsIfNeeded() {
SSKEnvironment.shared.typingIndicators.didReceiveIncomingMessage(inThread: thread, recipientId: senderPublicKey, deviceId: 1)
}
if Thread.current.isMainThread {
cancelTypingIndicatorsIfNeeded()
} else {
DispatchQueue.main.async {
cancelTypingIndicatorsIfNeeded()
}
}
}
public func notifyUserIfNeeded(for message: Any, threadID: String) {
guard let thread = TSThread.fetch(uniqueId: threadID) else { return }
Storage.read { transaction in
SSKEnvironment.shared.notificationsManager!.notifyUser(for: (message as! TSIncomingMessage), in: thread, transaction: transaction)
}
}
}

View File

@ -1,7 +1,8 @@
extension Storage : SessionSnodeKitStorageProtocol {
// MARK: Onion Request Paths
// MARK: - Onion Request Paths
private static let onionRequestPathCollection = "LokiOnionRequestPathCollection"
public func getOnionRequestPaths() -> [OnionRequestAPI.Path] {
@ -47,7 +48,10 @@ extension Storage : SessionSnodeKitStorageProtocol {
(transaction as! YapDatabaseReadWriteTransaction).removeAllObjects(inCollection: Storage.onionRequestPathCollection)
}
// MARK: Snode Pool
// MARK: - Snode Pool
public func getSnodePool() -> Set<Snode> {
var result: Set<Snode> = []
Storage.read { transaction in
@ -70,7 +74,10 @@ extension Storage : SessionSnodeKitStorageProtocol {
(transaction as! YapDatabaseReadWriteTransaction).removeAllObjects(inCollection: Storage.snodePoolCollection)
}
// MARK: Swarm
// MARK: - Swarm
public func getSwarm(for publicKey: String) -> Set<Snode> {
var result: Set<Snode> = []
let collection = Storage.getSwarmCollection(for: publicKey)
@ -96,7 +103,10 @@ extension Storage : SessionSnodeKitStorageProtocol {
(transaction as! YapDatabaseReadWriteTransaction).removeAllObjects(inCollection: collection)
}
// MARK: Last Message Hash
// MARK: - Last Message Hash
private static let lastMessageHashCollection = "LokiLastMessageHashCollection"
func getLastMessageHashInfo(for snode: Snode, associatedWith publicKey: String) -> JSON? {
@ -136,7 +146,10 @@ extension Storage : SessionSnodeKitStorageProtocol {
(transaction as! YapDatabaseReadWriteTransaction).removeObject(forKey: key, inCollection: Storage.lastMessageHashCollection)
}
// MARK: Received Messages
// MARK: - Received Messages
private static let receivedMessagesCollection = "LokiReceivedMessagesCollection"
public func getReceivedMessages(for publicKey: String) -> Set<String> {

View File

@ -16,10 +16,8 @@
#import "ConversationViewCell.h"
#import "ConversationViewItem.h"
#import "DateUtil.h"
#import "MediaDetailViewController.h"
#import "NotificationSettingsViewController.h"
#import "OWSAnyTouchGestureRecognizer.h"
#import "OWSAudioPlayer.h"
#import "OWSBackup.h"
@ -40,7 +38,6 @@
#import "OWSQRCodeScanningViewController.h"
#import "SignalApp.h"
#import "UIViewController+Permissions.h"
#import <SessionProtocolKit/NSData+keyVersionByte.h>
#import <PureLayout/PureLayout.h>
#import <Reachability/Reachability.h>
@ -54,8 +51,6 @@
#import <SignalUtilitiesKit/ContactTableViewCell.h>
#import <SignalUtilitiesKit/Environment.h>
#import <SignalUtilitiesKit/OWSAudioPlayer.h>
#import <SignalUtilitiesKit/OWSFormat.h>
#import <SignalUtilitiesKit/OWSPreferences.h>
#import <SignalUtilitiesKit/OWSProfileManager.h>
@ -74,14 +69,12 @@
#import <SignalUtilitiesKit/NSNotificationCenter+OWS.h>
#import <SignalUtilitiesKit/NSString+SSK.h>
#import <SignalUtilitiesKit/OWSBackgroundTask.h>
#import <SignalUtilitiesKit/OWSCallMessageHandler.h>
#import <SignalUtilitiesKit/OWSContactsOutputStream.h>
#import <SignalUtilitiesKit/OWSDispatch.h>
#import <SignalUtilitiesKit/OWSError.h>
#import <SignalUtilitiesKit/OWSFileSystem.h>
#import <SignalUtilitiesKit/OWSIdentityManager.h>
#import <SignalUtilitiesKit/OWSMediaGalleryFinder.h>
#import <SignalUtilitiesKit/OWSPrimaryStorage+Calling.h>
#import <SignalUtilitiesKit/OWSPrimaryStorage+SessionStore.h>
#import <SignalUtilitiesKit/OWSRecipientIdentity.h>
#import <SignalUtilitiesKit/SignalAccount.h>
@ -90,16 +83,13 @@
#import <SignalUtilitiesKit/TSAttachment.h>
#import <SignalUtilitiesKit/TSAttachmentPointer.h>
#import <SignalUtilitiesKit/TSAttachmentStream.h>
#import <SignalUtilitiesKit/TSCall.h>
#import <SignalUtilitiesKit/TSContactThread.h>
#import <SignalUtilitiesKit/TSErrorMessage.h>
#import <SignalUtilitiesKit/TSGroupThread.h>
#import <SignalUtilitiesKit/TSIncomingMessage.h>
#import <SignalUtilitiesKit/TSInfoMessage.h>
#import <SignalUtilitiesKit/TSOutgoingMessage.h>
#import <SignalUtilitiesKit/TSPreKeyManager.h>
#import <SignalUtilitiesKit/TSThread.h>
#import <SignalUtilitiesKit/LKGroupUtilities.h>
#import <SignalUtilitiesKit/UIImage+OWS.h>

View File

@ -23,17 +23,13 @@
#import <SignalUtilitiesKit/OWSDisappearingMessagesJob.h>
#import <SignalUtilitiesKit/OWSFailedAttachmentDownloadsJob.h>
#import <SignalUtilitiesKit/OWSFailedMessagesJob.h>
#import <SignalUtilitiesKit/OWSIncompleteCallsJob.h>
#import <SignalUtilitiesKit/OWSMath.h>
#import <SignalUtilitiesKit/OWSPrimaryStorage+Calling.h>
#import <SignalUtilitiesKit/OWSReadReceiptManager.h>
#import <SignalUtilitiesKit/SSKEnvironment.h>
#import <SignalUtilitiesKit/SignalUtilitiesKit-Swift.h>
#import <SignalUtilitiesKit/TSAccountManager.h>
#import <SignalUtilitiesKit/TSDatabaseView.h>
#import <SignalUtilitiesKit/TSPreKeyManager.h>
#import <YapDatabase/YapDatabaseCryptoUtils.h>
#import <sys/utsname.h>
@ -558,8 +554,7 @@ static NSTimeInterval launchStartedAt;
// TODO: or something like that in production.
[OWSOrphanDataCleaner auditOnLaunchIfNecessary];
#endif
[self.profileManager fetchLocalUsersProfile];
[self.readReceiptManager prepareCachedValues];
// Disable the SAE until the main app has successfully completed launch process

View File

@ -25,15 +25,6 @@ import SignalUtilitiesKit
}
}
@objc
public var callMessageHandler: WebRTCCallMessageHandler
// @objc
// public var callService: CallService
// @objc
// public var outboundCallInitiator: OutboundCallInitiator
@objc
public var accountManager: AccountManager
@ -77,7 +68,6 @@ import SignalUtilitiesKit
public var backupLazyRestore: BackupLazyRestore
private override init() {
self.callMessageHandler = WebRTCCallMessageHandler()
self.accountManager = AccountManager()
self.notificationPresenter = NotificationPresenter()
self.pushRegistrationManager = PushRegistrationManager()

View File

@ -1,549 +0,0 @@
////
//// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
////
//
//import Foundation
//import AVFoundation
//import SignalUtilitiesKit
//import SignalUtilitiesKit
//
//struct AudioSource: Hashable {
//
// let image: UIImage
// let localizedName: String
// let portDescription: AVAudioSessionPortDescription?
//
// // The built-in loud speaker / aka speakerphone
// let isBuiltInSpeaker: Bool
//
// // The built-in quiet speaker, aka the normal phone handset receiver earpiece
// let isBuiltInEarPiece: Bool
//
// init(localizedName: String, image: UIImage, isBuiltInSpeaker: Bool, isBuiltInEarPiece: Bool, portDescription: AVAudioSessionPortDescription? = nil) {
// self.localizedName = localizedName
// self.image = image
// self.isBuiltInSpeaker = isBuiltInSpeaker
// self.isBuiltInEarPiece = isBuiltInEarPiece
// self.portDescription = portDescription
// }
//
// init(portDescription: AVAudioSessionPortDescription) {
//
// let isBuiltInEarPiece = portDescription.portType == AVAudioSession.Port.builtInMic
//
// // portDescription.portName works well for BT linked devices, but if we are using
// // the built in mic, we have "iPhone Microphone" which is a little awkward.
// // In that case, instead we prefer just the model name e.g. "iPhone" or "iPad"
// let localizedName = isBuiltInEarPiece ? UIDevice.current.localizedModel : portDescription.portName
//
// self.init(localizedName: localizedName,
// image: #imageLiteral(resourceName: "button_phone_white"), // TODO
// isBuiltInSpeaker: false,
// isBuiltInEarPiece: isBuiltInEarPiece,
// portDescription: portDescription)
// }
//
// // Speakerphone is handled separately from the other audio routes as it doesn't appear as an "input"
// static var builtInSpeaker: AudioSource {
// return self.init(localizedName: NSLocalizedString("AUDIO_ROUTE_BUILT_IN_SPEAKER", comment: "action sheet button title to enable built in speaker during a call"),
// image: #imageLiteral(resourceName: "button_phone_white"), //TODO
// isBuiltInSpeaker: true,
// isBuiltInEarPiece: false)
// }
//
// // MARK: Hashable
//
// static func ==(lhs: AudioSource, rhs: AudioSource) -> Bool {
// // Simply comparing the `portDescription` vs the `portDescription.uid`
// // caused multiple instances of the built in mic to turn up in a set.
// if lhs.isBuiltInSpeaker && rhs.isBuiltInSpeaker {
// return true
// }
//
// if lhs.isBuiltInSpeaker || rhs.isBuiltInSpeaker {
// return false
// }
//
// guard let lhsPortDescription = lhs.portDescription else {
// owsFailDebug("only the built in speaker should lack a port description")
// return false
// }
//
// guard let rhsPortDescription = rhs.portDescription else {
// owsFailDebug("only the built in speaker should lack a port description")
// return false
// }
//
// return lhsPortDescription.uid == rhsPortDescription.uid
// }
//
// var hashValue: Int {
// guard let portDescription = self.portDescription else {
// assert(self.isBuiltInSpeaker)
// return "Built In Speaker".hashValue
// }
// return portDescription.uid.hash
// }
//}
//
//protocol CallAudioServiceDelegate: class {
// func callAudioService(_ callAudioService: CallAudioService, didUpdateIsSpeakerphoneEnabled isEnabled: Bool)
// func callAudioServiceDidChangeAudioSession(_ callAudioService: CallAudioService)
//}
//
//@objc class CallAudioService: NSObject, CallObserver {
//
// private var vibrateTimer: Timer?
// private let audioPlayer = AVAudioPlayer()
// private let handleRinging: Bool
// weak var delegate: CallAudioServiceDelegate? {
// willSet {
// assert(newValue == nil || delegate == nil)
// }
// }
//
// // MARK: Vibration config
// private let vibrateRepeatDuration = 1.6
//
// // Our ring buzz is a pair of vibrations.
// // `pulseDuration` is the small pause between the two vibrations in the pair.
// private let pulseDuration = 0.2
//
// var audioSession: OWSAudioSession {
// return Environment.shared.audioSession
// }
//
// var avAudioSession: AVAudioSession {
// return AVAudioSession.sharedInstance()
// }
//
// // MARK: - Initializers
//
// init(handleRinging: Bool) {
// self.handleRinging = handleRinging
//
// super.init()
//
// // We cannot assert singleton here, because this class gets rebuilt when the user changes relevant call settings
//
// // Configure audio session so we don't prompt user with Record permission until call is connected.
//
// audioSession.configureRTCAudio()
// NotificationCenter.default.addObserver(forName: AVAudioSession.routeChangeNotification, object: avAudioSession, queue: nil) { _ in
// assert(!Thread.isMainThread)
// self.updateIsSpeakerphoneEnabled()
// }
// }
//
// deinit {
// NotificationCenter.default.removeObserver(self)
// }
//
// // MARK: - CallObserver
//
// internal func stateDidChange(call: SignalCall, state: CallState) {
// AssertIsOnMainThread()
// self.handleState(call: call)
// }
//
// internal func muteDidChange(call: SignalCall, isMuted: Bool) {
// AssertIsOnMainThread()
//
// ensureProperAudioSession(call: call)
// }
//
// internal func holdDidChange(call: SignalCall, isOnHold: Bool) {
// AssertIsOnMainThread()
//
// ensureProperAudioSession(call: call)
// }
//
// internal func audioSourceDidChange(call: SignalCall, audioSource: AudioSource?) {
// AssertIsOnMainThread()
//
// ensureProperAudioSession(call: call)
//
// if let audioSource = audioSource, audioSource.isBuiltInSpeaker {
// self.isSpeakerphoneEnabled = true
// } else {
// self.isSpeakerphoneEnabled = false
// }
// }
//
// internal func hasLocalVideoDidChange(call: SignalCall, hasLocalVideo: Bool) {
// AssertIsOnMainThread()
//
// ensureProperAudioSession(call: call)
// }
//
// // Speakerphone can be manipulated by the in-app callscreen or via the system callscreen (CallKit).
// // Unlike other CallKit CallScreen buttons, enabling doesn't trigger a CXAction, so it's not as simple
// // to track state changes. Instead we never store the state and directly access the ground-truth in the
// // AVAudioSession.
// private(set) var isSpeakerphoneEnabled: Bool = false {
// didSet {
// self.delegate?.callAudioService(self, didUpdateIsSpeakerphoneEnabled: isSpeakerphoneEnabled)
// }
// }
//
// public func requestSpeakerphone(isEnabled: Bool) {
// // This is a little too slow to execute on the main thread and the results are not immediately available after execution
// // anyway, so we dispatch async. If you need to know the new value, you'll need to check isSpeakerphoneEnabled and take
// // advantage of the CallAudioServiceDelegate.callAudioService(_:didUpdateIsSpeakerphoneEnabled:)
// DispatchQueue.global().async {
// do {
// try self.avAudioSession.overrideOutputAudioPort( isEnabled ? .speaker : .none )
// } catch {
// owsFailDebug("failed to set \(#function) = \(isEnabled) with error: \(error)")
// }
// }
// }
//
// private func updateIsSpeakerphoneEnabled() {
// let value = avAudioSession.currentRoute.outputs.contains { (portDescription: AVAudioSessionPortDescription) -> Bool in
// return portDescription.portType == .builtInSpeaker
// }
// DispatchQueue.main.async {
// self.isSpeakerphoneEnabled = value
// }
// }
//
// private func ensureProperAudioSession(call: SignalCall?) {
// AssertIsOnMainThread()
//
// guard let call = call, !call.isTerminated else {
// // Revert to default audio
// setAudioSession(category: .soloAmbient,
// mode: .default)
// return
// }
//
// // Disallow bluetooth while (and only while) the user has explicitly chosen the built in receiver.
// //
// // NOTE: I'm actually not sure why this is required - it seems like we should just be able
// // to setPreferredInput to call.audioSource.portDescription in this case,
// // but in practice I'm seeing the call revert to the bluetooth headset.
// // Presumably something else (in WebRTC?) is touching our shared AudioSession. - mjk
// let options: AVAudioSession.CategoryOptions = call.audioSource?.isBuiltInEarPiece == true ? [] : [.allowBluetooth]
//
// if call.state == .localRinging {
// // SoloAmbient plays through speaker, but respects silent switch
// setAudioSession(category: .soloAmbient,
// mode: .default)
// } else if call.hasLocalVideo {
// // Because ModeVideoChat affects gain, we don't want to apply it until the call is connected.
// // otherwise sounds like ringing will be extra loud for video vs. speakerphone
//
// // Apple Docs say that setting mode to AVAudioSessionModeVideoChat has the
// // side effect of setting options: .allowBluetooth, when I remove the (seemingly unnecessary)
// // option, and inspect AVAudioSession.sharedInstance.categoryOptions == 0. And availableInputs
// // does not include my linked bluetooth device
// setAudioSession(category: .playAndRecord,
// mode: .videoChat,
// options: options)
// } else {
// // Apple Docs say that setting mode to AVAudioSessionModeVoiceChat has the
// // side effect of setting options: .allowBluetooth, when I remove the (seemingly unnecessary)
// // option, and inspect AVAudioSession.sharedInstance.categoryOptions == 0. And availableInputs
// // does not include my linked bluetooth device
// setAudioSession(category: .playAndRecord,
// mode: .voiceChat,
// options: options)
// }
//
// do {
// // It's important to set preferred input *after* ensuring properAudioSession
// // because some sources are only valid for certain category/option combinations.
// let existingPreferredInput = avAudioSession.preferredInput
// if existingPreferredInput != call.audioSource?.portDescription {
// Logger.info("changing preferred input: \(String(describing: existingPreferredInput)) -> \(String(describing: call.audioSource?.portDescription))")
// try avAudioSession.setPreferredInput(call.audioSource?.portDescription)
// }
//
// } catch {
// owsFailDebug("failed setting audio source with error: \(error) isSpeakerPhoneEnabled: \(call.isSpeakerphoneEnabled)")
// }
// }
//
// // MARK: - Service action handlers
//
// public func didUpdateVideoTracks(call: SignalCall?) {
// Logger.verbose("")
//
// self.ensureProperAudioSession(call: call)
// }
//
// public func handleState(call: SignalCall) {
// assert(Thread.isMainThread)
//
// Logger.verbose("new state: \(call.state)")
//
// // Stop playing sounds while switching audio session so we don't
// // get any blips across a temporary unintended route.
// stopPlayingAnySounds()
// self.ensureProperAudioSession(call: call)
//
// switch call.state {
// case .idle: handleIdle(call: call)
// case .dialing: handleDialing(call: call)
// case .answering: handleAnswering(call: call)
// case .remoteRinging: handleRemoteRinging(call: call)
// case .localRinging: handleLocalRinging(call: call)
// case .connected: handleConnected(call: call)
// case .reconnecting: handleReconnecting(call: call)
// case .localFailure: handleLocalFailure(call: call)
// case .localHangup: handleLocalHangup(call: call)
// case .remoteHangup: handleRemoteHangup(call: call)
// case .remoteBusy: handleBusy(call: call)
// }
// }
//
// private func handleIdle(call: SignalCall) {
// Logger.debug("")
// }
//
// private func handleDialing(call: SignalCall) {
// AssertIsOnMainThread()
// Logger.debug("")
//
// // HACK: Without this async, dialing sound only plays once. I don't really understand why. Does the audioSession
// // need some time to settle? Is somethign else interrupting our session?
// DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.2) {
// self.play(sound: OWSSound.callConnecting)
// }
// }
//
// private func handleAnswering(call: SignalCall) {
// AssertIsOnMainThread()
// Logger.debug("")
// }
//
// private func handleRemoteRinging(call: SignalCall) {
// AssertIsOnMainThread()
// Logger.debug("")
//
// self.play(sound: OWSSound.callOutboundRinging)
// }
//
// private func handleLocalRinging(call: SignalCall) {
// AssertIsOnMainThread()
// Logger.debug("")
//
// startRinging(call: call)
// }
//
// private func handleConnected(call: SignalCall) {
// AssertIsOnMainThread()
// Logger.debug("")
// }
//
// private func handleReconnecting(call: SignalCall) {
// AssertIsOnMainThread()
// Logger.debug("")
// }
//
// private func handleLocalFailure(call: SignalCall) {
// AssertIsOnMainThread()
// Logger.debug("")
//
// play(sound: OWSSound.callFailure)
// handleCallEnded(call: call)
// }
//
// private func handleLocalHangup(call: SignalCall) {
// AssertIsOnMainThread()
// Logger.debug("")
//
// handleCallEnded(call: call)
// }
//
// private func handleRemoteHangup(call: SignalCall) {
// AssertIsOnMainThread()
// Logger.debug("")
//
// vibrate()
//
// handleCallEnded(call: call)
// }
//
// private func handleBusy(call: SignalCall) {
// AssertIsOnMainThread()
// Logger.debug("")
//
// play(sound: OWSSound.callBusy)
//
// // Let the busy sound play for 4 seconds. The full file is longer than necessary
// DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 4.0) {
// self.handleCallEnded(call: call)
// }
// }
//
// private func handleCallEnded(call: SignalCall) {
// AssertIsOnMainThread()
// Logger.debug("")
//
// // Stop solo audio, revert to default.
// isSpeakerphoneEnabled = false
// setAudioSession(category: .soloAmbient)
// }
//
// // MARK: Playing Sounds
//
// var currentPlayer: OWSAudioPlayer?
//
// private func stopPlayingAnySounds() {
// currentPlayer?.stop()
// stopAnyRingingVibration()
// }
//
// private func play(sound: OWSSound) {
// guard let newPlayer = OWSSounds.audioPlayer(for: sound, audioBehavior: .call) else {
// owsFailDebug("unable to build player for sound: \(OWSSounds.displayName(for: sound))")
// return
// }
// Logger.info("playing sound: \(OWSSounds.displayName(for: sound))")
//
// // It's important to stop the current player **before** starting the new player. In the case that
// // we're playing the same sound, since the player is memoized on the sound instance, we'd otherwise
// // stop the sound we just started.
// self.currentPlayer?.stop()
// newPlayer.play()
// self.currentPlayer = newPlayer
// }
//
// // MARK: - Ringing
//
// private func startRinging(call: SignalCall) {
// guard handleRinging else {
// Logger.debug("ignoring \(#function) since CallKit handles it's own ringing state")
// return
// }
//
// vibrateTimer = WeakTimer.scheduledTimer(timeInterval: vibrateRepeatDuration, target: self, userInfo: nil, repeats: true) {[weak self] _ in
// self?.ringVibration()
// }
// vibrateTimer?.fire()
// play(sound: .defaultiOSIncomingRingtone)
// }
//
// private func stopAnyRingingVibration() {
// guard handleRinging else {
// Logger.debug("ignoring \(#function) since CallKit handles it's own ringing state")
// return
// }
// Logger.debug("")
//
// // Stop vibrating
// vibrateTimer?.invalidate()
// vibrateTimer = nil
// }
//
// // public so it can be called by timer via selector
// public func ringVibration() {
// // Since a call notification is more urgent than a message notifaction, we
// // vibrate twice, like a pulse, to differentiate from a normal notification vibration.
// vibrate()
// DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + pulseDuration) {
// self.vibrate()
// }
// }
//
// func vibrate() {
// // TODO implement HapticAdapter for iPhone7 and up
// AudioServicesPlaySystemSound(kSystemSoundID_Vibrate)
// }
//
// // MARK: - AudioSession MGMT
// // TODO move this to CallAudioSession?
//
// // Note this method is sensitive to the current audio session configuration.
// // Specifically if you call it while speakerphone is enabled you won't see
// // any connected bluetooth routes.
// var availableInputs: [AudioSource] {
// guard let availableInputs = avAudioSession.availableInputs else {
// // I'm not sure why this would happen, but it may indicate an error.
// owsFailDebug("No available inputs or inputs not ready")
// return [AudioSource.builtInSpeaker]
// }
//
// Logger.info("availableInputs: \(availableInputs)")
// return [AudioSource.builtInSpeaker] + availableInputs.map { portDescription in
// return AudioSource(portDescription: portDescription)
// }
// }
//
// func currentAudioSource(call: SignalCall) -> AudioSource? {
// if let audioSource = call.audioSource {
// return audioSource
// }
//
// // Before the user has specified an audio source on the call, we rely on the existing
// // system state to determine the current audio source.
// // If a bluetooth is connected, this will be bluetooth, otherwise
// // this will be the receiver.
// guard let portDescription = avAudioSession.currentRoute.inputs.first else {
// return nil
// }
//
// return AudioSource(portDescription: portDescription)
// }
//
// private func setAudioSession(category: AVAudioSession.Category,
// mode: AVAudioSession.Mode? = nil,
// options: AVAudioSession.CategoryOptions = AVAudioSession.CategoryOptions(rawValue: 0)) {
//
// AssertIsOnMainThread()
//
// var audioSessionChanged = false
// do {
// if #available(iOS 10.0, *), let mode = mode {
// let oldCategory = avAudioSession.category
// let oldMode = avAudioSession.mode
// let oldOptions = avAudioSession.categoryOptions
//
// guard oldCategory != category || oldMode != mode || oldOptions != options else {
// return
// }
//
// audioSessionChanged = true
//
// if oldCategory != category {
// Logger.debug("audio session changed category: \(oldCategory) -> \(category) ")
// }
// if oldMode != mode {
// Logger.debug("audio session changed mode: \(oldMode) -> \(mode) ")
// }
// if oldOptions != options {
// Logger.debug("audio session changed options: \(oldOptions) -> \(options) ")
// }
// try avAudioSession.setCategory(category, mode: mode, options: options)
//
// } else {
// let oldCategory = avAudioSession.category
// let oldOptions = avAudioSession.categoryOptions
//
// guard avAudioSession.category != category || avAudioSession.categoryOptions != options else {
// return
// }
//
// audioSessionChanged = true
//
// if oldCategory != category {
// Logger.debug("audio session changed category: \(oldCategory) -> \(category) ")
// }
// if oldOptions != options {
// Logger.debug("audio session changed options: \(oldOptions) -> \(options) ")
// }
// try avAudioSession.ows_setCategory(category, with: options)
// }
// } catch {
// let message = "failed to set category: \(category) mode: \(String(describing: mode)), options: \(options) with error: \(error)"
// owsFailDebug(message)
// }
//
// if audioSessionChanged {
// Logger.info("")
// self.delegate?.callAudioServiceDidChangeAudioSession(self)
// }
// }
//}

View File

@ -1,133 +0,0 @@
////
//// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
////
//
//import UIKit
//import CallKit
//import SignalUtilitiesKit
//
///**
// * Requests actions from CallKit
// *
// * @Discussion:
// * Based on SpeakerboxCallManager, from the Apple CallKit Example app. Though, it's responsibilities are mostly
// * mirrored (and delegated from) CallKitCallUIAdaptee.
// * TODO: Would it simplify things to merge this into CallKitCallUIAdaptee?
// */
//@available(iOS 10.0, *)
//final class CallKitCallManager: NSObject {
//
// let callController = CXCallController()
// let showNamesOnCallScreen: Bool
//
// @objc
// static let kAnonymousCallHandlePrefix = "Signal:"
//
// required init(showNamesOnCallScreen: Bool) {
// AssertIsOnMainThread()
//
// self.showNamesOnCallScreen = showNamesOnCallScreen
// super.init()
//
// // We cannot assert singleton here, because this class gets rebuilt when the user changes relevant call settings
// }
//
// // MARK: Actions
//
// func startCall(_ call: SignalCall) {
// var handle: CXHandle
//
// if showNamesOnCallScreen {
// handle = CXHandle(type: .phoneNumber, value: call.remotePhoneNumber)
// } else {
// let callKitId = CallKitCallManager.kAnonymousCallHandlePrefix + call.localId.uuidString
// handle = CXHandle(type: .generic, value: callKitId)
// OWSPrimaryStorage.shared().setPhoneNumber(call.remotePhoneNumber, forCallKitId: callKitId)
// }
//
// let startCallAction = CXStartCallAction(call: call.localId, handle: handle)
//
// startCallAction.isVideo = call.hasLocalVideo
//
// let transaction = CXTransaction()
// transaction.addAction(startCallAction)
//
// requestTransaction(transaction)
// }
//
// func localHangup(call: SignalCall) {
// let endCallAction = CXEndCallAction(call: call.localId)
// let transaction = CXTransaction()
// transaction.addAction(endCallAction)
//
// requestTransaction(transaction)
// }
//
// func setHeld(call: SignalCall, onHold: Bool) {
// let setHeldCallAction = CXSetHeldCallAction(call: call.localId, onHold: onHold)
// let transaction = CXTransaction()
// transaction.addAction(setHeldCallAction)
//
// requestTransaction(transaction)
// }
//
// func setIsMuted(call: SignalCall, isMuted: Bool) {
// let muteCallAction = CXSetMutedCallAction(call: call.localId, muted: isMuted)
// let transaction = CXTransaction()
// transaction.addAction(muteCallAction)
//
// requestTransaction(transaction)
// }
//
// func answer(call: SignalCall) {
// let answerCallAction = CXAnswerCallAction(call: call.localId)
// let transaction = CXTransaction()
// transaction.addAction(answerCallAction)
//
// requestTransaction(transaction)
// }
//
// private func requestTransaction(_ transaction: CXTransaction) {
// callController.request(transaction) { error in
// if let error = error {
// Logger.error("Error requesting transaction: \(error)")
// } else {
// Logger.debug("Requested transaction successfully")
// }
// }
// }
//
// // MARK: Call Management
//
// private(set) var calls = [SignalCall]()
//
// func callWithLocalId(_ localId: UUID) -> SignalCall? {
// guard let index = calls.firstIndex(where: { $0.localId == localId }) else {
// return nil
// }
// return calls[index]
// }
//
// func addCall(_ call: SignalCall) {
// calls.append(call)
// }
//
// func removeCall(_ call: SignalCall) {
// calls.removeFirst(where: { $0 === call })
// }
//
// func removeAllCalls() {
// calls.removeAll()
// }
//}
//
//fileprivate extension Array {
//
// mutating func removeFirst(where predicate: (Element) throws -> Bool) rethrows {
// guard let index = try firstIndex(where: predicate) else {
// return
// }
//
// remove(at: index)
// }
//}

View File

@ -1,414 +0,0 @@
////
//// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
////
//
//import Foundation
//import UIKit
//import CallKit
//import AVFoundation
//import SignalUtilitiesKit
//import SignalUtilitiesKit
//
///**
// * Connects user interface to the CallService using CallKit.
// *
// * User interface is routed to the CallManager which requests CXCallActions, and if the CXProvider accepts them,
// * their corresponding consequences are implmented in the CXProviderDelegate methods, e.g. using the CallService
// */
//@available(iOS 10.0, *)
//final class CallKitCallUIAdaptee: NSObject, CallUIAdaptee, CXProviderDelegate {
//
// private let callManager: CallKitCallManager
// internal let callService: CallService
// internal let notificationPresenter: NotificationPresenter
// internal let contactsManager: OWSContactsManager
// private let showNamesOnCallScreen: Bool
// private let provider: CXProvider
// private let audioActivity: AudioActivity
//
// // CallKit handles incoming ringer stop/start for us. Yay!
// let hasManualRinger = false
//
// // Instantiating more than one CXProvider can cause us to miss call transactions, so
// // we maintain the provider across Adaptees using a singleton pattern
// private static var _sharedProvider: CXProvider?
// class func sharedProvider(useSystemCallLog: Bool) -> CXProvider {
// let configuration = buildProviderConfiguration(useSystemCallLog: useSystemCallLog)
//
// if let sharedProvider = self._sharedProvider {
// sharedProvider.configuration = configuration
// return sharedProvider
// } else {
// SwiftSingletons.register(self)
// let provider = CXProvider(configuration: configuration)
// _sharedProvider = provider
// return provider
// }
// }
//
// // The app's provider configuration, representing its CallKit capabilities
// class func buildProviderConfiguration(useSystemCallLog: Bool) -> CXProviderConfiguration {
// let localizedName = NSLocalizedString("APPLICATION_NAME", comment: "Name of application")
// let providerConfiguration = CXProviderConfiguration(localizedName: localizedName)
//
// providerConfiguration.supportsVideo = true
//
// providerConfiguration.maximumCallGroups = 1
//
// providerConfiguration.maximumCallsPerCallGroup = 1
//
// providerConfiguration.supportedHandleTypes = [.phoneNumber, .generic]
//
// let iconMaskImage = #imageLiteral(resourceName: "logoSignal")
// providerConfiguration.iconTemplateImageData = iconMaskImage.pngData()
//
// // We don't set the ringtoneSound property, so that we use either the
// // default iOS ringtone OR the custom ringtone associated with this user's
// // system contact, if possible (iOS 11 or later).
//
// if #available(iOS 11.0, *) {
// providerConfiguration.includesCallsInRecents = useSystemCallLog
// } else {
// // not configurable for iOS10+
// assert(useSystemCallLog)
// }
//
// return providerConfiguration
// }
//
// init(callService: CallService, contactsManager: OWSContactsManager, notificationPresenter: NotificationPresenter, showNamesOnCallScreen: Bool, useSystemCallLog: Bool) {
// AssertIsOnMainThread()
//
// Logger.debug("")
//
// self.callManager = CallKitCallManager(showNamesOnCallScreen: showNamesOnCallScreen)
// self.callService = callService
// self.contactsManager = contactsManager
// self.notificationPresenter = notificationPresenter
//
// self.provider = type(of: self).sharedProvider(useSystemCallLog: useSystemCallLog)
//
// self.audioActivity = AudioActivity(audioDescription: "[CallKitCallUIAdaptee]", behavior: .call)
// self.showNamesOnCallScreen = showNamesOnCallScreen
//
// super.init()
//
// // We cannot assert singleton here, because this class gets rebuilt when the user changes relevant call settings
//
// self.provider.setDelegate(self, queue: nil)
// }
//
// // MARK: Dependencies
//
// var audioSession: OWSAudioSession {
// return Environment.shared.audioSession
// }
//
// // MARK: CallUIAdaptee
//
// func startOutgoingCall(handle: String) -> SignalCall {
// AssertIsOnMainThread()
// Logger.info("")
//
// let call = SignalCall.outgoingCall(localId: UUID(), remotePhoneNumber: handle)
//
// // make sure we don't terminate audio session during call
// _ = self.audioSession.startAudioActivity(call.audioActivity)
//
// // Add the new outgoing call to the app's list of calls.
// // So we can find it in the provider delegate callbacks.
// callManager.addCall(call)
// callManager.startCall(call)
//
// return call
// }
//
// // Called from CallService after call has ended to clean up any remaining CallKit call state.
// func failCall(_ call: SignalCall, error: CallError) {
// AssertIsOnMainThread()
// Logger.info("")
//
// switch error {
// case .timeout(description: _):
// provider.reportCall(with: call.localId, endedAt: Date(), reason: CXCallEndedReason.unanswered)
// default:
// provider.reportCall(with: call.localId, endedAt: Date(), reason: CXCallEndedReason.failed)
// }
//
// self.callManager.removeCall(call)
// }
//
// func reportIncomingCall(_ call: SignalCall, callerName: String) {
// AssertIsOnMainThread()
// Logger.info("")
//
// // Construct a CXCallUpdate describing the incoming call, including the caller.
// let update = CXCallUpdate()
//
// if showNamesOnCallScreen {
// update.localizedCallerName = self.contactsManager.stringForConversationTitle(withPhoneIdentifier: call.remotePhoneNumber)
// update.remoteHandle = CXHandle(type: .phoneNumber, value: call.remotePhoneNumber)
// } else {
// let callKitId = CallKitCallManager.kAnonymousCallHandlePrefix + call.localId.uuidString
// update.remoteHandle = CXHandle(type: .generic, value: callKitId)
// OWSPrimaryStorage.shared().setPhoneNumber(call.remotePhoneNumber, forCallKitId: callKitId)
// update.localizedCallerName = NSLocalizedString("CALLKIT_ANONYMOUS_CONTACT_NAME", comment: "The generic name used for calls if CallKit privacy is enabled")
// }
//
// update.hasVideo = call.hasLocalVideo
//
// disableUnsupportedFeatures(callUpdate: update)
//
// // Report the incoming call to the system
// provider.reportNewIncomingCall(with: call.localId, update: update) { error in
// /*
// Only add incoming call to the app's list of calls if the call was allowed (i.e. there was no error)
// since calls may be "denied" for various legitimate reasons. See CXErrorCodeIncomingCallError.
// */
// guard error == nil else {
// Logger.error("failed to report new incoming call")
// return
// }
//
// self.callManager.addCall(call)
// }
// }
//
// func answerCall(localId: UUID) {
// AssertIsOnMainThread()
// Logger.info("")
//
// owsFailDebug("CallKit should answer calls via system call screen, not via notifications.")
// }
//
// func answerCall(_ call: SignalCall) {
// AssertIsOnMainThread()
// Logger.info("")
//
// callManager.answer(call: call)
// }
//
// func declineCall(localId: UUID) {
// AssertIsOnMainThread()
//
// owsFailDebug("CallKit should decline calls via system call screen, not via notifications.")
// }
//
// func declineCall(_ call: SignalCall) {
// AssertIsOnMainThread()
// Logger.info("")
//
// callManager.localHangup(call: call)
// }
//
// func recipientAcceptedCall(_ call: SignalCall) {
// AssertIsOnMainThread()
// Logger.info("")
//
// self.provider.reportOutgoingCall(with: call.localId, connectedAt: nil)
//
// let update = CXCallUpdate()
// disableUnsupportedFeatures(callUpdate: update)
//
// provider.reportCall(with: call.localId, updated: update)
// }
//
// func localHangupCall(_ call: SignalCall) {
// AssertIsOnMainThread()
// Logger.info("")
//
// callManager.localHangup(call: call)
// }
//
// func remoteDidHangupCall(_ call: SignalCall) {
// AssertIsOnMainThread()
// Logger.info("")
//
// provider.reportCall(with: call.localId, endedAt: nil, reason: CXCallEndedReason.remoteEnded)
// }
//
// func remoteBusy(_ call: SignalCall) {
// AssertIsOnMainThread()
// Logger.info("")
//
// provider.reportCall(with: call.localId, endedAt: nil, reason: CXCallEndedReason.unanswered)
// }
//
// func setIsMuted(call: SignalCall, isMuted: Bool) {
// AssertIsOnMainThread()
// Logger.info("")
//
// callManager.setIsMuted(call: call, isMuted: isMuted)
// }
//
// func setHasLocalVideo(call: SignalCall, hasLocalVideo: Bool) {
// AssertIsOnMainThread()
// Logger.debug("")
//
// let update = CXCallUpdate()
// update.hasVideo = hasLocalVideo
//
// // Update the CallKit UI.
// provider.reportCall(with: call.localId, updated: update)
//
// self.callService.setHasLocalVideo(hasLocalVideo: hasLocalVideo)
// }
//
// // MARK: CXProviderDelegate
//
// func providerDidReset(_ provider: CXProvider) {
// AssertIsOnMainThread()
// Logger.info("")
//
// // End any ongoing calls if the provider resets, and remove them from the app's list of calls,
// // since they are no longer valid.
// callService.handleFailedCurrentCall(error: .providerReset)
//
// // Remove all calls from the app's list of calls.
// callManager.removeAllCalls()
// }
//
// func provider(_ provider: CXProvider, perform action: CXStartCallAction) {
// AssertIsOnMainThread()
//
// Logger.info("CXStartCallAction")
//
// guard let call = callManager.callWithLocalId(action.callUUID) else {
// Logger.error("unable to find call")
// return
// }
//
// // We can't wait for long before fulfilling the CXAction, else CallKit will show a "Failed Call". We don't
// // actually need to wait for the outcome of the handleOutgoingCall promise, because it handles any errors by
// // manually failing the call.
// self.callService.handleOutgoingCall(call).retainUntilComplete()
//
// action.fulfill()
// self.provider.reportOutgoingCall(with: call.localId, startedConnectingAt: nil)
//
// // Update the name used in the CallKit UI for outgoing calls when the user prefers not to show names
// // in ther notifications
// if !showNamesOnCallScreen {
// let update = CXCallUpdate()
// update.localizedCallerName = NSLocalizedString("CALLKIT_ANONYMOUS_CONTACT_NAME",
// comment: "The generic name used for calls if CallKit privacy is enabled")
// provider.reportCall(with: call.localId, updated: update)
// }
// }
//
// func provider(_ provider: CXProvider, perform action: CXAnswerCallAction) {
// AssertIsOnMainThread()
//
// Logger.info("Received \(#function) CXAnswerCallAction")
// // Retrieve the instance corresponding to the action's call UUID
// guard let call = callManager.callWithLocalId(action.callUUID) else {
// action.fail()
// return
// }
//
// self.callService.handleAnswerCall(call)
// self.showCall(call)
// action.fulfill()
// }
//
// public func provider(_ provider: CXProvider, perform action: CXEndCallAction) {
// AssertIsOnMainThread()
//
// Logger.info("Received \(#function) CXEndCallAction")
// guard let call = callManager.callWithLocalId(action.callUUID) else {
// Logger.error("trying to end unknown call with localId: \(action.callUUID)")
// action.fail()
// return
// }
//
// self.callService.handleLocalHungupCall(call)
//
// // Signal to the system that the action has been successfully performed.
// action.fulfill()
//
// // Remove the ended call from the app's list of calls.
// self.callManager.removeCall(call)
// }
//
// public func provider(_ provider: CXProvider, perform action: CXSetHeldCallAction) {
// AssertIsOnMainThread()
//
// Logger.info("Received \(#function) CXSetHeldCallAction")
// guard let call = callManager.callWithLocalId(action.callUUID) else {
// action.fail()
// return
// }
//
// // Update the SignalCall's underlying hold state.
// self.callService.setIsOnHold(call: call, isOnHold: action.isOnHold)
//
// // Signal to the system that the action has been successfully performed.
// action.fulfill()
// }
//
// public func provider(_ provider: CXProvider, perform action: CXSetMutedCallAction) {
// AssertIsOnMainThread()
//
// Logger.info("Received \(#function) CXSetMutedCallAction")
// guard let call = callManager.callWithLocalId(action.callUUID) else {
// Logger.error("Failing CXSetMutedCallAction for unknown call: \(action.callUUID)")
// action.fail()
// return
// }
//
// self.callService.setIsMuted(call: call, isMuted: action.isMuted)
// action.fulfill()
// }
//
// public func provider(_ provider: CXProvider, perform action: CXSetGroupCallAction) {
// AssertIsOnMainThread()
//
// Logger.warn("unimplemented \(#function) for CXSetGroupCallAction")
// }
//
// public func provider(_ provider: CXProvider, perform action: CXPlayDTMFCallAction) {
// AssertIsOnMainThread()
//
// Logger.warn("unimplemented \(#function) for CXPlayDTMFCallAction")
// }
//
// func provider(_ provider: CXProvider, timedOutPerforming action: CXAction) {
// AssertIsOnMainThread()
//
// owsFailDebug("Timed out while performing \(action)")
//
// // React to the action timeout if necessary, such as showing an error UI.
// }
//
// func provider(_ provider: CXProvider, didActivate audioSession: AVAudioSession) {
// AssertIsOnMainThread()
//
// Logger.debug("Received")
//
// _ = self.audioSession.startAudioActivity(self.audioActivity)
// self.audioSession.isRTCAudioEnabled = true
// }
//
// func provider(_ provider: CXProvider, didDeactivate audioSession: AVAudioSession) {
// AssertIsOnMainThread()
//
// Logger.debug("Received")
// self.audioSession.isRTCAudioEnabled = false
// self.audioSession.endAudioActivity(self.audioActivity)
// }
//
// // MARK: - Util
//
// private func disableUnsupportedFeatures(callUpdate: CXCallUpdate) {
// // Call Holding is failing to restart audio when "swapping" calls on the CallKit screen
// // until user returns to in-app call screen.
// callUpdate.supportsHolding = false
//
// // Not yet supported
// callUpdate.supportsGrouping = false
// callUpdate.supportsUngrouping = false
//
// // Is there any reason to support this?
// callUpdate.supportsDTMF = false
// }
//}

File diff suppressed because it is too large Load Diff

View File

@ -1,307 +0,0 @@
////
//// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
////
//
//import Foundation
//import PromiseKit
//import CallKit
//import SignalUtilitiesKit
//import SignalUtilitiesKit
//import WebRTC
//
//protocol CallUIAdaptee {
// var notificationPresenter: NotificationPresenter { get }
// var callService: CallService { get }
// var hasManualRinger: Bool { get }
//
// func startOutgoingCall(handle: String) -> SignalCall
// func reportIncomingCall(_ call: SignalCall, callerName: String)
// func reportMissedCall(_ call: SignalCall, callerName: String)
// func answerCall(localId: UUID)
// func answerCall(_ call: SignalCall)
// func declineCall(localId: UUID)
// func declineCall(_ call: SignalCall)
// func recipientAcceptedCall(_ call: SignalCall)
// func localHangupCall(_ call: SignalCall)
// func remoteDidHangupCall(_ call: SignalCall)
// func remoteBusy(_ call: SignalCall)
// func failCall(_ call: SignalCall, error: CallError)
// func setIsMuted(call: SignalCall, isMuted: Bool)
// func setHasLocalVideo(call: SignalCall, hasLocalVideo: Bool)
// func startAndShowOutgoingCall(recipientId: String, hasLocalVideo: Bool)
//}
//
//// Shared default implementations
//extension CallUIAdaptee {
// internal func showCall(_ call: SignalCall) {
// AssertIsOnMainThread()
//
// let callViewController = CallViewController(call: call)
// callViewController.modalTransitionStyle = .crossDissolve
//
// if CallViewController.kShowCallViewOnSeparateWindow {
// OWSWindowManager.shared().startCall(callViewController)
// } else {
// guard let presentingViewController = UIApplication.shared.frontmostViewControllerIgnoringAlerts else {
// owsFailDebug("view controller unexpectedly nil")
// return
// }
//
// if let presentedViewController = presentingViewController.presentedViewController {
// presentedViewController.dismiss(animated: false) {
// presentingViewController.present(callViewController, animated: true)
// }
// } else {
// presentingViewController.present(callViewController, animated: true)
// }
// }
// }
//
// internal func reportMissedCall(_ call: SignalCall, callerName: String) {
// AssertIsOnMainThread()
//
// notificationPresenter.presentMissedCall(call, callerName: callerName)
// }
//
// internal func startAndShowOutgoingCall(recipientId: String, hasLocalVideo: Bool) {
// AssertIsOnMainThread()
//
// guard self.callService.call == nil else {
// owsFailDebug("unexpectedly found an existing call when trying to start outgoing call: \(recipientId)")
// return
// }
//
// let call = self.startOutgoingCall(handle: recipientId)
// call.hasLocalVideo = hasLocalVideo
// self.showCall(call)
// }
//}
//
///**
// * Notify the user of call related activities.
// * Driven by either a CallKit or System notifications adaptee
// */
//@objc public class CallUIAdapter: NSObject, CallServiceObserver {
//
// private let adaptee: CallUIAdaptee
// private let contactsManager: OWSContactsManager
// internal let audioService: CallAudioService
// internal let callService: CallService
//
// public required init(callService: CallService, contactsManager: OWSContactsManager, notificationPresenter: NotificationPresenter) {
// AssertIsOnMainThread()
//
// self.contactsManager = contactsManager
// self.callService = callService
//
// if Platform.isSimulator {
// // CallKit doesn't seem entirely supported in simulator.
// // e.g. you can't receive calls in the call screen.
// // So we use the non-CallKit call UI.
// Logger.info("choosing non-callkit adaptee for simulator.")
// adaptee = NonCallKitCallUIAdaptee(callService: callService, notificationPresenter: notificationPresenter)
// } else if CallUIAdapter.isCallkitDisabledForLocale {
// Logger.info("choosing non-callkit adaptee due to locale.")
// adaptee = NonCallKitCallUIAdaptee(callService: callService, notificationPresenter: notificationPresenter)
// } else if #available(iOS 11, *) {
// Logger.info("choosing callkit adaptee for iOS11+")
// let showNames = Environment.shared.preferences.notificationPreviewType() != .noNameNoPreview
// let useSystemCallLog = Environment.shared.preferences.isSystemCallLogEnabled()
//
// adaptee = CallKitCallUIAdaptee(callService: callService, contactsManager: contactsManager, notificationPresenter: notificationPresenter, showNamesOnCallScreen: showNames, useSystemCallLog: useSystemCallLog)
// } else if #available(iOS 10.0, *), Environment.shared.preferences.isCallKitEnabled() {
// Logger.info("choosing callkit adaptee for iOS10")
// let hideNames = Environment.shared.preferences.isCallKitPrivacyEnabled() || Environment.shared.preferences.notificationPreviewType() == .noNameNoPreview
// let showNames = !hideNames
//
// // All CallKit calls use the system call log on iOS10
// let useSystemCallLog = true
//
// adaptee = CallKitCallUIAdaptee(callService: callService, contactsManager: contactsManager, notificationPresenter: notificationPresenter, showNamesOnCallScreen: showNames, useSystemCallLog: useSystemCallLog)
// } else {
// Logger.info("choosing non-callkit adaptee")
// adaptee = NonCallKitCallUIAdaptee(callService: callService, notificationPresenter: notificationPresenter)
// }
//
// audioService = CallAudioService(handleRinging: adaptee.hasManualRinger)
//
// super.init()
//
// // We cannot assert singleton here, because this class gets rebuilt when the user changes relevant call settings
//
// callService.addObserverAndSyncState(observer: self)
// }
//
// @objc
// public static var isCallkitDisabledForLocale: Bool {
// let locale = Locale.current
// guard let regionCode = locale.regionCode else {
// owsFailDebug("Missing region code.")
// return false
// }
//
// // Apple has stopped approving apps that use CallKit functionality in mainland China.
// // When the "CN" region is enabled, this check simply switches to the same pre-CallKit
// // interface that is still used by everyone on iOS 9.
// //
// // For further reference: https://forums.developer.apple.com/thread/103083
// return regionCode == "CN"
// }
//
// // MARK: Dependencies
//
// var audioSession: OWSAudioSession {
// return Environment.shared.audioSession
// }
//
// // MARK:
//
// internal func reportIncomingCall(_ call: SignalCall, thread: TSContactThread) {
// AssertIsOnMainThread()
//
// // make sure we don't terminate audio session during call
// _ = audioSession.startAudioActivity(call.audioActivity)
//
// let callerName = self.contactsManager.displayName(forPhoneIdentifier: call.remotePhoneNumber)
// adaptee.reportIncomingCall(call, callerName: callerName)
// }
//
// internal func reportMissedCall(_ call: SignalCall) {
// AssertIsOnMainThread()
//
// let callerName = self.contactsManager.displayName(forPhoneIdentifier: call.remotePhoneNumber)
// adaptee.reportMissedCall(call, callerName: callerName)
// }
//
// internal func startOutgoingCall(handle: String) -> SignalCall {
// AssertIsOnMainThread()
//
// let call = adaptee.startOutgoingCall(handle: handle)
// return call
// }
//
// @objc public func answerCall(localId: UUID) {
// AssertIsOnMainThread()
//
// adaptee.answerCall(localId: localId)
// }
//
// internal func answerCall(_ call: SignalCall) {
// AssertIsOnMainThread()
//
// adaptee.answerCall(call)
// }
//
// @objc public func declineCall(localId: UUID) {
// AssertIsOnMainThread()
//
// adaptee.declineCall(localId: localId)
// }
//
// internal func declineCall(_ call: SignalCall) {
// AssertIsOnMainThread()
//
// adaptee.declineCall(call)
// }
//
// internal func didTerminateCall(_ call: SignalCall?) {
// AssertIsOnMainThread()
//
// if let call = call {
// self.audioSession.endAudioActivity(call.audioActivity)
// }
// }
//
// @objc public func startAndShowOutgoingCall(recipientId: String, hasLocalVideo: Bool) {
// AssertIsOnMainThread()
//
// adaptee.startAndShowOutgoingCall(recipientId: recipientId, hasLocalVideo: hasLocalVideo)
// }
//
// internal func recipientAcceptedCall(_ call: SignalCall) {
// AssertIsOnMainThread()
//
// adaptee.recipientAcceptedCall(call)
// }
//
// internal func remoteDidHangupCall(_ call: SignalCall) {
// AssertIsOnMainThread()
//
// adaptee.remoteDidHangupCall(call)
// }
//
// internal func remoteBusy(_ call: SignalCall) {
// AssertIsOnMainThread()
//
// adaptee.remoteBusy(call)
// }
//
// internal func localHangupCall(_ call: SignalCall) {
// AssertIsOnMainThread()
//
// adaptee.localHangupCall(call)
// }
//
// internal func failCall(_ call: SignalCall, error: CallError) {
// AssertIsOnMainThread()
//
// adaptee.failCall(call, error: error)
// }
//
// internal func showCall(_ call: SignalCall) {
// AssertIsOnMainThread()
//
// adaptee.showCall(call)
// }
//
// internal func setIsMuted(call: SignalCall, isMuted: Bool) {
// AssertIsOnMainThread()
//
// // With CallKit, muting is handled by a CXAction, so it must go through the adaptee
// adaptee.setIsMuted(call: call, isMuted: isMuted)
// }
//
// internal func setHasLocalVideo(call: SignalCall, hasLocalVideo: Bool) {
// AssertIsOnMainThread()
//
// adaptee.setHasLocalVideo(call: call, hasLocalVideo: hasLocalVideo)
// }
//
// internal func setAudioSource(call: SignalCall, audioSource: AudioSource?) {
// AssertIsOnMainThread()
//
// // AudioSource is not handled by CallKit (e.g. there is no CXAction), so we handle it w/o going through the
// // adaptee, relying on the AudioService CallObserver to put the system in a state consistent with the call's
// // assigned property.
// call.audioSource = audioSource
// }
//
// internal func setCameraSource(call: SignalCall, isUsingFrontCamera: Bool) {
// AssertIsOnMainThread()
//
// callService.setCameraSource(call: call, isUsingFrontCamera: isUsingFrontCamera)
// }
//
// // CallKit handles ringing state on it's own. But for non-call kit we trigger ringing start/stop manually.
// internal var hasManualRinger: Bool {
// AssertIsOnMainThread()
//
// return adaptee.hasManualRinger
// }
//
// // MARK: - CallServiceObserver
//
// internal func didUpdateCall(call: SignalCall?) {
// AssertIsOnMainThread()
//
// call?.addObserverAndSyncState(observer: audioService)
// }
//
// internal func didUpdateVideoTracks(call: SignalCall?,
// localCaptureSession: AVCaptureSession?,
// remoteVideoTrack: RTCVideoTrack?) {
// AssertIsOnMainThread()
//
// audioService.didUpdateVideoTracks(call: call)
// }
//}

View File

@ -11,7 +11,6 @@
#import "UIView+OWS.h"
#import <SignalUtilitiesKit/OWSDisappearingConfigurationUpdateInfoMessage.h>
#import <SignalUtilitiesKit/Environment.h>
#import <SignalUtilitiesKit/TSCall.h>
#import <SignalUtilitiesKit/TSErrorMessage.h>
#import <SignalUtilitiesKit/TSInfoMessage.h>
@ -290,8 +289,6 @@ typedef void (^SystemMessageActionBlock)(void);
break;
}
}
} else if ([interaction isKindOfClass:[TSCall class]]) {
result = [UIImage imageNamed:@"system_message_call"];
} else {
OWSFailDebug(@"Unknown interaction type: %@", [interaction class]);
return nil;

View File

@ -16,7 +16,6 @@
#import "DateUtil.h"
#import <SignalUtilitiesKit/NSAttributedString+OWS.h>
#import "OWSAudioPlayer.h"
#import "OWSConversationSettingsViewController.h"
#import "OWSConversationSettingsViewDelegate.h"
#import "OWSDisappearingMessagesJob.h"
@ -27,7 +26,6 @@
#import "Session-Swift.h"
#import <SignalUtilitiesKit/SignalKeyingStorage.h>
#import "TSAttachmentPointer.h"
#import <SignalUtilitiesKit/TSCall.h>
#import "TSContactThread.h"
#import "TSDatabaseView.h"
#import "TSErrorMessage.h"
@ -45,7 +43,6 @@
#import <SignalCoreKit/NSDate+OWS.h>
#import <SignalCoreKit/Threading.h>
#import <SignalUtilitiesKit/Environment.h>
#import <SignalUtilitiesKit/OWSContactOffersInteraction.h>
#import <SignalUtilitiesKit/OWSFormat.h>
#import <SignalUtilitiesKit/OWSNavigationController.h>
#import <SignalUtilitiesKit/OWSUnreadIndicator.h>
@ -557,7 +554,7 @@ typedef enum : NSUInteger {
}
TSGroupThread *groupThread = (TSGroupThread *)self.thread;
return !groupThread.isCurrentUserInGroup;
return !groupThread.isCurrentUserMemberInGroup;
}
- (void)hideInputIfNeeded

View File

@ -760,10 +760,6 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType)
TSInfoMessage *infoMessage = (TSInfoMessage *)self.interaction;
return [infoMessage previewTextWithTransaction:transaction];
}
case OWSInteractionType_Call: {
TSCall *call = (TSCall *)self.interaction;
return [call previewTextWithTransaction:transaction];
}
default:
OWSFailDebug(@"not a system message.");
return nil;

View File

@ -9,11 +9,8 @@
#import "OWSQuotedReplyModel.h"
#import "Session-Swift.h"
#import <SignalCoreKit/NSDate+OWS.h>
#import <SignalUtilitiesKit/OWSContactOffersInteraction.h>
#import <SignalUtilitiesKit/OWSUnreadIndicator.h>
#import <SignalUtilitiesKit/SignalUtilitiesKit-Swift.h>
#import <SignalUtilitiesKit/OWSBlockingManager.h>
#import <SignalUtilitiesKit/OWSPrimaryStorage.h>
#import <SignalUtilitiesKit/SSKEnvironment.h>
@ -1041,133 +1038,6 @@ static const int kYapDatabaseRangeMaxLength = 25000;
return nil;
}
- (nullable OWSContactOffersInteraction *)
tryToBuildContactOffersInteractionWithTransaction:(YapDatabaseReadTransaction *)transaction
loadedInteractions:(NSArray<TSInteraction *> *)loadedInteractions
canLoadMoreItems:(BOOL)canLoadMoreItems
{
OWSAssertDebug(transaction);
OWSAssertDebug(self.conversationProfileState);
if (canLoadMoreItems) {
// Only show contact offers at the start of the conversation.
return nil;
}
BOOL hasLocalProfile = self.conversationProfileState.hasLocalProfile;
BOOL isThreadInProfileWhitelist = self.conversationProfileState.isThreadInProfileWhitelist;
BOOL hasUnwhitelistedMember = self.conversationProfileState.hasUnwhitelistedMember;
TSThread *thread = self.thread;
BOOL isContactThread = [thread isKindOfClass:[TSContactThread class]];
if (!isContactThread) {
return nil;
}
TSContactThread *contactThread = (TSContactThread *)thread;
if (contactThread.hasDismissedOffers) {
return nil;
}
NSString *localNumber = [self.tsAccountManager localNumber];
OWSAssertDebug(localNumber.length > 0);
TSInteraction *firstCallOrMessage = [self firstCallOrMessageForLoadedInteractions:loadedInteractions];
if (!firstCallOrMessage) {
return nil;
}
BOOL hasTooManyOutgoingMessagesToBlock;
if (self.hasTooManyOutgoingMessagesToBlockCached) {
hasTooManyOutgoingMessagesToBlock = YES;
} else {
NSUInteger outgoingMessageCount =
[[TSDatabaseView threadOutgoingMessageDatabaseView:transaction] numberOfItemsInGroup:thread.uniqueId];
const int kMaxBlockOfferOutgoingMessageCount = 10;
hasTooManyOutgoingMessagesToBlock = (outgoingMessageCount > kMaxBlockOfferOutgoingMessageCount);
self.hasTooManyOutgoingMessagesToBlockCached = hasTooManyOutgoingMessagesToBlock;
}
BOOL shouldHaveBlockOffer = YES;
BOOL shouldHaveAddToContactsOffer = YES;
BOOL shouldHaveAddToProfileWhitelistOffer = YES;
NSString *recipientId = ((TSContactThread *)thread).contactIdentifier;
if ([recipientId isEqualToString:localNumber]) {
// Don't add self to contacts.
shouldHaveAddToContactsOffer = NO;
// Don't bother to block self.
shouldHaveBlockOffer = NO;
// Don't bother adding self to profile whitelist.
shouldHaveAddToProfileWhitelistOffer = NO;
} else {
if ([[self.blockingManager blockedPhoneNumbers] containsObject:recipientId]) {
// Only create "add to contacts" offers for users which are not already blocked.
shouldHaveAddToContactsOffer = NO;
// Only create block offers for users which are not already blocked.
shouldHaveBlockOffer = NO;
// Don't create profile whitelist offers for users which are not already blocked.
shouldHaveAddToProfileWhitelistOffer = NO;
}
}
if (hasTooManyOutgoingMessagesToBlock) {
// If the user has sent more than N messages, don't show a block offer.
shouldHaveBlockOffer = NO;
}
BOOL hasOutgoingBeforeIncomingInteraction = [firstCallOrMessage isKindOfClass:[TSOutgoingMessage class]];
if ([firstCallOrMessage isKindOfClass:[TSCall class]]) {
TSCall *call = (TSCall *)firstCallOrMessage;
hasOutgoingBeforeIncomingInteraction
= (call.callType == RPRecentCallTypeOutgoing || call.callType == RPRecentCallTypeOutgoingIncomplete);
}
if (hasOutgoingBeforeIncomingInteraction) {
// If there is an outgoing message before an incoming message
// the local user initiated this conversation, don't show a block offer.
shouldHaveBlockOffer = NO;
}
if (!hasLocalProfile || isThreadInProfileWhitelist) {
// Don't show offer if thread is local user hasn't configured their profile.
// Don't show offer if thread is already in profile whitelist.
shouldHaveAddToProfileWhitelistOffer = NO;
} else if (thread.isGroupThread && !hasUnwhitelistedMember) {
// Don't show offer in group thread if all members are already individually
// whitelisted.
shouldHaveAddToProfileWhitelistOffer = NO;
}
BOOL shouldHaveContactOffers
= (shouldHaveBlockOffer || shouldHaveAddToContactsOffer || shouldHaveAddToProfileWhitelistOffer);
if (!shouldHaveContactOffers) {
return nil;
}
// We want the offers to be the first interactions in their
// conversation's timeline, so we back-date them to slightly before
// the first message - or at an arbitrary old timestamp if the
// conversation has no messages.
uint64_t contactOffersTimestamp = firstCallOrMessage.timestamp - 1;
// This view model uses the "unique id" to identify this interaction,
// but the interaction is never saved in the database so the specific
// value doesn't matter.
NSString *uniqueId = @"contact-offers";
OWSContactOffersInteraction *offersMessage =
[[OWSContactOffersInteraction alloc] initInteractionWithUniqueId:uniqueId
timestamp:contactOffersTimestamp
thread:thread
hasBlockOffer:shouldHaveBlockOffer
hasAddToContactsOffer:shouldHaveAddToContactsOffer
hasAddToProfileWhitelistOffer:shouldHaveAddToProfileWhitelistOffer
recipientId:recipientId
beforeInteractionId:firstCallOrMessage.uniqueId];
OWSLogInfo(@"Creating contact offers: %@ (%llu)", offersMessage.uniqueId, offersMessage.sortId);
return offersMessage;
}
// This is a key method. It builds or rebuilds the list of
// cell view models.
//
@ -1243,22 +1113,6 @@ static const int kYapDatabaseRangeMaxLength = 25000;
[interactionIds addObject:interaction.uniqueId];
}
OWSContactOffersInteraction *_Nullable offers = nil;
if (offers && [interactionIds containsObject:offers.beforeInteractionId]) {
id<ConversationViewItem> offersItem = tryToAddViewItem(offers, transaction);
if ([offersItem.interaction isKindOfClass:[OWSContactOffersInteraction class]]) {
OWSContactOffersInteraction *oldOffers = (OWSContactOffersInteraction *)offersItem.interaction;
BOOL didChange = (oldOffers.hasBlockOffer != offers.hasBlockOffer
|| oldOffers.hasAddToContactsOffer != offers.hasAddToContactsOffer
|| oldOffers.hasAddToProfileWhitelistOffer != offers.hasAddToProfileWhitelistOffer);
if (didChange) {
[offersItem clearCachedLayoutState];
}
} else {
OWSFailDebug(@"Unexpected offers item: %@", offersItem.interaction.class);
}
}
for (TSInteraction *interaction in interactions) {
tryToAddViewItem(interaction, transaction);
}
@ -1548,7 +1402,6 @@ static const int kYapDatabaseRangeMaxLength = 25000;
// Because the message isn't yet saved, we don't have sufficient information to build
// in-memory placeholder for message types more complex than plain text.
OWSAssertDebug(outgoingMessage.attachmentIds.count == 0);
OWSAssertDebug(outgoingMessage.contactShare == nil);
NSMutableArray<TSOutgoingMessage *> *unsavedOutgoingMessages = [self.unsavedOutgoingMessages mutableCopy];
[unsavedOutgoingMessages addObject:outgoingMessage];

View File

@ -1,185 +0,0 @@
////
//// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
////
//
//import Foundation
//import SignalUtilitiesKit
//import SignalUtilitiesKit
//
///**
// * Manage call related UI in a pre-CallKit world.
// */
//class NonCallKitCallUIAdaptee: NSObject, CallUIAdaptee {
//
// let notificationPresenter: NotificationPresenter
// let callService: CallService
//
// // Starting/Stopping incoming call ringing is our apps responsibility for the non CallKit interface.
// let hasManualRinger = true
//
// required init(callService: CallService, notificationPresenter: NotificationPresenter) {
// AssertIsOnMainThread()
//
// self.callService = callService
// self.notificationPresenter = notificationPresenter
//
// super.init()
// }
//
// // MARK: Dependencies
//
// var audioSession: OWSAudioSession {
// return Environment.shared.audioSession
// }
//
// // MARK:
//
// func startOutgoingCall(handle: String) -> SignalCall {
// AssertIsOnMainThread()
//
// let call = SignalCall.outgoingCall(localId: UUID(), remotePhoneNumber: handle)
//
// // make sure we don't terminate audio session during call
// let success = self.audioSession.startAudioActivity(call.audioActivity)
// assert(success)
//
// self.callService.handleOutgoingCall(call).retainUntilComplete()
//
// return call
// }
//
// func reportIncomingCall(_ call: SignalCall, callerName: String) {
// AssertIsOnMainThread()
//
// Logger.debug("")
//
// self.showCall(call)
//
// // present lock screen notification
// if UIApplication.shared.applicationState == .active {
// Logger.debug("skipping notification since app is already active.")
// } else {
// notificationPresenter.presentIncomingCall(call, callerName: callerName)
// }
// }
//
// func reportMissedCall(_ call: SignalCall, callerName: String) {
// AssertIsOnMainThread()
//
// notificationPresenter.presentMissedCall(call, callerName: callerName)
// }
//
// func answerCall(localId: UUID) {
// AssertIsOnMainThread()
//
// guard let call = self.callService.call else {
// owsFailDebug("No current call.")
// return
// }
//
// guard call.localId == localId else {
// owsFailDebug("localId does not match current call")
// return
// }
//
// self.answerCall(call)
// }
//
// func answerCall(_ call: SignalCall) {
// AssertIsOnMainThread()
//
// guard call.localId == self.callService.call?.localId else {
// owsFailDebug("localId does not match current call")
// return
// }
//
// self.audioSession.isRTCAudioEnabled = true
// self.callService.handleAnswerCall(call)
// }
//
// func declineCall(localId: UUID) {
// AssertIsOnMainThread()
//
// guard let call = self.callService.call else {
// owsFailDebug("No current call.")
// return
// }
//
// guard call.localId == localId else {
// owsFailDebug("localId does not match current call")
// return
// }
//
// self.declineCall(call)
// }
//
// func declineCall(_ call: SignalCall) {
// AssertIsOnMainThread()
//
// guard call.localId == self.callService.call?.localId else {
// owsFailDebug("localId does not match current call")
// return
// }
//
// self.callService.handleDeclineCall(call)
// }
//
// func recipientAcceptedCall(_ call: SignalCall) {
// AssertIsOnMainThread()
//
// self.audioSession.isRTCAudioEnabled = true
// }
//
// func localHangupCall(_ call: SignalCall) {
// AssertIsOnMainThread()
//
// // If both parties hang up at the same moment,
// // call might already be nil.
// guard self.callService.call == nil || call.localId == self.callService.call?.localId else {
// owsFailDebug("localId does not match current call")
// return
// }
//
// self.callService.handleLocalHungupCall(call)
// }
//
// internal func remoteDidHangupCall(_ call: SignalCall) {
// AssertIsOnMainThread()
//
// Logger.debug("is no-op")
// }
//
// internal func remoteBusy(_ call: SignalCall) {
// AssertIsOnMainThread()
//
// Logger.debug("is no-op")
// }
//
// internal func failCall(_ call: SignalCall, error: CallError) {
// AssertIsOnMainThread()
//
// Logger.debug("is no-op")
// }
//
// func setIsMuted(call: SignalCall, isMuted: Bool) {
// AssertIsOnMainThread()
//
// guard call.localId == self.callService.call?.localId else {
// owsFailDebug("localId does not match current call")
// return
// }
//
// self.callService.setIsMuted(call: call, isMuted: isMuted)
// }
//
// func setHasLocalVideo(call: SignalCall, hasLocalVideo: Bool) {
// AssertIsOnMainThread()
//
// guard call.localId == self.callService.call?.localId else {
// owsFailDebug("localId does not match current call")
// return
// }
//
// self.callService.setHasLocalVideo(hasLocalVideo: hasLocalVideo)
// }
//}

View File

@ -180,8 +180,6 @@ NSString *const kOWSBackup_ImportDatabaseKeySpec = @"kOWSBackup_ImportDatabaseKe
// Kick off lazy restore on main thread.
[self.backupLazyRestore clearCompleteAndRunIfNecessary];
[self.profileManager fetchLocalUsersProfile];
// Make sure backup is enabled once we complete
// a backup restore.
[OWSBackup.sharedManager setIsBackupEnabled:YES];

View File

@ -937,7 +937,7 @@ static CGRect oldframe;
{
if (self.isGroupThread) {
TSGroupThread *groupThread = (TSGroupThread *)self.thread;
return !groupThread.isCurrentUserInGroup;
return !groupThread.isCurrentUserMemberInGroup;
}
return NO;

View File

@ -1,85 +0,0 @@
////
//// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
////
//
//import Foundation
//import SignalUtilitiesKit
//import SignalUtilitiesKit
//
///**
// * Creates an outbound call via WebRTC.
// */
//@objc public class OutboundCallInitiator: NSObject {
//
// @objc public override init() {
// super.init()
//
// SwiftSingletons.register(self)
// }
//
// // MARK: - Dependencies
//
// private var contactsManager: OWSContactsManager {
// return Environment.shared.contactsManager
// }
//
// private var contactsUpdater: ContactsUpdater {
// return SSKEnvironment.shared.contactsUpdater
// }
//
// // MARK: -
//
// /**
// * |handle| is a user formatted phone number, e.g. from a system contacts entry
// */
// @discardableResult @objc public func initiateCall(handle: String) -> Bool {
// Logger.info("with handle: \(handle)")
//
// guard let recipientId = PhoneNumber(fromE164: handle)?.toE164() else {
// Logger.warn("unable to parse signalId from phone number: \(handle)")
// return false
// }
//
// return initiateCall(recipientId: recipientId, isVideo: false)
// }
//
// /**
// * |recipientId| is a e164 formatted phone number.
// */
// @discardableResult
// @objc
// public func initiateCall(recipientId: String,
// isVideo: Bool) -> Bool {
// guard let callUIAdapter = AppEnvironment.shared.callService.callUIAdapter else {
// owsFailDebug("missing callUIAdapter")
// return false
// }
// guard let frontmostViewController = UIApplication.shared.frontmostViewController else {
// owsFailDebug("could not identify frontmostViewController")
// return false
// }
//
// let showedAlert = SafetyNumberConfirmationAlert.presentAlertIfNecessary(recipientId: recipientId,
// confirmationText: CallStrings.confirmAndCallButtonTitle,
// contactsManager: self.contactsManager,
// completion: { didConfirmIdentity in
// if didConfirmIdentity {
// _ = self.initiateCall(recipientId: recipientId, isVideo: isVideo)
// }
// })
// guard !showedAlert else {
// return false
// }
//
// frontmostViewController.ows_ask(forMicrophonePermissions: { granted in
// guard granted == true else {
// Logger.warn("aborting due to missing microphone permissions.")
// OWSAlerts.showNoMicrophonePermissionAlert()
// return
// }
// callUIAdapter.startAndShowOutgoingCall(recipientId: recipientId, hasLocalVideo: isVideo)
// })
//
// return true
// }
//}

View File

@ -1,243 +0,0 @@
////
//// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
////
//
//import Foundation
//import SignalUtilitiesKit
//
//public enum CallState: String {
// case idle
// case dialing
// case answering
// case remoteRinging
// case localRinging
// case connected
// case reconnecting
// case localFailure // terminal
// case localHangup // terminal
// case remoteHangup // terminal
// case remoteBusy // terminal
//}
//
//enum CallDirection {
// case outgoing, incoming
//}
//
//// All Observer methods will be invoked from the main thread.
//protocol CallObserver: class {
// func stateDidChange(call: SignalCall, state: CallState)
// func hasLocalVideoDidChange(call: SignalCall, hasLocalVideo: Bool)
// func muteDidChange(call: SignalCall, isMuted: Bool)
// func holdDidChange(call: SignalCall, isOnHold: Bool)
// func audioSourceDidChange(call: SignalCall, audioSource: AudioSource?)
//}
//
///**
// * Data model for a WebRTC backed voice/video call.
// *
// * This class' state should only be accessed on the main queue.
// */
//@objc public class SignalCall: NSObject {
//
// var observers = [Weak<CallObserver>]()
//
// @objc
// let remotePhoneNumber: String
//
// var isTerminated: Bool {
// switch state {
// case .localFailure, .localHangup, .remoteHangup, .remoteBusy:
// return true
// case .idle, .dialing, .answering, .remoteRinging, .localRinging, .connected, .reconnecting:
// return false
// }
// }
//
// // Signal Service identifier for this Call. Used to coordinate the call across remote clients.
// let signalingId: UInt64
//
// let direction: CallDirection
//
// // Distinguishes between calls locally, e.g. in CallKit
// @objc
// let localId: UUID
//
// let thread: TSContactThread
//
// var callRecord: TSCall? {
// didSet {
// AssertIsOnMainThread()
// assert(oldValue == nil)
//
// updateCallRecordType()
// }
// }
//
// var hasLocalVideo = false {
// didSet {
// AssertIsOnMainThread()
//
// for observer in observers {
// observer.value?.hasLocalVideoDidChange(call: self, hasLocalVideo: hasLocalVideo)
// }
// }
// }
//
// var state: CallState {
// didSet {
// AssertIsOnMainThread()
// Logger.debug("state changed: \(oldValue) -> \(self.state) for call: \(self.identifiersForLogs)")
//
// // Update connectedDate
// if case .connected = self.state {
// // if it's the first time we've connected (not a reconnect)
// if connectedDate == nil {
// connectedDate = NSDate()
// }
// }
//
// updateCallRecordType()
//
// for observer in observers {
// observer.value?.stateDidChange(call: self, state: state)
// }
// }
// }
//
// var isMuted = false {
// didSet {
// AssertIsOnMainThread()
//
// Logger.debug("muted changed: \(oldValue) -> \(self.isMuted)")
//
// for observer in observers {
// observer.value?.muteDidChange(call: self, isMuted: isMuted)
// }
// }
// }
//
// let audioActivity: AudioActivity
//
// var audioSource: AudioSource? = nil {
// didSet {
// AssertIsOnMainThread()
// Logger.debug("audioSource changed: \(String(describing: oldValue)) -> \(String(describing: audioSource))")
//
// for observer in observers {
// observer.value?.audioSourceDidChange(call: self, audioSource: audioSource)
// }
// }
// }
//
// var isSpeakerphoneEnabled: Bool {
// guard let audioSource = self.audioSource else {
// return false
// }
//
// return audioSource.isBuiltInSpeaker
// }
//
// var isOnHold = false {
// didSet {
// AssertIsOnMainThread()
// Logger.debug("isOnHold changed: \(oldValue) -> \(self.isOnHold)")
//
// for observer in observers {
// observer.value?.holdDidChange(call: self, isOnHold: isOnHold)
// }
// }
// }
//
// var connectedDate: NSDate?
//
// var error: CallError?
//
// // MARK: Initializers and Factory Methods
//
// init(direction: CallDirection, localId: UUID, signalingId: UInt64, state: CallState, remotePhoneNumber: String) {
// self.direction = direction
// self.localId = localId
// self.signalingId = signalingId
// self.state = state
// self.remotePhoneNumber = remotePhoneNumber
// self.thread = TSContactThread.getOrCreateThread(contactId: remotePhoneNumber)
// self.audioActivity = AudioActivity(audioDescription: "[SignalCall] with \(remotePhoneNumber)", behavior: .call)
// }
//
// // A string containing the three identifiers for this call.
// var identifiersForLogs: String {
// return "{\(remotePhoneNumber), \(localId), \(signalingId)}"
// }
//
// class func outgoingCall(localId: UUID, remotePhoneNumber: String) -> SignalCall {
// return SignalCall(direction: .outgoing, localId: localId, signalingId: newCallSignalingId(), state: .dialing, remotePhoneNumber: remotePhoneNumber)
// }
//
// class func incomingCall(localId: UUID, remotePhoneNumber: String, signalingId: UInt64) -> SignalCall {
// return SignalCall(direction: .incoming, localId: localId, signalingId: signalingId, state: .answering, remotePhoneNumber: remotePhoneNumber)
// }
//
// // -
//
// func addObserverAndSyncState(observer: CallObserver) {
// AssertIsOnMainThread()
//
// observers.append(Weak(value: observer))
//
// // Synchronize observer with current call state
// observer.stateDidChange(call: self, state: state)
// }
//
// func removeObserver(_ observer: CallObserver) {
// AssertIsOnMainThread()
//
// while let index = observers.firstIndex(where: { $0.value === observer }) {
// observers.remove(at: index)
// }
// }
//
// func removeAllObservers() {
// AssertIsOnMainThread()
//
// observers = []
// }
//
// private func updateCallRecordType() {
// AssertIsOnMainThread()
//
// guard let callRecord = self.callRecord else {
// return
// }
//
// // Mark incomplete calls as completed if call has connected.
// if state == .connected &&
// callRecord.callType == RPRecentCallTypeOutgoingIncomplete {
// callRecord.updateCallType(RPRecentCallTypeOutgoing)
// }
// if state == .connected &&
// callRecord.callType == RPRecentCallTypeIncomingIncomplete {
// callRecord.updateCallType(RPRecentCallTypeIncoming)
// }
// }
//
// // MARK: Equatable
//
// static func == (lhs: SignalCall, rhs: SignalCall) -> Bool {
// return lhs.localId == rhs.localId
// }
//
// static func newCallSignalingId() -> UInt64 {
// return UInt64.ows_random()
// }
//
// // This method should only be called when the call state is "connected".
// func connectionDuration() -> TimeInterval {
// return -connectedDate!.timeIntervalSinceNow
// }
//}
//
//fileprivate extension UInt64 {
// static func ows_random() -> UInt64 {
// return Cryptography.randomUInt64()
// }
//}

View File

@ -1,28 +0,0 @@
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
import Foundation
import SignalUtilitiesKit
import SignalUtilitiesKit
@objc(OWSWebRTCCallMessageHandler)
public class WebRTCCallMessageHandler: NSObject/*, OWSCallMessageHandler*/ {
// MARK: Initializers
@objc
public override init()
{
super.init()
SwiftSingletons.register(self)
}
// MARK: - Dependencies
private var accountManager : AccountManager
{
return AppEnvironment.shared.accountManager
}
}

View File

@ -1,310 +0,0 @@
final class LinkDeviceVC : BaseVC, UIPageViewControllerDataSource, UIPageViewControllerDelegate, OWSQRScannerDelegate {
private let pageVC = UIPageViewController(transitionStyle: .scroll, navigationOrientation: .horizontal, options: nil)
private var pages: [UIViewController] = []
private var targetVCIndex: Int?
var delegate: LinkDeviceVCDelegate?
// MARK: Components
private lazy var tabBar: TabBar = {
let tabs = [
TabBar.Tab(title: NSLocalizedString("vc_link_device_enter_session_id_tab_title", comment: "")) { [weak self] in
guard let self = self else { return }
self.pageVC.setViewControllers([ self.pages[0] ], direction: .forward, animated: false, completion: nil)
},
TabBar.Tab(title: NSLocalizedString("vc_link_device_scan_qr_code_tab_title", comment: "")) { [weak self] in
guard let self = self else { return }
self.pageVC.setViewControllers([ self.pages[1] ], direction: .forward, animated: false, completion: nil)
}
]
return TabBar(tabs: tabs)
}()
private lazy var enterPublicKeyVC: EnterPublicKeyVC = {
let result = EnterPublicKeyVC()
result.linkDeviceVC = self
return result
}()
private lazy var scanQRCodePlaceholderVC: ScanQRCodePlaceholderVC = {
let result = ScanQRCodePlaceholderVC()
result.linkDeviceVC = self
return result
}()
private lazy var scanQRCodeWrapperVC: ScanQRCodeWrapperVC = {
let message = NSLocalizedString("vc_link_device_scan_qr_code_explanation", comment: "")
let result = ScanQRCodeWrapperVC(message: message)
result.delegate = self
return result
}()
// MARK: Lifecycle
override func viewDidLoad() {
super.viewDidLoad()
setUpGradientBackground()
setUpNavBarStyle()
setNavBarTitle(NSLocalizedString("vc_link_device_title", comment: ""))
let navigationBar = navigationController!.navigationBar
// Set up navigation bar buttons
let closeButton = UIBarButtonItem(image: #imageLiteral(resourceName: "X"), style: .plain, target: self, action: #selector(close))
closeButton.tintColor = Colors.text
navigationItem.leftBarButtonItem = closeButton
// Set up page VC
let hasCameraAccess = (AVCaptureDevice.authorizationStatus(for: .video) == .authorized)
pages = [ enterPublicKeyVC, (hasCameraAccess ? scanQRCodeWrapperVC : scanQRCodePlaceholderVC) ]
pageVC.dataSource = self
pageVC.delegate = self
pageVC.setViewControllers([ enterPublicKeyVC ], direction: .forward, animated: false, completion: nil)
// Set up tab bar
view.addSubview(tabBar)
tabBar.pin(.leading, to: .leading, of: view)
let tabBarInset: CGFloat
if #available(iOS 13, *) {
tabBarInset = navigationBar.height()
} else {
tabBarInset = 0
}
tabBar.pin(.top, to: .top, of: view, withInset: tabBarInset)
view.pin(.trailing, to: .trailing, of: tabBar)
// Set up page VC constraints
let pageVCView = pageVC.view!
view.addSubview(pageVCView)
pageVCView.pin(.leading, to: .leading, of: view)
pageVCView.pin(.top, to: .bottom, of: tabBar)
view.pin(.trailing, to: .trailing, of: pageVCView)
view.pin(.bottom, to: .bottom, of: pageVCView)
let screen = UIScreen.main.bounds
pageVCView.set(.width, to: screen.width)
let height: CGFloat
if #available(iOS 13, *) {
height = navigationController!.view.bounds.height - navigationBar.height() - Values.tabBarHeight
} else {
let statusBarHeight = UIApplication.shared.statusBarFrame.height
height = navigationController!.view.bounds.height - navigationBar.height() - Values.tabBarHeight - statusBarHeight
}
pageVCView.set(.height, to: height)
enterPublicKeyVC.constrainHeight(to: height)
scanQRCodePlaceholderVC.constrainHeight(to: height)
}
// MARK: General
func pageViewController(_ pageViewController: UIPageViewController, viewControllerBefore viewController: UIViewController) -> UIViewController? {
guard let index = pages.firstIndex(of: viewController), index != 0 else { return nil }
return pages[index - 1]
}
func pageViewController(_ pageViewController: UIPageViewController, viewControllerAfter viewController: UIViewController) -> UIViewController? {
guard let index = pages.firstIndex(of: viewController), index != (pages.count - 1) else { return nil }
return pages[index + 1]
}
fileprivate func handleCameraAccessGranted() {
pages[1] = scanQRCodeWrapperVC
pageVC.setViewControllers([ scanQRCodeWrapperVC ], direction: .forward, animated: false, completion: nil)
}
// MARK: Updating
func pageViewController(_ pageViewController: UIPageViewController, willTransitionTo pendingViewControllers: [UIViewController]) {
guard let targetVC = pendingViewControllers.first, let index = pages.firstIndex(of: targetVC) else { return }
targetVCIndex = index
}
func pageViewController(_ pageViewController: UIPageViewController, didFinishAnimating isFinished: Bool, previousViewControllers: [UIViewController], transitionCompleted isCompleted: Bool) {
guard isCompleted, let index = targetVCIndex else { return }
tabBar.selectTab(at: index)
}
// MARK: Interaction
@objc private func close() {
dismiss(animated: true, completion: nil)
}
func controller(_ controller: OWSQRCodeScanningViewController, didDetectQRCodeWith string: String) {
let hexEncodedPublicKey = string
requestDeviceLink(with: hexEncodedPublicKey)
}
fileprivate func requestDeviceLink(with hexEncodedPublicKey: String) {
dismiss(animated: true) {
self.delegate?.requestDeviceLink(with: hexEncodedPublicKey)
}
}
}
private final class EnterPublicKeyVC : UIViewController {
weak var linkDeviceVC: LinkDeviceVC!
private var spacer1HeightConstraint: NSLayoutConstraint!
private var spacer2HeightConstraint: NSLayoutConstraint!
private var spacer3HeightConstraint: NSLayoutConstraint!
private var bottomConstraint: NSLayoutConstraint!
private var linkButtonBottomOffsetConstraint: NSLayoutConstraint!
// MARK: Components
private lazy var publicKeyTextField: TextField = {
if isIPhone6OrSmaller {
return TextField(placeholder: NSLocalizedString("vc_enter_session_id_text_field_hint", comment: ""), customHeight: 56, customVerticalInset: 12)
} else {
return TextField(placeholder: NSLocalizedString("vc_enter_session_id_text_field_hint", comment: ""))
}
}()
// MARK: Lifecycle
override func viewDidLoad() {
// Remove background color
view.backgroundColor = .clear
// Set up title label
let titleLabel = UILabel()
titleLabel.textColor = Colors.text
titleLabel.font = .boldSystemFont(ofSize: isIPhone6OrSmaller ? Values.largeFontSize : Values.veryLargeFontSize)
titleLabel.text = NSLocalizedString("vc_enter_session_id_title", comment: "")
titleLabel.numberOfLines = 0
titleLabel.lineBreakMode = .byWordWrapping
// Set up explanation label
let explanationLabel = UILabel()
explanationLabel.textColor = Colors.text
explanationLabel.font = .systemFont(ofSize: Values.smallFontSize)
explanationLabel.text = NSLocalizedString("vc_enter_session_id_explanation", comment: "")
explanationLabel.numberOfLines = 0
explanationLabel.lineBreakMode = .byWordWrapping
// Link button
let linkButton = Button(style: .prominentOutline, size: .large)
linkButton.setTitle(NSLocalizedString("continue_2", comment: ""), for: UIControl.State.normal)
linkButton.titleLabel!.font = .boldSystemFont(ofSize: Values.mediumFontSize)
linkButton.addTarget(self, action: #selector(requestDeviceLink), for: UIControl.Event.touchUpInside)
let linkButtonContainer = UIView()
linkButtonContainer.addSubview(linkButton)
linkButton.pin(.leading, to: .leading, of: linkButtonContainer, withInset: Values.massiveSpacing)
linkButton.pin(.top, to: .top, of: linkButtonContainer)
linkButtonContainer.pin(.trailing, to: .trailing, of: linkButton, withInset: Values.massiveSpacing)
linkButtonContainer.pin(.bottom, to: .bottom, of: linkButton)
// Set up spacers
let topSpacer = UIView.vStretchingSpacer()
let spacer1 = UIView()
spacer1HeightConstraint = spacer1.set(.height, to: isIPhone6OrSmaller ? Values.smallSpacing : Values.veryLargeSpacing)
let spacer2 = UIView()
spacer2HeightConstraint = spacer2.set(.height, to: isIPhone6OrSmaller ? Values.smallSpacing : Values.veryLargeSpacing)
let bottomSpacer = UIView.vStretchingSpacer()
let linkButtonBottomOffsetSpacer = UIView()
linkButtonBottomOffsetConstraint = linkButtonBottomOffsetSpacer.set(.height, to: Values.onboardingButtonBottomOffset)
// Set up top stack view
let topStackView = UIStackView(arrangedSubviews: [ titleLabel, spacer1, explanationLabel, spacer2, publicKeyTextField ])
topStackView.axis = .vertical
// Set up top stack view container
let topStackViewContainer = UIView()
topStackViewContainer.addSubview(topStackView)
topStackView.pin(.leading, to: .leading, of: topStackViewContainer, withInset: Values.veryLargeSpacing)
topStackView.pin(.top, to: .top, of: topStackViewContainer)
topStackViewContainer.pin(.trailing, to: .trailing, of: topStackView, withInset: Values.veryLargeSpacing)
topStackViewContainer.pin(.bottom, to: .bottom, of: topStackView)
// Set up stack view
let stackView = UIStackView(arrangedSubviews: [ topSpacer, topStackViewContainer, bottomSpacer, linkButtonContainer, linkButtonBottomOffsetSpacer ])
stackView.axis = .vertical
stackView.alignment = .fill
view.addSubview(stackView)
stackView.pin(.leading, to: .leading, of: view)
stackView.pin(.top, to: .top, of: view)
stackView.pin(.trailing, to: .trailing, of: view)
bottomConstraint = stackView.pin(.bottom, to: .bottom, of: view)
topSpacer.heightAnchor.constraint(equalTo: bottomSpacer.heightAnchor, multiplier: 1).isActive = true
// Set up width constraint
view.set(.width, to: UIScreen.main.bounds.width)
// Dismiss keyboard on tap
let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(dismissKeyboard))
view.addGestureRecognizer(tapGestureRecognizer)
// Listen to keyboard notifications
let notificationCenter = NotificationCenter.default
notificationCenter.addObserver(self, selector: #selector(handleKeyboardWillChangeFrameNotification(_:)), name: UIResponder.keyboardWillChangeFrameNotification, object: nil)
notificationCenter.addObserver(self, selector: #selector(handleKeyboardWillHideNotification(_:)), name: UIResponder.keyboardWillHideNotification, object: nil)
}
deinit {
NotificationCenter.default.removeObserver(self)
}
// MARK: General
func constrainHeight(to height: CGFloat) {
view.set(.height, to: height)
}
@objc private func dismissKeyboard() {
publicKeyTextField.resignFirstResponder()
}
// MARK: Updating
@objc private func handleKeyboardWillChangeFrameNotification(_ notification: Notification) {
guard let newHeight = (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue.size.height else { return }
bottomConstraint.constant = -newHeight
linkButtonBottomOffsetConstraint.constant = isIPhone6OrSmaller ? Values.smallSpacing : Values.largeSpacing
spacer1HeightConstraint.constant = isIPhone6OrSmaller ? Values.smallSpacing : Values.mediumSpacing
spacer2HeightConstraint.constant = isIPhone6OrSmaller ? Values.smallSpacing : Values.mediumSpacing
UIView.animate(withDuration: 0.25) {
self.view.layoutIfNeeded()
}
}
@objc private func handleKeyboardWillHideNotification(_ notification: Notification) {
bottomConstraint.constant = 0
linkButtonBottomOffsetConstraint.constant = Values.onboardingButtonBottomOffset
spacer1HeightConstraint.constant = isIPhone6OrSmaller ? Values.smallSpacing : Values.veryLargeSpacing
spacer2HeightConstraint.constant = isIPhone6OrSmaller ? Values.smallSpacing : Values.veryLargeSpacing
UIView.animate(withDuration: 0.25) {
self.view.layoutIfNeeded()
}
}
// MARK: Interaction
@objc private func requestDeviceLink() {
let hexEncodedPublicKey = publicKeyTextField.text?.trimmingCharacters(in: .whitespaces) ?? ""
linkDeviceVC.requestDeviceLink(with: hexEncodedPublicKey)
}
}
private final class ScanQRCodePlaceholderVC : UIViewController {
weak var linkDeviceVC: LinkDeviceVC!
override func viewDidLoad() {
// Remove background color
view.backgroundColor = .clear
// Set up explanation label
let explanationLabel = UILabel()
explanationLabel.textColor = Colors.text
explanationLabel.font = .systemFont(ofSize: Values.smallFontSize)
explanationLabel.text = NSLocalizedString("vc_scan_qr_code_camera_access_explanation", comment: "")
explanationLabel.numberOfLines = 0
explanationLabel.textAlignment = .center
explanationLabel.lineBreakMode = .byWordWrapping
// Set up call to action button
let callToActionButton = UIButton()
callToActionButton.titleLabel!.font = .boldSystemFont(ofSize: Values.mediumFontSize)
callToActionButton.setTitleColor(Colors.accent, for: UIControl.State.normal)
callToActionButton.setTitle(NSLocalizedString("vc_scan_qr_code_grant_camera_access_button_title", comment: ""), for: UIControl.State.normal)
callToActionButton.addTarget(self, action: #selector(requestCameraAccess), for: UIControl.Event.touchUpInside)
// Set up stack view
let stackView = UIStackView(arrangedSubviews: [ explanationLabel, callToActionButton ])
stackView.axis = .vertical
stackView.spacing = Values.mediumSpacing
stackView.alignment = .center
// Set up constraints
view.set(.width, to: UIScreen.main.bounds.width)
view.addSubview(stackView)
stackView.pin(.leading, to: .leading, of: view, withInset: Values.massiveSpacing)
view.pin(.trailing, to: .trailing, of: stackView, withInset: Values.massiveSpacing)
let verticalCenteringConstraint = stackView.center(.vertical, in: view)
verticalCenteringConstraint.constant = -16 // Makes things appear centered visually
}
func constrainHeight(to height: CGFloat) {
view.set(.height, to: height)
}
@objc private func requestCameraAccess() {
ows_ask(forCameraPermissions: { [weak self] hasCameraAccess in
if hasCameraAccess {
self?.linkDeviceVC.handleCameraAccessGranted()
} else {
// Do nothing
}
})
}
}

View File

@ -1,5 +0,0 @@
protocol LinkDeviceVCDelegate {
func requestDeviceLink(with hexEncodedPublicKey: String)
}

View File

@ -167,10 +167,6 @@ private final class ViewMyQRCodeVC : UIViewController {
let explanationLabel = UILabel()
explanationLabel.textColor = Colors.text
explanationLabel.font = .systemFont(ofSize: Values.mediumFontSize)
// let text = NSLocalizedString("This is your QR code. Other users can scan it to start a session with you.", comment: "")
// let attributedText = NSMutableAttributedString(string: text)
// attributedText.addAttribute(.font, value: UIFont.boldSystemFont(ofSize: Values.mediumFontSize), range: (text as NSString).range(of: "your unique public QR code"))
// explanationLabel.attributedText = attributedText
explanationLabel.text = NSLocalizedString("vc_view_my_qr_code_explanation", comment: "")
explanationLabel.numberOfLines = 0
explanationLabel.textAlignment = .center

View File

@ -2,8 +2,9 @@ import SessionUtilitiesKit
// TODO: Implementation
public final class AttachmentDownloadJob : NSObject, Job, NSCoding { // NSObject/NSCoding conformance is needed for YapDatabase compatibility
public final class AttachmentDownloadJob : NSObject, Job, NSCoding { // NSObject/NSCoding conformance is needed for YapDatabase compatibility
public var delegate: JobDelegate?
public var id: String?
public var failureCount: UInt = 0
// MARK: Settings

View File

@ -2,8 +2,9 @@ import SessionUtilitiesKit
// TODO: Implementation
public final class AttachmentUploadJob : NSObject, Job, NSCoding { // NSObject/NSCoding conformance is needed for YapDatabase compatibility
public final class AttachmentUploadJob : NSObject, Job, NSCoding { // NSObject/NSCoding conformance is needed for YapDatabase compatibility
public var delegate: JobDelegate?
public var id: String?
public var failureCount: UInt = 0
// MARK: Settings

View File

@ -1,7 +1,8 @@
@objc(SNJob)
public protocol Job : class {
public protocol Job : class, NSCoding {
var delegate: JobDelegate? { get set }
var id: String? { get set }
var failureCount: UInt { get set }
static var maxFailureCount: UInt { get }

View File

@ -6,6 +6,7 @@ public final class JobQueue : NSObject, JobDelegate {
@objc public static let shared = JobQueue()
@objc public func add(_ job: Job, using transaction: Any) {
job.id = UUID().uuidString
Configuration.shared.storage.persist(job, using: transaction)
job.delegate = self
job.execute()

View File

@ -1,8 +1,9 @@
import SessionUtilitiesKit
public final class MessageReceiveJob : NSObject, Job, NSCoding { // NSObject/NSCoding conformance is needed for YapDatabase compatibility
public final class MessageReceiveJob : NSObject, Job, NSCoding { // NSObject/NSCoding conformance is needed for YapDatabase compatibility
public var delegate: JobDelegate?
private let data: Data
public var id: String?
private let messageServerID: UInt64?
public var failureCount: UInt = 0
@ -17,31 +18,35 @@ public final class MessageReceiveJob : NSObject, Job, NSCoding { // NSObject/NS
// MARK: Coding
public init?(coder: NSCoder) {
guard let data = coder.decodeObject(forKey: "data") as! Data? else { return nil }
guard let data = coder.decodeObject(forKey: "data") as! Data?,
let id = coder.decodeObject(forKey: "id") as! String? else { return nil }
self.data = data
self.id = id
self.messageServerID = coder.decodeObject(forKey: "messageServerUD") as! UInt64?
self.failureCount = coder.decodeObject(forKey: "failureCount") as! UInt? ?? 0
}
public func encode(with coder: NSCoder) {
coder.encode(data, forKey: "data")
coder.encode(id, forKey: "id")
coder.encode(messageServerID, forKey: "messageServerID")
coder.encode(failureCount, forKey: "failureCount")
}
// MARK: Running
public func execute() {
Configuration.shared.storage.with { transaction in // Intentionally capture self
Configuration.shared.storage.withAsync({ transaction in // Intentionally capture self
Threading.workQueue.async {
do {
let _ = try MessageReceiver.parse(self.data, messageServerID: self.messageServerID, using: transaction)
let message = try MessageReceiver.parse(self.data, using: transaction)
MessageReceiver.handle(message, messageServerID: self.messageServerID, using: transaction)
self.handleSuccess()
} catch {
SNLog("Couldn't parse message due to error: \(error).")
self.handleFailure(error: error)
}
}
}
}, completion: { })
}
private func handleSuccess() {

View File

@ -5,6 +5,7 @@ public final class MessageSendJob : NSObject, Job, NSCoding { // NSObject/NSCodi
public var delegate: JobDelegate?
private let message: Message
private let destination: Message.Destination
public var id: String?
public var failureCount: UInt = 0
// MARK: Settings
@ -22,7 +23,8 @@ public final class MessageSendJob : NSObject, Job, NSCoding { // NSObject/NSCodi
// MARK: Coding
public init?(coder: NSCoder) {
guard let message = coder.decodeObject(forKey: "message") as! Message?,
var rawDestination = coder.decodeObject(forKey: "destination") as! String? else { return nil }
var rawDestination = coder.decodeObject(forKey: "destination") as! String?,
let id = coder.decodeObject(forKey: "id") as! String? else { return nil }
self.message = message
if rawDestination.removePrefix("contact(") {
guard rawDestination.removeSuffix(")") else { return nil }
@ -41,11 +43,13 @@ public final class MessageSendJob : NSObject, Job, NSCoding { // NSObject/NSCodi
} else {
return nil
}
self.id = id
self.failureCount = coder.decodeObject(forKey: "failureCount") as! UInt? ?? 0
}
public func encode(with coder: NSCoder) {
coder.encode(message, forKey: "message")
coder.encode(id, forKey: "id")
switch destination {
case .contact(let publicKey): coder.encode("contact(\(publicKey))", forKey: "destination")
case .closedGroup(let groupPublicKey): coder.encode("closedGroup(\(groupPublicKey))", forKey: "destination")
@ -56,7 +60,7 @@ public final class MessageSendJob : NSObject, Job, NSCoding { // NSObject/NSCodi
// MARK: Running
public func execute() {
Configuration.shared.storage.with { transaction in // Intentionally capture self
Configuration.shared.storage.withAsync({ transaction in // Intentionally capture self
Threading.workQueue.async {
MessageSender.send(self.message, to: self.destination, using: transaction).done(on: Threading.workQueue) {
self.handleSuccess()
@ -65,7 +69,7 @@ public final class MessageSendJob : NSObject, Job, NSCoding { // NSObject/NSCodi
self.handleFailure(error: error)
}
}
}
}, completion: { })
}
private func handleSuccess() {

View File

@ -5,6 +5,7 @@ import SessionUtilitiesKit
public final class NotifyPNServerJob : NSObject, Job, NSCoding { // NSObject/NSCoding conformance is needed for YapDatabase compatibility
public var delegate: JobDelegate?
private let message: SnodeMessage
public var id: String?
public var failureCount: UInt = 0
// MARK: Settings
@ -17,13 +18,16 @@ public final class NotifyPNServerJob : NSObject, Job, NSCoding { // NSObject/NSC
// MARK: Coding
public init?(coder: NSCoder) {
guard let message = coder.decodeObject(forKey: "message") as! SnodeMessage? else { return nil }
guard let message = coder.decodeObject(forKey: "message") as! SnodeMessage?,
let id = coder.decodeObject(forKey: "id") as! String? else { return nil }
self.message = message
self.id = id
self.failureCount = coder.decodeObject(forKey: "failureCount") as! UInt? ?? 0
}
public func encode(with coder: NSCoder) {
coder.encode(message, forKey: "message")
coder.encode(id, forKey: "id")
coder.encode(failureCount, forKey: "failureCount")
}

View File

@ -22,7 +22,10 @@ public final class ClosedGroupUpdate : ControlMessage {
}
// MARK: Validation
public override var isValid: Bool { kind != nil }
public override var isValid: Bool {
guard super.isValid else { return false }
return kind != nil
}
// MARK: Coding
public required init?(coder: NSCoder) {
@ -83,7 +86,7 @@ public final class ClosedGroupUpdate : ControlMessage {
// MARK: Proto Conversion
public override class func fromProto(_ proto: SNProtoContent) -> ClosedGroupUpdate? {
fatalError("Not implemented.")
return nil
}
public override func toProto() -> SNProtoContent? {

View File

@ -11,7 +11,10 @@ public final class ExpirationTimerUpdate : ControlMessage {
}
// MARK: Validation
public override var isValid: Bool { duration != nil }
public override var isValid: Bool {
guard super.isValid else { return false }
return duration != nil
}
// MARK: Coding
public required init?(coder: NSCoder) {

View File

@ -12,6 +12,7 @@ public final class ReadReceipt : ControlMessage {
// MARK: Validation
public override var isValid: Bool {
guard super.isValid else { return false }
if let timestamps = timestamps, !timestamps.isEmpty { return true }
return false
}

View File

@ -14,7 +14,10 @@ public final class SessionRequest : ControlMessage {
}
// MARK: Validation
public override var isValid: Bool { preKeyBundle != nil }
public override var isValid: Bool {
guard super.isValid else { return false }
return preKeyBundle != nil
}
// MARK: Coding
public required init?(coder: NSCoder) {

View File

@ -26,7 +26,10 @@ public final class TypingIndicator : ControlMessage {
}
// MARK: Validation
public override var isValid: Bool { kind != nil }
public override var isValid: Bool {
guard super.isValid else { return false }
return kind != nil
}
// MARK: Initialization
public override init() { super.init() }

View File

@ -7,13 +7,18 @@ public class Message : NSObject, NSCoding { // NSObject/NSCoding conformance is
public var sentTimestamp: UInt64?
public var receivedTimestamp: UInt64?
public var recipient: String?
public var sender: String?
public class var ttl: UInt64 { 2 * 24 * 60 * 60 * 1000 }
public override init() { }
// MARK: Validation
public var isValid: Bool { true }
public var isValid: Bool {
if let sentTimestamp = sentTimestamp { guard sentTimestamp > 0 else { return false } }
if let receivedTimestamp = receivedTimestamp { guard receivedTimestamp > 0 else { return false } }
return sender != nil && recipient != nil
}
// MARK: Coding
public required init?(coder: NSCoder) {

View File

@ -14,6 +14,7 @@ public final class VisibleMessage : Message {
// MARK: Validation
public override var isValid: Bool {
guard super.isValid else { return false }
if !attachmentIDs.isEmpty { return true }
if let text = text?.trimmingCharacters(in: .whitespacesAndNewlines), !text.isEmpty { return true }
return false

View File

@ -8,6 +8,7 @@ internal enum MessageReceiver {
case unknownEnvelopeType
case noUserPublicKey
case noData
case senderBlocked
// Shared sender keys
case invalidGroupPublicKey
case noGroupPrivateKey
@ -21,6 +22,7 @@ internal enum MessageReceiver {
case .unknownEnvelopeType: return "Unknown envelope type."
case .noUserPublicKey: return "Couldn't find user key pair."
case .noData: return "Received an empty envelope."
case .senderBlocked: return "Received a message from a blocked user."
// Shared sender keys
case .invalidGroupPublicKey: return "Invalid group public key."
case .noGroupPrivateKey: return "Missing group private key."
@ -30,16 +32,19 @@ internal enum MessageReceiver {
}
}
internal static func parse(_ data: Data, messageServerID: UInt64?, using transaction: Any) throws -> Message {
internal static func parse(_ data: Data, using transaction: Any) throws -> Message {
// Parse the envelope
let envelope = try MessageWrapper.unwrap(data: data)
let envelope = try SNProtoEnvelope.parseData(data)
// Decrypt the contents
let plaintext: Data
let sender: String
switch envelope.type {
case .unidentifiedSender: (plaintext, _) = try decryptWithSignalProtocol(envelope: envelope, using: transaction)
case .closedGroupCiphertext: (plaintext, _) = try decryptWithSharedSenderKeys(envelope: envelope, using: transaction)
case .unidentifiedSender: (plaintext, sender) = try decryptWithSignalProtocol(envelope: envelope, using: transaction)
case .closedGroupCiphertext: (plaintext, sender) = try decryptWithSharedSenderKeys(envelope: envelope, using: transaction)
default: throw Error.unknownEnvelopeType
}
// Don't process the envelope any further if the sender is blocked
guard !Configuration.shared.storage.isBlocked(sender) else { throw Error.senderBlocked }
// Parse the proto
let proto: SNProtoContent
do {
@ -59,6 +64,8 @@ internal enum MessageReceiver {
return nil
}()
if let message = message {
message.sender = sender
message.recipient = Configuration.shared.storage.getUserPublicKey()
message.receivedTimestamp = NSDate.millisecondTimestamp()
guard message.isValid else { throw Error.invalidMessage }
return message
@ -66,4 +73,31 @@ internal enum MessageReceiver {
throw Error.unknownMessage
}
}
internal static func handle(_ message: Message, messageServerID: UInt64?, using transaction: Any) {
switch message {
case is ReadReceipt: break
case is SessionRequest: break
case is TypingIndicator: break
case is ClosedGroupUpdate: break
case is ExpirationTimerUpdate: break
case let message as VisibleMessage: handleVisibleMessage(message, using: transaction)
default: fatalError()
}
}
private static func handleVisibleMessage(_ message: VisibleMessage, using transaction: Any) {
let storage = Configuration.shared.storage
// Update profile if needed
if let profile = message.profile {
storage.updateProfile(for: message.sender!, from: profile, using: transaction)
}
// Persist the message
let (threadID, tsIncomingMessage) = storage.persist(message, using: transaction)
message.threadID = threadID
// Cancel any typing indicators
storage.cancelTypingIndicatorsIfNeeded(for: message.threadID!, senderPublicKey: message.sender!)
// Notify the user if needed
storage.notifyUserIfNeeded(for: tsIncomingMessage, threadID: threadID)
}
}

View File

@ -29,6 +29,7 @@ public enum MessageSender {
internal static func sendToSnodeDestination(_ destination: Message.Destination, message: Message, using transaction: Any) -> Promise<Void> {
message.sentTimestamp = NSDate.millisecondTimestamp()
message.sender = Configuration.shared.storage.getUserPublicKey()
switch destination {
case .contact(let publicKey): message.recipient = publicKey
case .closedGroup(let groupPublicKey): message.recipient = groupPublicKey

View File

@ -30,4 +30,10 @@ public protocol SessionMessagingKitStorageProtocol {
func getIDForMessage(withServerID serverID: UInt64) -> UInt64?
func setOpenGroupDisplayName(to displayName: String, for publicKey: String, on channel: UInt64, server: String, using transaction: Any)
func setLastProfilePictureUploadDate(_ date: Date) // Stored in user defaults so no transaction is needed
func isBlocked(_ publicKey: String) -> Bool
func updateProfile(for publicKey: String, from profile: VisibleMessage.Profile, using transaction: Any)
/// Returns the ID of the thread the message was stored under along with the `TSIncomingMessage` that was constructed.
func persist(_ message: VisibleMessage, using transaction: Any) -> (String, Any)
func cancelTypingIndicatorsIfNeeded(for threadID: String, senderPublicKey: String)
func notifyUserIfNeeded(for message: Any, threadID: String)
}

View File

@ -38,7 +38,7 @@ final class NotificationServiceExtension : UNNotificationServiceExtension {
decrypter.decryptEnvelope(envelope,
envelopeData: data,
successBlock: { result, transaction in
if let envelope = try? SSKProtoEnvelope.parseData(result.envelopeData) {
if let envelope = try? SNProtoEnvelope.parseData(result.envelopeData) {
messageManager.throws_processEnvelope(envelope, plaintextData: result.plaintextData, wasReceivedByUD: wasReceivedByUD, transaction: transaction, serverID: 0)
self.handleDecryptionResult(result: result, notificationContent: notificationContent, transaction: transaction)
} else {
@ -59,7 +59,7 @@ final class NotificationServiceExtension : UNNotificationServiceExtension {
/*
func handleDecryptionResult(result: OWSMessageDecryptResult, notificationContent: UNMutableNotificationContent, transaction: YapDatabaseReadWriteTransaction) {
let contentProto = try? SSKProtoContent.parseData(result.plaintextData!)
let contentProto = try? SNProtoContent.parseData(result.plaintextData!)
var thread: TSThread
var newNotificationBody = ""
let masterPublicKey = OWSPrimaryStorage.shared().getMasterHexEncodedPublicKey(for: result.source, in: transaction) ?? result.source
@ -72,7 +72,7 @@ final class NotificationServiceExtension : UNNotificationServiceExtension {
}
let senderName = OWSUserProfile.fetch(uniqueId: masterPublicKey, transaction: transaction)?.profileName ?? SSKEnvironment.shared.contactsManager.displayName(forPhoneIdentifier: masterPublicKey)
displayName = String(format: NotificationStrings.incomingGroupMessageTitleFormat, senderName, groupName)
let group: SSKProtoGroupContext = contentProto!.dataMessage!.group!
let group: SNProtoGroupContext = contentProto!.dataMessage!.group!
let oldGroupModel = (thread as! TSGroupThread).groupModel
let removedMembers = NSMutableSet(array: oldGroupModel.groupMemberIds)
let newGroupModel = TSGroupModel.init(title: group.name,
@ -185,7 +185,6 @@ final class NotificationServiceExtension : UNNotificationServiceExtension {
AppSetup.setupEnvironment(
appSpecificSingletonBlock: {
SSKEnvironment.shared.callMessageHandler = NoopCallMessageHandler()
SSKEnvironment.shared.notificationsManager = NoopNotificationsManager()
},
migrationCompletion: { [weak self] in
@ -208,7 +207,7 @@ final class NotificationServiceExtension : UNNotificationServiceExtension {
}
}
func wasReceivedByUD(envelope: SSKProtoEnvelope) -> Bool {
func wasReceivedByUD(envelope: SNProtoEnvelope) -> Bool {
return (envelope.type == .unidentifiedSender && (!envelope.hasSource || envelope.source!.count < 1))
}

View File

@ -82,7 +82,6 @@ public class ShareViewController: UIViewController, ShareViewDelegate, SAEFailed
// We shouldn't set up our environment until after we've consulted isReadyForAppExtensions.
AppSetup.setupEnvironment(appSpecificSingletonBlock: {
SSKEnvironment.shared.callMessageHandler = NoopCallMessageHandler()
SSKEnvironment.shared.notificationsManager = NoopNotificationsManager()
},
migrationCompletion: { [weak self] in

View File

@ -117,7 +117,6 @@
451A13B11E13DED2000A50FD /* AppNotifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 451A13B01E13DED2000A50FD /* AppNotifications.swift */; };
4520D8D51D417D8E00123472 /* Photos.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4520D8D41D417D8E00123472 /* Photos.framework */; };
4521C3C01F59F3BA00B4C582 /* TextFieldHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4521C3BF1F59F3BA00B4C582 /* TextFieldHelper.swift */; };
452C468F1E427E200087B011 /* OutboundCallInitiator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 452C468E1E427E200087B011 /* OutboundCallInitiator.swift */; };
452EC6DF205E9E30000E787C /* MediaGalleryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 452EC6DE205E9E30000E787C /* MediaGalleryViewController.swift */; };
4535186B1FC635DD00210559 /* ShareViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4535186A1FC635DD00210559 /* ShareViewController.swift */; };
4535186E1FC635DD00210559 /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4535186C1FC635DD00210559 /* MainInterface.storyboard */; };
@ -127,8 +126,6 @@
454A84042059C787008B8C75 /* MediaTileViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 454A84032059C787008B8C75 /* MediaTileViewController.swift */; };
455A16DD1F1FEA0000F86704 /* Metal.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 455A16DB1F1FEA0000F86704 /* Metal.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
455A16DE1F1FEA0000F86704 /* MetalKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 455A16DC1F1FEA0000F86704 /* MetalKit.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
4574A5D61DD6704700C6B692 /* CallService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4574A5D51DD6704700C6B692 /* CallService.swift */; };
45794E861E00620000066731 /* CallUIAdapter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45794E851E00620000066731 /* CallUIAdapter.swift */; };
457F671B20746193000EABCD /* QuotedReplyPreview.swift in Sources */ = {isa = PBXBuildFile; fileRef = 457F671A20746193000EABCD /* QuotedReplyPreview.swift */; };
45847E871E4283C30080EAB3 /* Intents.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 45847E861E4283C30080EAB3 /* Intents.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
458DE9D61DEE3FD00071BB03 /* PeerConnectionClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = 458DE9D51DEE3FD00071BB03 /* PeerConnectionClient.swift */; };
@ -165,20 +162,14 @@
45BD60821DE9547E00A8F436 /* Contacts.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 45BD60811DE9547E00A8F436 /* Contacts.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
45C0DC1B1E68FE9000E04C47 /* UIApplication+OWS.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45C0DC1A1E68FE9000E04C47 /* UIApplication+OWS.swift */; };
45C0DC1E1E69011F00E04C47 /* UIStoryboard+OWS.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45C0DC1D1E69011F00E04C47 /* UIStoryboard+OWS.swift */; };
45C9DEB81DF4E35A0065CA84 /* WebRTCCallMessageHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45C9DEB71DF4E35A0065CA84 /* WebRTCCallMessageHandler.swift */; };
45CB2FA81CB7146C00E1B343 /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 45CB2FA71CB7146C00E1B343 /* Launch Screen.storyboard */; };
45CD81EF1DC030E7004C9430 /* SyncPushTokensJob.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45CD81EE1DC030E7004C9430 /* SyncPushTokensJob.swift */; };
45D231771DC7E8F10034FA89 /* SessionResetJob.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45D231761DC7E8F10034FA89 /* SessionResetJob.swift */; };
45DF5DF21DDB843F00C936C7 /* CompareSafetyNumbersActivity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45DF5DF11DDB843F00C936C7 /* CompareSafetyNumbersActivity.swift */; };
45E5A6991F61E6DE001E4A8A /* MarqueeLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45E5A6981F61E6DD001E4A8A /* MarqueeLabel.swift */; };
45F170BB1E2FC5D3003FC1F2 /* CallAudioService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45F170BA1E2FC5D3003FC1F2 /* CallAudioService.swift */; };
45F32C222057297A00A300D5 /* MediaDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 45B9EE9B200E91FB005D2F2D /* MediaDetailViewController.m */; };
45F32C232057297A00A300D5 /* MediaPageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45F32C1D205718B000A300D5 /* MediaPageViewController.swift */; };
45F32C242057297A00A300D5 /* MessageDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34CA1C261F7156F300E51C51 /* MessageDetailViewController.swift */; };
45F659731E1BD99C00444429 /* CallKitCallUIAdaptee.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45F659721E1BD99C00444429 /* CallKitCallUIAdaptee.swift */; };
45F659821E1BE77000444429 /* NonCallKitCallUIAdaptee.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45F659811E1BE77000444429 /* NonCallKitCallUIAdaptee.swift */; };
45FBC5C81DF8575700E9B410 /* CallKitCallManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45FBC59A1DF8575700E9B410 /* CallKitCallManager.swift */; };
45FBC5D11DF8592E00E9B410 /* SignalCall.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45FBC5D01DF8592E00E9B410 /* SignalCall.swift */; };
4C04392A220A9EC800BAEA63 /* VoiceNoteLock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C043929220A9EC800BAEA63 /* VoiceNoteLock.swift */; };
4C090A1B210FD9C7001FD7F9 /* HapticFeedback.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C090A1A210FD9C7001FD7F9 /* HapticFeedback.swift */; };
4C1885D2218F8E1C00B67051 /* PhotoGridViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C1885D1218F8E1C00B67051 /* PhotoGridViewCell.swift */; };
@ -256,8 +247,6 @@
B84664F5235022F30083A1CD /* MentionUtilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = B84664F4235022F30083A1CD /* MentionUtilities.swift */; };
B85357BF23A1AE0800AAF6CD /* SeedReminderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B85357BE23A1AE0800AAF6CD /* SeedReminderView.swift */; };
B85357C323A1BD1200AAF6CD /* SeedVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = B85357C223A1BD1200AAF6CD /* SeedVC.swift */; };
B85357C523A1F13800AAF6CD /* LinkDeviceVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = B85357C423A1F13800AAF6CD /* LinkDeviceVC.swift */; };
B85357C723A1FB5100AAF6CD /* LinkDeviceVCDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B85357C623A1FB5100AAF6CD /* LinkDeviceVCDelegate.swift */; };
B8544E3323D50E4900299F14 /* AppearanceUtilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8544E3223D50E4900299F14 /* AppearanceUtilities.swift */; };
B86BD08423399ACF000F5AE3 /* Modal.swift in Sources */ = {isa = PBXBuildFile; fileRef = B86BD08323399ACF000F5AE3 /* Modal.swift */; };
B86BD08623399CEF000F5AE3 /* SeedModal.swift in Sources */ = {isa = PBXBuildFile; fileRef = B86BD08523399CEF000F5AE3 /* SeedModal.swift */; };
@ -368,7 +357,6 @@
C33FDC58255A582000E217F9 /* ReverseDispatchQueue.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDA9E255A57FF00E217F9 /* ReverseDispatchQueue.swift */; };
C33FDC5A255A582000E217F9 /* OWSRecipientIdentity.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDAA0255A57FF00E217F9 /* OWSRecipientIdentity.h */; settings = {ATTRIBUTES = (Public, ); }; };
C33FDC5B255A582000E217F9 /* TSYapDatabaseObject.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDAA1255A57FF00E217F9 /* TSYapDatabaseObject.h */; settings = {ATTRIBUTES = (Public, ); }; };
C33FDC5E255A582000E217F9 /* SSKProto.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDAA4255A57FF00E217F9 /* SSKProto.swift */; };
C33FDC61255A582000E217F9 /* OWSPrimaryStorage+SignedPreKeyStore.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDAA7255A57FF00E217F9 /* OWSPrimaryStorage+SignedPreKeyStore.h */; settings = {ATTRIBUTES = (Public, ); }; };
C33FDC62255A582000E217F9 /* BuildConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDAA8255A57FF00E217F9 /* BuildConfiguration.swift */; };
C33FDC64255A582000E217F9 /* NSObject+Casting.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDAAA255A580000E217F9 /* NSObject+Casting.m */; };
@ -387,7 +375,6 @@
C33FDC7C255A582000E217F9 /* TSAttachment.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDAC2255A580200E217F9 /* TSAttachment.m */; };
C33FDC7D255A582000E217F9 /* OWSDispatch.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDAC3255A580200E217F9 /* OWSDispatch.m */; };
C33FDC7E255A582000E217F9 /* TSAttachmentStream.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDAC4255A580200E217F9 /* TSAttachmentStream.m */; };
C33FDC80255A582000E217F9 /* Fingerprint.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDAC6255A580200E217F9 /* Fingerprint.pb.swift */; };
C33FDC87255A582000E217F9 /* SSKJobRecord.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDACD255A580200E217F9 /* SSKJobRecord.m */; };
C33FDC89255A582000E217F9 /* OWSAttachmentDownloads.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDACF255A580300E217F9 /* OWSAttachmentDownloads.h */; settings = {ATTRIBUTES = (Public, ); }; };
C33FDC8D255A582000E217F9 /* TSThread.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDAD3255A580300E217F9 /* TSThread.h */; settings = {ATTRIBUTES = (Public, ); }; };
@ -423,7 +410,6 @@
C33FDCB8255A582000E217F9 /* OWSStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDAFE255A580600E217F9 /* OWSStorage.h */; settings = {ATTRIBUTES = (Public, ); }; };
C33FDCB9255A582000E217F9 /* DisplayNameUtilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDAFF255A580600E217F9 /* DisplayNameUtilities.swift */; };
C33FDCBB255A582000E217F9 /* AppReadiness.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDB01255A580700E217F9 /* AppReadiness.h */; settings = {ATTRIBUTES = (Public, ); }; };
C33FDCBC255A582000E217F9 /* TSCall.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDB02255A580700E217F9 /* TSCall.h */; settings = {ATTRIBUTES = (Public, ); }; };
C33FDCBD255A582000E217F9 /* OWSPrimaryStorage+SessionStore.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDB03255A580700E217F9 /* OWSPrimaryStorage+SessionStore.h */; settings = {ATTRIBUTES = (Public, ); }; };
C33FDCC1255A582000E217F9 /* OWSBackupFragment.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDB07255A580700E217F9 /* OWSBackupFragment.m */; };
C33FDCC3255A582000E217F9 /* NSError+MessageSending.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDB09255A580700E217F9 /* NSError+MessageSending.m */; };
@ -434,16 +420,13 @@
C33FDCCE255A582000E217F9 /* OWSMath.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDB14255A580800E217F9 /* OWSMath.h */; settings = {ATTRIBUTES = (Public, ); }; };
C33FDCD1255A582000E217F9 /* FunctionalUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDB17255A580800E217F9 /* FunctionalUtil.m */; };
C33FDCD3255A582000E217F9 /* GroupUtilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDB19255A580900E217F9 /* GroupUtilities.swift */; };
C33FDCD4255A582000E217F9 /* OWSPrimaryStorage+Calling.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDB1A255A580900E217F9 /* OWSPrimaryStorage+Calling.h */; settings = {ATTRIBUTES = (Public, ); }; };
C33FDCD6255A582000E217F9 /* UIImage+OWS.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDB1C255A580900E217F9 /* UIImage+OWS.h */; settings = {ATTRIBUTES = (Public, ); }; };
C33FDCD7255A582000E217F9 /* OWSReadReceiptManager.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDB1D255A580900E217F9 /* OWSReadReceiptManager.h */; settings = {ATTRIBUTES = (Public, ); }; };
C33FDCD8255A582000E217F9 /* OWSIncomingMessageFinder.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDB1E255A580900E217F9 /* OWSIncomingMessageFinder.m */; };
C33FDCDA255A582000E217F9 /* TSDatabaseSecondaryIndexes.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDB20255A580900E217F9 /* TSDatabaseSecondaryIndexes.m */; };
C33FDCDC255A582000E217F9 /* OWSMediaUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDB22255A580900E217F9 /* OWSMediaUtils.swift */; };
C33FDCDF255A582000E217F9 /* TSDatabaseSecondaryIndexes.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDB25255A580900E217F9 /* TSDatabaseSecondaryIndexes.h */; settings = {ATTRIBUTES = (Public, ); }; };
C33FDCE0255A582000E217F9 /* FingerprintProto.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDB26255A580A00E217F9 /* FingerprintProto.swift */; };
C33FDCE3255A582000E217F9 /* NSData+Image.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDB29255A580A00E217F9 /* NSData+Image.h */; settings = {ATTRIBUTES = (Public, ); }; };
C33FDCE4255A582000E217F9 /* OWSIncompleteCallsJob.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDB2A255A580A00E217F9 /* OWSIncompleteCallsJob.h */; settings = {ATTRIBUTES = (Public, ); }; };
C33FDCE5255A582000E217F9 /* OWSProvisioningCipher.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDB2B255A580A00E217F9 /* OWSProvisioningCipher.m */; };
C33FDCE6255A582000E217F9 /* TSDatabaseView.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDB2C255A580A00E217F9 /* TSDatabaseView.h */; settings = {ATTRIBUTES = (Public, ); }; };
C33FDCE9255A582000E217F9 /* ContactsManagerProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDB2F255A580A00E217F9 /* ContactsManagerProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
@ -520,7 +503,6 @@
C33FDD4F255A582000E217F9 /* Storage+Collections.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDB95255A581300E217F9 /* Storage+Collections.swift */; };
C33FDD53255A582000E217F9 /* OWSPrimaryStorage+keyFromIntLong.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDB99255A581300E217F9 /* OWSPrimaryStorage+keyFromIntLong.m */; };
C33FDD56255A582000E217F9 /* TSIncomingMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDB9C255A581300E217F9 /* TSIncomingMessage.h */; settings = {ATTRIBUTES = (Public, ); }; };
C33FDD57255A582000E217F9 /* OWSCallMessageHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDB9D255A581300E217F9 /* OWSCallMessageHandler.h */; settings = {ATTRIBUTES = (Public, ); }; };
C33FDD58255A582000E217F9 /* TSAttachmentPointer.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDB9E255A581400E217F9 /* TSAttachmentPointer.m */; };
C33FDD5A255A582000E217F9 /* TSStorageHeaders.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDBA0255A581400E217F9 /* TSStorageHeaders.h */; settings = {ATTRIBUTES = (Public, ); }; };
C33FDD5B255A582000E217F9 /* OWSOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDBA1255A581400E217F9 /* OWSOperation.h */; settings = {ATTRIBUTES = (Public, ); }; };
@ -553,7 +535,6 @@
C33FDD90255A582000E217F9 /* OWSUploadOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDBD6255A581900E217F9 /* OWSUploadOperation.h */; settings = {ATTRIBUTES = (Public, ); }; };
C33FDD91255A582000E217F9 /* OWSMessageUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDBD7255A581900E217F9 /* OWSMessageUtils.m */; };
C33FDD92255A582000E217F9 /* SignalIOS.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDBD8255A581900E217F9 /* SignalIOS.pb.swift */; };
C33FDD94255A582000E217F9 /* Dictionary+Description.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDBDA255A581900E217F9 /* Dictionary+Description.swift */; };
C33FDD97255A582000E217F9 /* OWSDisappearingMessagesJob.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDBDD255A581900E217F9 /* OWSDisappearingMessagesJob.m */; };
C33FDD98255A582000E217F9 /* LokiPushNotificationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDBDE255A581900E217F9 /* LokiPushNotificationManager.swift */; };
C33FDD9B255A582000E217F9 /* LKGroupUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDBE1255A581A00E217F9 /* LKGroupUtilities.m */; };
@ -562,15 +543,12 @@
C33FDDA5255A582000E217F9 /* OWSBlockingManager.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDBEB255A581B00E217F9 /* OWSBlockingManager.h */; settings = {ATTRIBUTES = (Public, ); }; };
C33FDDA6255A582000E217F9 /* OWSRecipientIdentity.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDBEC255A581B00E217F9 /* OWSRecipientIdentity.m */; };
C33FDDA9255A582000E217F9 /* TSStorageKeys.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDBEF255A581B00E217F9 /* TSStorageKeys.h */; settings = {ATTRIBUTES = (Public, ); }; };
C33FDDAA255A582000E217F9 /* LokiDatabaseUtilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDBF0255A581B00E217F9 /* LokiDatabaseUtilities.swift */; };
C33FDDAB255A582000E217F9 /* OWSIdentityManager.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDBF1255A581B00E217F9 /* OWSIdentityManager.h */; settings = {ATTRIBUTES = (Public, ); }; };
C33FDDAE255A582000E217F9 /* DisplayNameUtilities2.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDBF4255A581B00E217F9 /* DisplayNameUtilities2.swift */; };
C33FDDB0255A582000E217F9 /* NSURLSessionDataTask+StatusCode.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDBF6255A581C00E217F9 /* NSURLSessionDataTask+StatusCode.h */; settings = {ATTRIBUTES = (Public, ); }; };
C33FDDB1255A582000E217F9 /* OWSIncompleteCallsJob.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDBF7255A581C00E217F9 /* OWSIncompleteCallsJob.m */; };
C33FDDB2255A582000E217F9 /* NSArray+OWS.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDBF8255A581C00E217F9 /* NSArray+OWS.h */; settings = {ATTRIBUTES = (Public, ); }; };
C33FDDB3255A582000E217F9 /* OWSError.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDBF9255A581C00E217F9 /* OWSError.h */; settings = {ATTRIBUTES = (Public, ); }; };
C33FDDB5255A582000E217F9 /* Storage+PublicChats.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDBFB255A581C00E217F9 /* Storage+PublicChats.swift */; };
C33FDDB7255A582000E217F9 /* OWSPrimaryStorage+Calling.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDBFD255A581C00E217F9 /* OWSPrimaryStorage+Calling.m */; };
C33FDDB8255A582000E217F9 /* NSSet+Functional.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDBFE255A581C00E217F9 /* NSSet+Functional.h */; settings = {ATTRIBUTES = (Public, ); }; };
C33FDDBB255A582000E217F9 /* TSGroupThread.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDC01255A581C00E217F9 /* TSGroupThread.m */; };
C33FDDBC255A582000E217F9 /* OWSPrimaryStorage.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDC02255A581D00E217F9 /* OWSPrimaryStorage.m */; };
@ -588,7 +566,6 @@
C33FDDD2255A582000E217F9 /* TSAttachmentPointer.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDC18255A581F00E217F9 /* TSAttachmentPointer.h */; settings = {ATTRIBUTES = (Public, ); }; };
C33FDDD3255A582000E217F9 /* OWSQueues.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDC19255A581F00E217F9 /* OWSQueues.h */; settings = {ATTRIBUTES = (Public, ); }; };
C33FDDD5255A582000E217F9 /* OWSBackgroundTask.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDC1B255A581F00E217F9 /* OWSBackgroundTask.m */; };
C33FDDD6255A582000E217F9 /* TSCall.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDC1C255A581F00E217F9 /* TSCall.m */; };
C33FDDD8255A582000E217F9 /* OWSUploadOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDC1E255A581F00E217F9 /* OWSUploadOperation.m */; };
C33FDDD9255A582000E217F9 /* LokiSessionRestorationImplementation.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDC1F255A581F00E217F9 /* LokiSessionRestorationImplementation.swift */; };
C33FDEF8255A656D00E217F9 /* Promise+Delaying.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3C2A5D32553860900C340D1 /* Promise+Delaying.swift */; };
@ -669,7 +646,6 @@
C38EF292255B6D86007E1867 /* VersionMigrations.m in Sources */ = {isa = PBXBuildFile; fileRef = C38EF286255B6D85007E1867 /* VersionMigrations.m */; };
C38EF293255B6D86007E1867 /* AppSetup.m in Sources */ = {isa = PBXBuildFile; fileRef = C38EF287255B6D85007E1867 /* AppSetup.m */; };
C38EF294255B6D86007E1867 /* OWSSounds.h in Headers */ = {isa = PBXBuildFile; fileRef = C38EF288255B6D85007E1867 /* OWSSounds.h */; settings = {ATTRIBUTES = (Public, ); }; };
C38EF295255B6D86007E1867 /* NoopCallMessageHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = C38EF289255B6D85007E1867 /* NoopCallMessageHandler.swift */; };
C38EF297255B6D86007E1867 /* OWSSounds.m in Sources */ = {isa = PBXBuildFile; fileRef = C38EF28B255B6D86007E1867 /* OWSSounds.m */; };
C38EF2A5255B6D93007E1867 /* Identicon+ObjC.swift in Sources */ = {isa = PBXBuildFile; fileRef = C38EF2A2255B6D93007E1867 /* Identicon+ObjC.swift */; };
C38EF2A6255B6D93007E1867 /* PlaceholderIcon.swift in Sources */ = {isa = PBXBuildFile; fileRef = C38EF2A3255B6D93007E1867 /* PlaceholderIcon.swift */; };
@ -677,8 +653,6 @@
C38EF2B3255B6D9C007E1867 /* UIViewController+Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = C38EF2B1255B6D9C007E1867 /* UIViewController+Utilities.swift */; };
C38EF2B4255B6D9C007E1867 /* UIView+Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = C38EF2B2255B6D9C007E1867 /* UIView+Utilities.swift */; };
C38EF2C2255B6DA6007E1867 /* TSUnreadIndicatorInteraction.h in Headers */ = {isa = PBXBuildFile; fileRef = C38EF2BE255B6DA6007E1867 /* TSUnreadIndicatorInteraction.h */; settings = {ATTRIBUTES = (Public, ); }; };
C38EF2C3255B6DA6007E1867 /* OWSContactOffersInteraction.h in Headers */ = {isa = PBXBuildFile; fileRef = C38EF2BF255B6DA6007E1867 /* OWSContactOffersInteraction.h */; settings = {ATTRIBUTES = (Public, ); }; };
C38EF2C4255B6DA6007E1867 /* OWSContactOffersInteraction.m in Sources */ = {isa = PBXBuildFile; fileRef = C38EF2C0255B6DA6007E1867 /* OWSContactOffersInteraction.m */; };
C38EF2C5255B6DA6007E1867 /* TSUnreadIndicatorInteraction.m in Sources */ = {isa = PBXBuildFile; fileRef = C38EF2C1255B6DA6007E1867 /* TSUnreadIndicatorInteraction.m */; };
C38EF2D4255B6DAF007E1867 /* OWSProfileManager.m in Sources */ = {isa = PBXBuildFile; fileRef = C38EF2CF255B6DAE007E1867 /* OWSProfileManager.m */; };
C38EF2D6255B6DAF007E1867 /* OWSUserProfile.m in Sources */ = {isa = PBXBuildFile; fileRef = C38EF2D1255B6DAF007E1867 /* OWSUserProfile.m */; };
@ -829,6 +803,7 @@
C3A722922558C8940043A11F /* OpenGroupAPIDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3A722912558C8940043A11F /* OpenGroupAPIDelegate.swift */; };
C3A7229C2558E4310043A11F /* OpenGroupMessage+Conversion.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3A7229B2558E4310043A11F /* OpenGroupMessage+Conversion.swift */; };
C3AABDDF2553ECF00042FF4C /* Array+Description.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3C2A5D12553860800C340D1 /* Array+Description.swift */; };
C3B7845D25649DA600ADB2E7 /* TSIncomingMessage+Conversion.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3B7845C25649DA600ADB2E7 /* TSIncomingMessage+Conversion.swift */; };
C3BBE0762554CDA60050F1E3 /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3BBE0752554CDA60050F1E3 /* Configuration.swift */; };
C3BBE0802554CDD70050F1E3 /* Storage.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3BBE07F2554CDD70050F1E3 /* Storage.swift */; };
C3BBE0A72554D4DE0050F1E3 /* Promise+Retrying.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3C2A5D62553860B00C340D1 /* Promise+Retrying.swift */; };
@ -951,6 +926,7 @@
C3DFFAC623E96F0D0058DAF8 /* Sheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3DFFAC523E96F0D0058DAF8 /* Sheet.swift */; };
C3E5C2FA251DBABB0040DFFC /* EditClosedGroupVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3E5C2F9251DBABB0040DFFC /* EditClosedGroupVC.swift */; };
C3E7134F251C867C009649BB /* Sodium+Conversion.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3E7134E251C867C009649BB /* Sodium+Conversion.swift */; };
C3EEA017256487B300C338BC /* LokiDatabaseUtilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3EEA016256487B300C338BC /* LokiDatabaseUtilities.swift */; };
C3F0A530255C80BC007BE2A3 /* NoopNotificationsManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3F0A52F255C80BC007BE2A3 /* NoopNotificationsManager.swift */; };
C3F0A5EC255C970D007BE2A3 /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3F0A5EB255C970D007BE2A3 /* Configuration.swift */; };
C3F0A5FE255C988A007BE2A3 /* Storage+Shared.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3F0A5FD255C988A007BE2A3 /* Storage+Shared.swift */; };
@ -1232,7 +1208,6 @@
451A13B01E13DED2000A50FD /* AppNotifications.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = AppNotifications.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
4520D8D41D417D8E00123472 /* Photos.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Photos.framework; path = System/Library/Frameworks/Photos.framework; sourceTree = SDKROOT; };
4521C3BF1F59F3BA00B4C582 /* TextFieldHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextFieldHelper.swift; sourceTree = "<group>"; };
452C468E1E427E200087B011 /* OutboundCallInitiator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OutboundCallInitiator.swift; sourceTree = "<group>"; };
452EC6DE205E9E30000E787C /* MediaGalleryViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaGalleryViewController.swift; sourceTree = "<group>"; };
453518681FC635DD00210559 /* SessionShareExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = SessionShareExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; };
4535186A1FC635DD00210559 /* ShareViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareViewController.swift; sourceTree = "<group>"; };
@ -1243,8 +1218,6 @@
454A84032059C787008B8C75 /* MediaTileViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaTileViewController.swift; sourceTree = "<group>"; };
455A16DB1F1FEA0000F86704 /* Metal.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Metal.framework; path = System/Library/Frameworks/Metal.framework; sourceTree = SDKROOT; };
455A16DC1F1FEA0000F86704 /* MetalKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MetalKit.framework; path = System/Library/Frameworks/MetalKit.framework; sourceTree = SDKROOT; };
4574A5D51DD6704700C6B692 /* CallService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = CallService.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
45794E851E00620000066731 /* CallUIAdapter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CallUIAdapter.swift; sourceTree = "<group>"; };
457F671A20746193000EABCD /* QuotedReplyPreview.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuotedReplyPreview.swift; sourceTree = "<group>"; };
45847E861E4283C30080EAB3 /* Intents.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Intents.framework; path = System/Library/Frameworks/Intents.framework; sourceTree = SDKROOT; };
458DE9D51DEE3FD00071BB03 /* PeerConnectionClient.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PeerConnectionClient.swift; sourceTree = "<group>"; };
@ -1285,18 +1258,12 @@
45BD60811DE9547E00A8F436 /* Contacts.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Contacts.framework; path = System/Library/Frameworks/Contacts.framework; sourceTree = SDKROOT; };
45C0DC1A1E68FE9000E04C47 /* UIApplication+OWS.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIApplication+OWS.swift"; sourceTree = "<group>"; };
45C0DC1D1E69011F00E04C47 /* UIStoryboard+OWS.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIStoryboard+OWS.swift"; sourceTree = "<group>"; };
45C9DEB71DF4E35A0065CA84 /* WebRTCCallMessageHandler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WebRTCCallMessageHandler.swift; sourceTree = "<group>"; };
45CB2FA71CB7146C00E1B343 /* Launch Screen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = "Launch Screen.storyboard"; path = "Session/Signal/Launch Screen.storyboard"; sourceTree = SOURCE_ROOT; };
45CD81EE1DC030E7004C9430 /* SyncPushTokensJob.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SyncPushTokensJob.swift; sourceTree = "<group>"; };
45D231761DC7E8F10034FA89 /* SessionResetJob.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SessionResetJob.swift; sourceTree = "<group>"; };
45DF5DF11DDB843F00C936C7 /* CompareSafetyNumbersActivity.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CompareSafetyNumbersActivity.swift; sourceTree = "<group>"; };
45E5A6981F61E6DD001E4A8A /* MarqueeLabel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MarqueeLabel.swift; sourceTree = "<group>"; };
45F170BA1E2FC5D3003FC1F2 /* CallAudioService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CallAudioService.swift; sourceTree = "<group>"; };
45F32C1D205718B000A300D5 /* MediaPageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = MediaPageViewController.swift; path = Session/Signal/MediaPageViewController.swift; sourceTree = SOURCE_ROOT; };
45F659721E1BD99C00444429 /* CallKitCallUIAdaptee.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CallKitCallUIAdaptee.swift; sourceTree = "<group>"; };
45F659811E1BE77000444429 /* NonCallKitCallUIAdaptee.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NonCallKitCallUIAdaptee.swift; sourceTree = "<group>"; };
45FBC59A1DF8575700E9B410 /* CallKitCallManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CallKitCallManager.swift; sourceTree = "<group>"; };
45FBC5D01DF8592E00E9B410 /* SignalCall.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SignalCall.swift; sourceTree = "<group>"; };
4C043929220A9EC800BAEA63 /* VoiceNoteLock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VoiceNoteLock.swift; sourceTree = "<group>"; };
4C090A1A210FD9C7001FD7F9 /* HapticFeedback.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HapticFeedback.swift; sourceTree = "<group>"; };
4C1885D1218F8E1C00B67051 /* PhotoGridViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PhotoGridViewCell.swift; sourceTree = "<group>"; };
@ -1403,8 +1370,6 @@
B847570023D568EB00759540 /* SignalServiceKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = SignalServiceKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
B85357BE23A1AE0800AAF6CD /* SeedReminderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SeedReminderView.swift; sourceTree = "<group>"; };
B85357C223A1BD1200AAF6CD /* SeedVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SeedVC.swift; sourceTree = "<group>"; };
B85357C423A1F13800AAF6CD /* LinkDeviceVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LinkDeviceVC.swift; sourceTree = "<group>"; };
B85357C623A1FB5100AAF6CD /* LinkDeviceVCDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LinkDeviceVCDelegate.swift; sourceTree = "<group>"; };
B8544E3023D16CA500299F14 /* DeviceUtilities.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceUtilities.swift; sourceTree = "<group>"; };
B8544E3223D50E4900299F14 /* AppearanceUtilities.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppearanceUtilities.swift; sourceTree = "<group>"; };
B86BD08323399ACF000F5AE3 /* Modal.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Modal.swift; sourceTree = "<group>"; };
@ -1509,7 +1474,6 @@
C33FDA9E255A57FF00E217F9 /* ReverseDispatchQueue.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReverseDispatchQueue.swift; sourceTree = "<group>"; };
C33FDAA0255A57FF00E217F9 /* OWSRecipientIdentity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSRecipientIdentity.h; sourceTree = "<group>"; };
C33FDAA1255A57FF00E217F9 /* TSYapDatabaseObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSYapDatabaseObject.h; sourceTree = "<group>"; };
C33FDAA4255A57FF00E217F9 /* SSKProto.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SSKProto.swift; sourceTree = "<group>"; };
C33FDAA7255A57FF00E217F9 /* OWSPrimaryStorage+SignedPreKeyStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "OWSPrimaryStorage+SignedPreKeyStore.h"; sourceTree = "<group>"; };
C33FDAA8255A57FF00E217F9 /* BuildConfiguration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BuildConfiguration.swift; sourceTree = "<group>"; };
C33FDAAA255A580000E217F9 /* NSObject+Casting.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+Casting.m"; sourceTree = "<group>"; };
@ -1528,7 +1492,6 @@
C33FDAC2255A580200E217F9 /* TSAttachment.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSAttachment.m; sourceTree = "<group>"; };
C33FDAC3255A580200E217F9 /* OWSDispatch.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSDispatch.m; sourceTree = "<group>"; };
C33FDAC4255A580200E217F9 /* TSAttachmentStream.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSAttachmentStream.m; sourceTree = "<group>"; };
C33FDAC6255A580200E217F9 /* Fingerprint.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Fingerprint.pb.swift; sourceTree = "<group>"; };
C33FDACD255A580200E217F9 /* SSKJobRecord.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSKJobRecord.m; sourceTree = "<group>"; };
C33FDACF255A580300E217F9 /* OWSAttachmentDownloads.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSAttachmentDownloads.h; sourceTree = "<group>"; };
C33FDAD3255A580300E217F9 /* TSThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSThread.h; sourceTree = "<group>"; };
@ -1564,7 +1527,6 @@
C33FDAFE255A580600E217F9 /* OWSStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSStorage.h; sourceTree = "<group>"; };
C33FDAFF255A580600E217F9 /* DisplayNameUtilities.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DisplayNameUtilities.swift; sourceTree = "<group>"; };
C33FDB01255A580700E217F9 /* AppReadiness.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppReadiness.h; sourceTree = "<group>"; };
C33FDB02255A580700E217F9 /* TSCall.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSCall.h; sourceTree = "<group>"; };
C33FDB03255A580700E217F9 /* OWSPrimaryStorage+SessionStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "OWSPrimaryStorage+SessionStore.h"; sourceTree = "<group>"; };
C33FDB07255A580700E217F9 /* OWSBackupFragment.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSBackupFragment.m; sourceTree = "<group>"; };
C33FDB09255A580700E217F9 /* NSError+MessageSending.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSError+MessageSending.m"; sourceTree = "<group>"; };
@ -1575,16 +1537,13 @@
C33FDB14255A580800E217F9 /* OWSMath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSMath.h; sourceTree = "<group>"; };
C33FDB17255A580800E217F9 /* FunctionalUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FunctionalUtil.m; sourceTree = "<group>"; };
C33FDB19255A580900E217F9 /* GroupUtilities.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GroupUtilities.swift; sourceTree = "<group>"; };
C33FDB1A255A580900E217F9 /* OWSPrimaryStorage+Calling.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "OWSPrimaryStorage+Calling.h"; sourceTree = "<group>"; };
C33FDB1C255A580900E217F9 /* UIImage+OWS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+OWS.h"; sourceTree = "<group>"; };
C33FDB1D255A580900E217F9 /* OWSReadReceiptManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSReadReceiptManager.h; sourceTree = "<group>"; };
C33FDB1E255A580900E217F9 /* OWSIncomingMessageFinder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSIncomingMessageFinder.m; sourceTree = "<group>"; };
C33FDB20255A580900E217F9 /* TSDatabaseSecondaryIndexes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSDatabaseSecondaryIndexes.m; sourceTree = "<group>"; };
C33FDB22255A580900E217F9 /* OWSMediaUtils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OWSMediaUtils.swift; sourceTree = "<group>"; };
C33FDB25255A580900E217F9 /* TSDatabaseSecondaryIndexes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSDatabaseSecondaryIndexes.h; sourceTree = "<group>"; };
C33FDB26255A580A00E217F9 /* FingerprintProto.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FingerprintProto.swift; sourceTree = "<group>"; };
C33FDB29255A580A00E217F9 /* NSData+Image.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData+Image.h"; sourceTree = "<group>"; };
C33FDB2A255A580A00E217F9 /* OWSIncompleteCallsJob.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSIncompleteCallsJob.h; sourceTree = "<group>"; };
C33FDB2B255A580A00E217F9 /* OWSProvisioningCipher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSProvisioningCipher.m; sourceTree = "<group>"; };
C33FDB2C255A580A00E217F9 /* TSDatabaseView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSDatabaseView.h; sourceTree = "<group>"; };
C33FDB2F255A580A00E217F9 /* ContactsManagerProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContactsManagerProtocol.h; sourceTree = "<group>"; };
@ -1661,7 +1620,6 @@
C33FDB95255A581300E217F9 /* Storage+Collections.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Storage+Collections.swift"; sourceTree = "<group>"; };
C33FDB99255A581300E217F9 /* OWSPrimaryStorage+keyFromIntLong.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "OWSPrimaryStorage+keyFromIntLong.m"; sourceTree = "<group>"; };
C33FDB9C255A581300E217F9 /* TSIncomingMessage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSIncomingMessage.h; sourceTree = "<group>"; };
C33FDB9D255A581300E217F9 /* OWSCallMessageHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSCallMessageHandler.h; sourceTree = "<group>"; };
C33FDB9E255A581400E217F9 /* TSAttachmentPointer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSAttachmentPointer.m; sourceTree = "<group>"; };
C33FDBA0255A581400E217F9 /* TSStorageHeaders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSStorageHeaders.h; sourceTree = "<group>"; };
C33FDBA1255A581400E217F9 /* OWSOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSOperation.h; sourceTree = "<group>"; };
@ -1694,7 +1652,6 @@
C33FDBD6255A581900E217F9 /* OWSUploadOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSUploadOperation.h; sourceTree = "<group>"; };
C33FDBD7255A581900E217F9 /* OWSMessageUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSMessageUtils.m; sourceTree = "<group>"; };
C33FDBD8255A581900E217F9 /* SignalIOS.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SignalIOS.pb.swift; sourceTree = "<group>"; };
C33FDBDA255A581900E217F9 /* Dictionary+Description.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Dictionary+Description.swift"; sourceTree = "<group>"; };
C33FDBDD255A581900E217F9 /* OWSDisappearingMessagesJob.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSDisappearingMessagesJob.m; sourceTree = "<group>"; };
C33FDBDE255A581900E217F9 /* LokiPushNotificationManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LokiPushNotificationManager.swift; sourceTree = "<group>"; };
C33FDBE1255A581A00E217F9 /* LKGroupUtilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LKGroupUtilities.m; sourceTree = "<group>"; };
@ -1703,15 +1660,12 @@
C33FDBEB255A581B00E217F9 /* OWSBlockingManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSBlockingManager.h; sourceTree = "<group>"; };
C33FDBEC255A581B00E217F9 /* OWSRecipientIdentity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSRecipientIdentity.m; sourceTree = "<group>"; };
C33FDBEF255A581B00E217F9 /* TSStorageKeys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSStorageKeys.h; sourceTree = "<group>"; };
C33FDBF0255A581B00E217F9 /* LokiDatabaseUtilities.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LokiDatabaseUtilities.swift; sourceTree = "<group>"; };
C33FDBF1255A581B00E217F9 /* OWSIdentityManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSIdentityManager.h; sourceTree = "<group>"; };
C33FDBF4255A581B00E217F9 /* DisplayNameUtilities2.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DisplayNameUtilities2.swift; sourceTree = "<group>"; };
C33FDBF6255A581C00E217F9 /* NSURLSessionDataTask+StatusCode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSURLSessionDataTask+StatusCode.h"; sourceTree = "<group>"; };
C33FDBF7255A581C00E217F9 /* OWSIncompleteCallsJob.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSIncompleteCallsJob.m; sourceTree = "<group>"; };
C33FDBF8255A581C00E217F9 /* NSArray+OWS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSArray+OWS.h"; sourceTree = "<group>"; };
C33FDBF9255A581C00E217F9 /* OWSError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSError.h; sourceTree = "<group>"; };
C33FDBFB255A581C00E217F9 /* Storage+PublicChats.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Storage+PublicChats.swift"; sourceTree = "<group>"; };
C33FDBFD255A581C00E217F9 /* OWSPrimaryStorage+Calling.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "OWSPrimaryStorage+Calling.m"; sourceTree = "<group>"; };
C33FDBFE255A581C00E217F9 /* NSSet+Functional.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSSet+Functional.h"; sourceTree = "<group>"; };
C33FDC01255A581C00E217F9 /* TSGroupThread.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSGroupThread.m; sourceTree = "<group>"; };
C33FDC02255A581D00E217F9 /* OWSPrimaryStorage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSPrimaryStorage.m; sourceTree = "<group>"; };
@ -1729,7 +1683,6 @@
C33FDC18255A581F00E217F9 /* TSAttachmentPointer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSAttachmentPointer.h; sourceTree = "<group>"; };
C33FDC19255A581F00E217F9 /* OWSQueues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSQueues.h; sourceTree = "<group>"; };
C33FDC1B255A581F00E217F9 /* OWSBackgroundTask.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSBackgroundTask.m; sourceTree = "<group>"; };
C33FDC1C255A581F00E217F9 /* TSCall.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSCall.m; sourceTree = "<group>"; };
C33FDC1E255A581F00E217F9 /* OWSUploadOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSUploadOperation.m; sourceTree = "<group>"; };
C33FDC1F255A581F00E217F9 /* LokiSessionRestorationImplementation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LokiSessionRestorationImplementation.swift; sourceTree = "<group>"; };
C3471ECA2555356A00297E91 /* MessageSender+Encryption.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MessageSender+Encryption.swift"; sourceTree = "<group>"; };
@ -1781,7 +1734,7 @@
C38EF23C255B6D66007E1867 /* UIColor+OWS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIColor+OWS.h"; path = "SignalUtilitiesKit/UI/UIColor+OWS.h"; sourceTree = SOURCE_ROOT; };
C38EF23D255B6D66007E1867 /* UIView+OWS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIView+OWS.h"; path = "SignalUtilitiesKit/UI/UIView+OWS.h"; sourceTree = SOURCE_ROOT; };
C38EF23E255B6D66007E1867 /* UIView+OWS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIView+OWS.m"; path = "SignalUtilitiesKit/UI/UIView+OWS.m"; sourceTree = SOURCE_ROOT; };
C38EF23F255B6D67007E1867 /* NSAttributedString+OWS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSAttributedString+OWS.h"; path = "SignalUtilitiesKit/NSAttributedString+OWS.h"; sourceTree = SOURCE_ROOT; };
C38EF23F255B6D67007E1867 /* NSAttributedString+OWS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSAttributedString+OWS.h"; path = "SignalUtilitiesKit/Utilities/NSAttributedString+OWS.h"; sourceTree = SOURCE_ROOT; };
C38EF240255B6D67007E1867 /* UIView+OWS.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "UIView+OWS.swift"; path = "SignalUtilitiesKit/UI/UIView+OWS.swift"; sourceTree = SOURCE_ROOT; };
C38EF241255B6D67007E1867 /* Collection+OWS.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "Collection+OWS.swift"; path = "SignalUtilitiesKit/Utilities/Collection+OWS.swift"; sourceTree = SOURCE_ROOT; };
C38EF242255B6D67007E1867 /* UIColor+OWS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIColor+OWS.m"; path = "SignalUtilitiesKit/UI/UIColor+OWS.m"; sourceTree = SOURCE_ROOT; };
@ -1799,7 +1752,6 @@
C38EF286255B6D85007E1867 /* VersionMigrations.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = VersionMigrations.m; path = SignalUtilitiesKit/VersionMigrations.m; sourceTree = SOURCE_ROOT; };
C38EF287255B6D85007E1867 /* AppSetup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppSetup.m; path = SignalUtilitiesKit/AppSetup.m; sourceTree = SOURCE_ROOT; };
C38EF288255B6D85007E1867 /* OWSSounds.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OWSSounds.h; path = SignalUtilitiesKit/OWSSounds.h; sourceTree = SOURCE_ROOT; };
C38EF289255B6D85007E1867 /* NoopCallMessageHandler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = NoopCallMessageHandler.swift; path = SignalUtilitiesKit/NoopCallMessageHandler.swift; sourceTree = SOURCE_ROOT; };
C38EF28B255B6D86007E1867 /* OWSSounds.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OWSSounds.m; path = SignalUtilitiesKit/OWSSounds.m; sourceTree = SOURCE_ROOT; };
C38EF2A2255B6D93007E1867 /* Identicon+ObjC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "Identicon+ObjC.swift"; path = "SignalUtilitiesKit/UI/Identicon+ObjC.swift"; sourceTree = SOURCE_ROOT; };
C38EF2A3255B6D93007E1867 /* PlaceholderIcon.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = PlaceholderIcon.swift; path = SignalUtilitiesKit/UI/PlaceholderIcon.swift; sourceTree = SOURCE_ROOT; };
@ -1807,8 +1759,6 @@
C38EF2B1255B6D9C007E1867 /* UIViewController+Utilities.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "UIViewController+Utilities.swift"; path = "SignalUtilitiesKit/UI/UIViewController+Utilities.swift"; sourceTree = SOURCE_ROOT; };
C38EF2B2255B6D9C007E1867 /* UIView+Utilities.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "UIView+Utilities.swift"; path = "SignalUtilitiesKit/UI/UIView+Utilities.swift"; sourceTree = SOURCE_ROOT; };
C38EF2BE255B6DA6007E1867 /* TSUnreadIndicatorInteraction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TSUnreadIndicatorInteraction.h; path = SignalUtilitiesKit/TSUnreadIndicatorInteraction.h; sourceTree = SOURCE_ROOT; };
C38EF2BF255B6DA6007E1867 /* OWSContactOffersInteraction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OWSContactOffersInteraction.h; path = SignalUtilitiesKit/OWSContactOffersInteraction.h; sourceTree = SOURCE_ROOT; };
C38EF2C0255B6DA6007E1867 /* OWSContactOffersInteraction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OWSContactOffersInteraction.m; path = SignalUtilitiesKit/OWSContactOffersInteraction.m; sourceTree = SOURCE_ROOT; };
C38EF2C1255B6DA6007E1867 /* TSUnreadIndicatorInteraction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TSUnreadIndicatorInteraction.m; path = SignalUtilitiesKit/TSUnreadIndicatorInteraction.m; sourceTree = SOURCE_ROOT; };
C38EF2CF255B6DAE007E1867 /* OWSProfileManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OWSProfileManager.m; path = "SignalUtilitiesKit/Remove Later/OWSProfileManager.m"; sourceTree = SOURCE_ROOT; };
C38EF2D1255B6DAF007E1867 /* OWSUserProfile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OWSUserProfile.m; path = "SignalUtilitiesKit/Remove Later/OWSUserProfile.m"; sourceTree = SOURCE_ROOT; };
@ -1968,6 +1918,7 @@
C3A7229B2558E4310043A11F /* OpenGroupMessage+Conversion.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "OpenGroupMessage+Conversion.swift"; sourceTree = "<group>"; };
C3AA6BB824CE8F1B002358B6 /* Migrating Translations from Android.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = "Migrating Translations from Android.md"; path = "Meta/Translations/Migrating Translations from Android.md"; sourceTree = "<group>"; };
C3AECBEA24EF5244005743DE /* fa */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fa; path = fa.lproj/Localizable.strings; sourceTree = "<group>"; };
C3B7845C25649DA600ADB2E7 /* TSIncomingMessage+Conversion.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "TSIncomingMessage+Conversion.swift"; sourceTree = "<group>"; };
C3BBE0752554CDA60050F1E3 /* Configuration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Configuration.swift; sourceTree = "<group>"; };
C3BBE07F2554CDD70050F1E3 /* Storage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Storage.swift; sourceTree = "<group>"; };
C3BBE0B42554F0E10050F1E3 /* ProofOfWork.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProofOfWork.swift; sourceTree = "<group>"; };
@ -2095,6 +2046,7 @@
C3DFFAC523E96F0D0058DAF8 /* Sheet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Sheet.swift; sourceTree = "<group>"; };
C3E5C2F9251DBABB0040DFFC /* EditClosedGroupVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditClosedGroupVC.swift; sourceTree = "<group>"; };
C3E7134E251C867C009649BB /* Sodium+Conversion.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Sodium+Conversion.swift"; sourceTree = "<group>"; };
C3EEA016256487B300C338BC /* LokiDatabaseUtilities.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LokiDatabaseUtilities.swift; sourceTree = "<group>"; };
C3F0A52F255C80BC007BE2A3 /* NoopNotificationsManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NoopNotificationsManager.swift; sourceTree = "<group>"; };
C3F0A5B2255C915C007BE2A3 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
C3F0A5EB255C970D007BE2A3 /* Configuration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Configuration.swift; sourceTree = "<group>"; };
@ -2416,17 +2368,8 @@
children = (
76EB03C218170B33006006FC /* AppDelegate.h */,
76EB03C318170B33006006FC /* AppDelegate.m */,
45FBC59A1DF8575700E9B410 /* CallKitCallManager.swift */,
45F659721E1BD99C00444429 /* CallKitCallUIAdaptee.swift */,
45794E851E00620000066731 /* CallUIAdapter.swift */,
45F659811E1BE77000444429 /* NonCallKitCallUIAdaptee.swift */,
45C9DEB71DF4E35A0065CA84 /* WebRTCCallMessageHandler.swift */,
45AE48501E0732D6004D96C2 /* TurnServerInfo.swift */,
45FBC5D01DF8592E00E9B410 /* SignalCall.swift */,
458DE9D51DEE3FD00071BB03 /* PeerConnectionClient.swift */,
4574A5D51DD6704700C6B692 /* CallService.swift */,
45F170BA1E2FC5D3003FC1F2 /* CallAudioService.swift */,
452C468E1E427E200087B011 /* OutboundCallInitiator.swift */,
34D99CE3217509C1000AFB39 /* AppEnvironment.swift */,
4505C2BE1E648EA300CEBF41 /* ExperienceUpgrade.swift */,
3461293D1FD1D72B00532771 /* ExperienceUpgradeFinder.swift */,
@ -2698,8 +2641,6 @@
B8CCF63E23975CFB0091D419 /* JoinPublicChatVC.swift */,
B82B40872399EB0E00A248E7 /* LandingVC.swift */,
C329FEEB24F7277900B1C64C /* LightModeSheet.swift */,
B85357C423A1F13800AAF6CD /* LinkDeviceVC.swift */,
B85357C623A1FB5100AAF6CD /* LinkDeviceVCDelegate.swift */,
B86BD08323399ACF000F5AE3 /* Modal.swift */,
B80A579E23DFF1F300876683 /* NewClosedGroupVC.swift */,
B8CCF63623961D6D0091D419 /* NewPrivateChatVC.swift */,
@ -2884,7 +2825,6 @@
C33FDB01255A580700E217F9 /* AppReadiness.h */,
C33FDB75255A581000E217F9 /* AppReadiness.m */,
C33FDB4C255A580D00E217F9 /* AppVersion.h */,
C38EF23F255B6D67007E1867 /* NSAttributedString+OWS.h */,
C38EF3E4255B6DF4007E1867 /* CommonStrings.swift */,
C38EF3D2255B6DEE007E1867 /* ThreadViewHelper.h */,
C38EF3D1255B6DEE007E1867 /* ThreadViewHelper.m */,
@ -2903,13 +2843,10 @@
C38EF2E3255B6DB9007E1867 /* OWSUnreadIndicator.m */,
C38EF2EC255B6DBA007E1867 /* ProximityMonitoringManager.swift */,
C38EF2F2255B6DBC007E1867 /* Searcher.swift */,
C38EF2BF255B6DA6007E1867 /* OWSContactOffersInteraction.h */,
C38EF2C0255B6DA6007E1867 /* OWSContactOffersInteraction.m */,
C38EF2BE255B6DA6007E1867 /* TSUnreadIndicatorInteraction.h */,
C38EF2C1255B6DA6007E1867 /* TSUnreadIndicatorInteraction.m */,
C38EF284255B6D84007E1867 /* AppSetup.h */,
C38EF287255B6D85007E1867 /* AppSetup.m */,
C38EF289255B6D85007E1867 /* NoopCallMessageHandler.swift */,
C3F0A52F255C80BC007BE2A3 /* NoopNotificationsManager.swift */,
C38EF288255B6D85007E1867 /* OWSSounds.h */,
C38EF28B255B6D86007E1867 /* OWSSounds.m */,
@ -2926,23 +2863,11 @@
C33FDA94255A57FE00E217F9 /* Data+Streaming.swift */,
C33FDB54255A580D00E217F9 /* DataSource.h */,
C33FDBB6255A581600E217F9 /* DataSource.m */,
C33FDBDA255A581900E217F9 /* Dictionary+Description.swift */,
C33FDAFF255A580600E217F9 /* DisplayNameUtilities.swift */,
C33FDBF4255A581B00E217F9 /* DisplayNameUtilities2.swift */,
C33FDA73255A57FA00E217F9 /* ECKeyPair+Hexadecimal.swift */,
C33FDB69255A580F00E217F9 /* FeatureFlags.swift */,
C33FDAC6255A580200E217F9 /* Fingerprint.pb.swift */,
C33FDB26255A580A00E217F9 /* FingerprintProto.swift */,
C33FDB7F255A581100E217F9 /* FullTextSearchFinder.swift */,
C33FDC16255A581E00E217F9 /* FunctionalUtil.h */,
C33FDB17255A580800E217F9 /* FunctionalUtil.m */,
C33FDBC1255A581700E217F9 /* GeneralUtilities.swift */,
C33FDB19255A580900E217F9 /* GroupUtilities.swift */,
C33FDB87255A581100E217F9 /* JobQueue.swift */,
C33FDBCA255A581700E217F9 /* LKGroupUtilities.h */,
C33FDBE1255A581A00E217F9 /* LKGroupUtilities.m */,
C33FDB6B255A580F00E217F9 /* LKUserDefaults.swift */,
C33FDBF0255A581B00E217F9 /* LokiDatabaseUtilities.swift */,
C33FDBDE255A581900E217F9 /* LokiPushNotificationManager.swift */,
C33FDC1F255A581F00E217F9 /* LokiSessionRestorationImplementation.swift */,
C33FDA7E255A57FB00E217F9 /* Mention.swift */,
@ -2962,13 +2887,10 @@
C33FDB07255A580700E217F9 /* OWSBackupFragment.m */,
C33FDBEB255A581B00E217F9 /* OWSBlockingManager.h */,
C33FDA68255A57F900E217F9 /* OWSBlockingManager.m */,
C33FDB9D255A581300E217F9 /* OWSCallMessageHandler.h */,
C33FDA95255A57FE00E217F9 /* OWSChunkedOutputStream.h */,
C33FDB4B255A580C00E217F9 /* OWSChunkedOutputStream.m */,
C33FDA9D255A57FF00E217F9 /* OWSContactsOutputStream.h */,
C33FDB44255A580C00E217F9 /* OWSContactsOutputStream.m */,
C33FDADA255A580400E217F9 /* OWSDisappearingConfigurationUpdateInfoMessage.h */,
C33FDA6B255A57FA00E217F9 /* OWSDisappearingConfigurationUpdateInfoMessage.m */,
C33FDAD9255A580300E217F9 /* OWSDisappearingMessagesConfiguration.h */,
C33FDBA4255A581400E217F9 /* OWSDisappearingMessagesConfiguration.m */,
C33FDC05255A581D00E217F9 /* OWSDisappearingMessagesFinder.h */,
@ -2993,8 +2915,6 @@
C33FDBA9255A581500E217F9 /* OWSIdentityManager.m */,
C33FDAC0255A580100E217F9 /* OWSIncomingMessageFinder.h */,
C33FDB1E255A580900E217F9 /* OWSIncomingMessageFinder.m */,
C33FDB2A255A580A00E217F9 /* OWSIncompleteCallsJob.h */,
C33FDBF7255A581C00E217F9 /* OWSIncompleteCallsJob.m */,
C33FDBA8255A581500E217F9 /* OWSLinkPreview.swift */,
C33FDB67255A580F00E217F9 /* OWSMediaGalleryFinder.h */,
C33FDB71255A581000E217F9 /* OWSMediaGalleryFinder.m */,
@ -3052,12 +2972,9 @@
C33FDAED255A580500E217F9 /* SSKMessageSenderJobRecord.h */,
C33FDAE9255A580500E217F9 /* SSKMessageSenderJobRecord.m */,
C33FDA69255A57F900E217F9 /* SSKPreferences.swift */,
C33FDAA4255A57FF00E217F9 /* SSKProto.swift */,
C33FDADE255A580400E217F9 /* SwiftSingletons.swift */,
C33FDB94255A581300E217F9 /* TSAccountManager.h */,
C33FDB88255A581200E217F9 /* TSAccountManager.m */,
C33FDB02255A580700E217F9 /* TSCall.h */,
C33FDC1C255A581F00E217F9 /* TSCall.m */,
C33FDC12255A581E00E217F9 /* TSConstants.h */,
C33FDABE255A580100E217F9 /* TSConstants.m */,
C33FDB25255A580900E217F9 /* TSDatabaseSecondaryIndexes.h */,
@ -3211,6 +3128,8 @@
C3851CE3256250FA0061EEB0 /* Remove Later */ = {
isa = PBXGroup;
children = (
C33FDAFF255A580600E217F9 /* DisplayNameUtilities.swift */,
C33FDBF4255A581B00E217F9 /* DisplayNameUtilities2.swift */,
C33FDBB9255A581600E217F9 /* ProfileManagerProtocol.h */,
C33FDBA3255A581400E217F9 /* SessionManagementProtocol.swift */,
C33FDAFB255A580600E217F9 /* SessionMetaProtocol.swift */,
@ -3258,6 +3177,8 @@
C38BBA0D255E321C0041B9A3 /* Messages */ = {
isa = PBXGroup;
children = (
C33FDADA255A580400E217F9 /* OWSDisappearingConfigurationUpdateInfoMessage.h */,
C33FDA6B255A57FA00E217F9 /* OWSDisappearingConfigurationUpdateInfoMessage.m */,
C33FDB5D255A580E00E217F9 /* TSErrorMessage_privateConstructor.h */,
C33FDBB0255A581500E217F9 /* TSErrorMessage.h */,
C33FDAE7255A580500E217F9 /* TSErrorMessage.m */,
@ -3295,8 +3216,6 @@
C38EF26C255B6D79007E1867 /* OWSResaveCollectionDBMigration.m */,
C33FDA67255A57F900E217F9 /* OWSPrimaryStorage.h */,
C33FDC02255A581D00E217F9 /* OWSPrimaryStorage.m */,
C33FDB1A255A580900E217F9 /* OWSPrimaryStorage+Calling.h */,
C33FDBFD255A581C00E217F9 /* OWSPrimaryStorage+Calling.m */,
C33FDBBA255A581600E217F9 /* OWSPrimaryStorage+keyFromIntLong.h */,
C33FDB99255A581300E217F9 /* OWSPrimaryStorage+keyFromIntLong.m */,
C33FDB47255A580C00E217F9 /* OWSPrimaryStorage+PreKeyStore.h */,
@ -3321,6 +3240,7 @@
C38BBA17255E327A0041B9A3 /* Move to main app */ = {
isa = PBXGroup;
children = (
C3EEA016256487B300C338BC /* LokiDatabaseUtilities.swift */,
C33FDBBB255A581600E217F9 /* OWSPrimaryStorage+Loki.h */,
C33FDB58255A580E00E217F9 /* OWSPrimaryStorage+Loki.m */,
C33FDA85255A57FC00E217F9 /* OWSPrimaryStorage+Loki.swift */,
@ -3705,6 +3625,12 @@
C3CA3B11255CF17200F4C6D4 /* Utilities */ = {
isa = PBXGroup;
children = (
C33FDA73255A57FA00E217F9 /* ECKeyPair+Hexadecimal.swift */,
C33FDBC1255A581700E217F9 /* GeneralUtilities.swift */,
C33FDB19255A580900E217F9 /* GroupUtilities.swift */,
C33FDBCA255A581700E217F9 /* LKGroupUtilities.h */,
C33FDBE1255A581A00E217F9 /* LKGroupUtilities.m */,
C33FDB6B255A580F00E217F9 /* LKUserDefaults.swift */,
C33FDB1C255A580900E217F9 /* UIImage+OWS.h */,
C33FDB81255A581100E217F9 /* UIImage+OWS.m */,
C33FDB49255A580C00E217F9 /* WeakTimer.swift */,
@ -3761,8 +3687,10 @@
C38EF227255B6D5D007E1867 /* OWSVideoPlayer.swift */,
C38EF2EF255B6DBB007E1867 /* Weak.swift */,
C38EF2FA255B6DBD007E1867 /* Bench.swift */,
C38EF23F255B6D67007E1867 /* NSAttributedString+OWS.h */,
C38EF23A255B6D66007E1867 /* NSAttributedString+OWS.m */,
C38EF237255B6D65007E1867 /* UIDevice+featureSupport.swift */,
C3B7845C25649DA600ADB2E7 /* TSIncomingMessage+Conversion.swift */,
);
path = Utilities;
sourceTree = "<group>";
@ -3957,10 +3885,7 @@
C33FDDCC255A582000E217F9 /* TSConstants.h in Headers */,
C33FDCDF255A582000E217F9 /* TSDatabaseSecondaryIndexes.h in Headers */,
C33FDDBD255A582000E217F9 /* ByteParser.h in Headers */,
C33FDCBC255A582000E217F9 /* TSCall.h in Headers */,
C38EF2C3255B6DA6007E1867 /* OWSContactOffersInteraction.h in Headers */,
C38EF243255B6D67007E1867 /* UIViewController+OWS.h in Headers */,
C33FDCD4255A582000E217F9 /* OWSPrimaryStorage+Calling.h in Headers */,
C38EF36D255B6DCC007E1867 /* SharingThreadPickerViewController.h in Headers */,
C33FDC5B255A582000E217F9 /* TSYapDatabaseObject.h in Headers */,
C38EF35D255B6DCC007E1867 /* OWSNavigationController.h in Headers */,
@ -4001,12 +3926,10 @@
C33FDD16255A582000E217F9 /* NSArray+Functional.h in Headers */,
C38EF35B255B6DCC007E1867 /* SelectThreadViewController.h in Headers */,
C33FDCE9255A582000E217F9 /* ContactsManagerProtocol.h in Headers */,
C33FDCE4255A582000E217F9 /* OWSIncompleteCallsJob.h in Headers */,
C33FDDD3255A582000E217F9 /* OWSQueues.h in Headers */,
C33FDC96255A582000E217F9 /* NSObject+Casting.h in Headers */,
C33FDC75255A582000E217F9 /* OWSGroupsOutputStream.h in Headers */,
C33FDDB3255A582000E217F9 /* OWSError.h in Headers */,
C33FDD57255A582000E217F9 /* OWSCallMessageHandler.h in Headers */,
C33FDCC8255A582000E217F9 /* NSError+MessageSending.h in Headers */,
C38EF403255B6DF7007E1867 /* ContactCellView.h in Headers */,
C33FDCA0255A582000E217F9 /* TSInteraction.h in Headers */,
@ -4952,7 +4875,6 @@
C38EF2A5255B6D93007E1867 /* Identicon+ObjC.swift in Sources */,
C38EF330255B6DBF007E1867 /* OWSWindowManager.m in Sources */,
C33FDD79255A582000E217F9 /* OWSHTTPSecurityPolicy.m in Sources */,
C33FDDB7255A582000E217F9 /* OWSPrimaryStorage+Calling.m in Sources */,
C33FDD3D255A582000E217F9 /* TSQuotedMessage.m in Sources */,
C38EF273255B6D7A007E1867 /* OWSDatabaseMigrationRunner.m in Sources */,
C33FDD12255A582000E217F9 /* OWSPrimaryStorage+Loki.m in Sources */,
@ -4972,14 +4894,12 @@
C33FDD0A255A582000E217F9 /* OWSPrimaryStorage+PreKeyStore.m in Sources */,
C33FDC4E255A582000E217F9 /* Data+Streaming.swift in Sources */,
C33FDCE5255A582000E217F9 /* OWSProvisioningCipher.m in Sources */,
C33FDDD6255A582000E217F9 /* TSCall.m in Sources */,
C33FDD1A255A582000E217F9 /* TSMessage.m in Sources */,
C38EF3FF255B6DF7007E1867 /* TappableView.swift in Sources */,
C38EF3C2255B6DE7007E1867 /* ImageEditorPaletteView.swift in Sources */,
C38EF245255B6D67007E1867 /* UIFont+OWS.m in Sources */,
C33FDD26255A582000E217F9 /* NSNotificationCenter+OWS.m in Sources */,
C38EF36F255B6DCC007E1867 /* OWSViewController.m in Sources */,
C33FDC80255A582000E217F9 /* Fingerprint.pb.swift in Sources */,
C33FDD42255A582000E217F9 /* TSAccountManager.m in Sources */,
C38EF3FB255B6DF7007E1867 /* UIAlertController+OWS.swift in Sources */,
C33FDC53255A582000E217F9 /* OutageDetection.swift in Sources */,
@ -4987,6 +4907,7 @@
C38EF363255B6DCC007E1867 /* ModalActivityIndicatorViewController.swift in Sources */,
C38EF38A255B6DD2007E1867 /* AttachmentCaptionToolbar.swift in Sources */,
C33FDD00255A582000E217F9 /* TSDatabaseView.m in Sources */,
C3EEA017256487B300C338BC /* LokiDatabaseUtilities.swift in Sources */,
C33FDD3B255A582000E217F9 /* UIImage+OWS.m in Sources */,
C33FDD5F255A582000E217F9 /* SignalServiceProfile.swift in Sources */,
C33FDD83255A582000E217F9 /* CreatePreKeysOperation.swift in Sources */,
@ -5010,12 +4931,10 @@
C33FDCB1255A582000E217F9 /* OWSPrimaryStorage+SignedPreKeyStore.m in Sources */,
C38EF2C5255B6DA6007E1867 /* TSUnreadIndicatorInteraction.m in Sources */,
C33FDC64255A582000E217F9 /* NSObject+Casting.m in Sources */,
C38EF2C4255B6DA6007E1867 /* OWSContactOffersInteraction.m in Sources */,
C38EF388255B6DD2007E1867 /* AttachmentApprovalViewController.swift in Sources */,
C33FDD53255A582000E217F9 /* OWSPrimaryStorage+keyFromIntLong.m in Sources */,
C33FDC72255A582000E217F9 /* NSArray+Functional.m in Sources */,
C33FDD38255A582000E217F9 /* TSPreKeyManager.m in Sources */,
C33FDD94255A582000E217F9 /* Dictionary+Description.swift in Sources */,
C38EF2A7255B6D93007E1867 /* ProfilePictureView.swift in Sources */,
C38EF22C255B6D5D007E1867 /* OWSVideoPlayer.swift in Sources */,
C33FDC29255A581F00E217F9 /* ReachabilityManager.swift in Sources */,
@ -5093,7 +5012,6 @@
C33FDC7B255A582000E217F9 /* NSSet+Functional.m in Sources */,
C33FDC69255A582000E217F9 /* String+Trimming.swift in Sources */,
C33FDCB7255A582000E217F9 /* LRUCache.swift in Sources */,
C33FDDB1255A582000E217F9 /* OWSIncompleteCallsJob.m in Sources */,
C38EF405255B6DF7007E1867 /* OWSButton.swift in Sources */,
C38EF3C4255B6DE7007E1867 /* ImageEditorContents.swift in Sources */,
C33FDC3B255A581F00E217F9 /* MentionsManager.swift in Sources */,
@ -5112,11 +5030,11 @@
C33FDC39255A581F00E217F9 /* OWSRecordTranscriptJob.m in Sources */,
C38EF228255B6D5D007E1867 /* AttachmentSharing.m in Sources */,
C33FDD1E255A582000E217F9 /* PreKeyRefreshOperation.swift in Sources */,
C3B7845D25649DA600ADB2E7 /* TSIncomingMessage+Conversion.swift in Sources */,
C33FDCF4255A582000E217F9 /* Poller.swift in Sources */,
C38EF332255B6DBF007E1867 /* OWSPreferences.m in Sources */,
C33FDC26255A581F00E217F9 /* ProtoUtils.m in Sources */,
C33FDC48255A581F00E217F9 /* OWSFileSystem.m in Sources */,
C33FDC5E255A582000E217F9 /* SSKProto.swift in Sources */,
C38EF39E255B6DDA007E1867 /* OWSQuotedReplyModel.m in Sources */,
C33FDD85255A582000E217F9 /* TSInvalidIdentityKeyReceivingErrorMessage.m in Sources */,
C33FDD2E255A582000E217F9 /* TSInvalidIdentityKeyErrorMessage.m in Sources */,
@ -5139,7 +5057,6 @@
C38EF3FA255B6DF7007E1867 /* DirectionalPanGestureRecognizer.swift in Sources */,
C38EF3BB255B6DE7007E1867 /* ImageEditorStrokeItem.swift in Sources */,
C33FDCA1255A582000E217F9 /* TSErrorMessage.m in Sources */,
C38EF295255B6D86007E1867 /* NoopCallMessageHandler.swift in Sources */,
C38EF3C0255B6DE7007E1867 /* ImageEditorCropViewController.swift in Sources */,
C38EF401255B6DF7007E1867 /* VideoPlayerView.swift in Sources */,
C33FDC22255A581F00E217F9 /* OWSBlockingManager.m in Sources */,
@ -5156,7 +5073,6 @@
C38EF3F4255B6DF7007E1867 /* ContactCellView.m in Sources */,
C33FDD29255A582000E217F9 /* OWSOutgoingReceiptManager.m in Sources */,
C33FDC78255A582000E217F9 /* TSConstants.m in Sources */,
C33FDCE0255A582000E217F9 /* FingerprintProto.swift in Sources */,
C38EF324255B6DBF007E1867 /* Bench.swift in Sources */,
C38EF292255B6D86007E1867 /* VersionMigrations.m in Sources */,
C33FDD5E255A582000E217F9 /* OWSDisappearingMessagesConfiguration.m in Sources */,
@ -5173,7 +5089,6 @@
C33FDCFE255A582000E217F9 /* OWSContactsOutputStream.m in Sources */,
C33FDDBC255A582000E217F9 /* OWSPrimaryStorage.m in Sources */,
C33FDCD3255A582000E217F9 /* GroupUtilities.swift in Sources */,
C33FDDAA255A582000E217F9 /* LokiDatabaseUtilities.swift in Sources */,
C33FDC2B255A581F00E217F9 /* OWSReadReceiptManager.m in Sources */,
C38EF326255B6DBF007E1867 /* ConversationStyle.swift in Sources */,
C38EF3B8255B6DE7007E1867 /* ImageEditorTextViewController.swift in Sources */,
@ -5375,7 +5290,6 @@
4C04392A220A9EC800BAEA63 /* VoiceNoteLock.swift in Sources */,
3496956E21A301A100DCFE74 /* OWSBackupExportJob.m in Sources */,
4C1885D2218F8E1C00B67051 /* PhotoGridViewCell.swift in Sources */,
45C9DEB81DF4E35A0065CA84 /* WebRTCCallMessageHandler.swift in Sources */,
34D1F0501F7D45A60066283D /* GifPickerCell.swift in Sources */,
3496957421A301A100DCFE74 /* OWSBackupAPI.swift in Sources */,
C3E5C2FA251DBABB0040DFFC /* EditClosedGroupVC.swift in Sources */,
@ -5403,7 +5317,6 @@
EF764C351DB67CC5000D9A87 /* UIViewController+Permissions.m in Sources */,
45CD81EF1DC030E7004C9430 /* SyncPushTokensJob.swift in Sources */,
4CEB78C92178EBAB00F315D2 /* OWSSessionResetJobRecord.m in Sources */,
45794E861E00620000066731 /* CallUIAdapter.swift in Sources */,
C396DAF32518408B00FF6DC5 /* Description.swift in Sources */,
450D19131F85236600970622 /* RemoteVideoView.m in Sources */,
34129B8621EF877A005457A8 /* LinkPreviewView.swift in Sources */,
@ -5459,7 +5372,6 @@
34D1F0B71F87F8850066283D /* OWSGenericAttachmentView.m in Sources */,
34D920E720E179C200D51158 /* OWSMessageFooterView.m in Sources */,
341341EF2187467A00192D59 /* ConversationViewModel.m in Sources */,
B85357C523A1F13800AAF6CD /* LinkDeviceVC.swift in Sources */,
4C21D5D8223AC60F00EF8A77 /* PhotoCapture.swift in Sources */,
C331FFF32558FF0300070591 /* PathStatusView.swift in Sources */,
4CC1ECFB211A553000CC13BE /* AppUpdateNag.swift in Sources */,
@ -5491,24 +5403,18 @@
B8CCF6432397711F0091D419 /* SettingsVC.swift in Sources */,
C354E75A23FE2A7600CE22E3 /* BaseVC.swift in Sources */,
3441FD9F21A3604F00BB9542 /* BackupRestoreViewController.swift in Sources */,
45F659821E1BE77000444429 /* NonCallKitCallUIAdaptee.swift in Sources */,
45AE48511E0732D6004D96C2 /* TurnServerInfo.swift in Sources */,
45C0DC1B1E68FE9000E04C47 /* UIApplication+OWS.swift in Sources */,
45FBC5C81DF8575700E9B410 /* CallKitCallManager.swift in Sources */,
4539B5861F79348F007141FF /* PushRegistrationManager.swift in Sources */,
45FBC5D11DF8592E00E9B410 /* SignalCall.swift in Sources */,
C396DAF22518408B00FF6DC5 /* NamedView.swift in Sources */,
45F32C232057297A00A300D5 /* MediaPageViewController.swift in Sources */,
452C468F1E427E200087B011 /* OutboundCallInitiator.swift in Sources */,
B82B4094239DF15900A248E7 /* ConversationTitleView.swift in Sources */,
34D2CCDA2062E7D000CB1A14 /* OWSScreenLockUI.m in Sources */,
45F170BB1E2FC5D3003FC1F2 /* CallAudioService.swift in Sources */,
4CA46F4C219CCC630038ABDE /* CaptionView.swift in Sources */,
340FC8B7204DAC8D007AEB0F /* OWSConversationSettingsViewController.m in Sources */,
34BECE2E1F7ABCE000D7438D /* GifPickerViewController.swift in Sources */,
B84664F5235022F30083A1CD /* MentionUtilities.swift in Sources */,
34D1F0C01F8EC1760066283D /* MessageRecipientStatusUtils.swift in Sources */,
45F659731E1BD99C00444429 /* CallKitCallUIAdaptee.swift in Sources */,
34277A5E20751BDC006049F2 /* OWSQuotedMessageView.m in Sources */,
458DE9D61DEE3FD00071BB03 /* PeerConnectionClient.swift in Sources */,
C3F0A5FE255C988A007BE2A3 /* Storage+Shared.swift in Sources */,
@ -5539,13 +5445,11 @@
C31A6C5A247F214E001123EF /* UIView+Glow.swift in Sources */,
C31D1DE9252172D4005D4DA8 /* ContactUtilities.swift in Sources */,
3448E1662215B313004B052E /* OnboardingCaptchaViewController.swift in Sources */,
4574A5D61DD6704700C6B692 /* CallService.swift in Sources */,
4521C3C01F59F3BA00B4C582 /* TextFieldHelper.swift in Sources */,
340FC8AC204DAC8D007AEB0F /* PrivacySettingsTableViewController.m in Sources */,
B88847BC23E10BC6009836D2 /* GroupMembersVC.swift in Sources */,
B85357BF23A1AE0800AAF6CD /* SeedReminderView.swift in Sources */,
C31F812625258FB000DD9FD9 /* Storage+VolumeSamples.swift in Sources */,
B85357C723A1FB5100AAF6CD /* LinkDeviceVCDelegate.swift in Sources */,
C35E8AAE2485E51D00ACB629 /* IP2Country.swift in Sources */,
340FC8AE204DAC8D007AEB0F /* OWSSoundSettingsViewController.m in Sources */,
340FC8B0204DAC8D007AEB0F /* AddToBlockListViewController.m in Sources */,

View File

@ -8,8 +8,6 @@
#import <SignalUtilitiesKit/OWSDatabaseMigration.h>
#import <SignalUtilitiesKit/OWSProfileManager.h>
#import <SessionProtocolKit/SessionProtocolKit-Swift.h>
#import <SignalUtilitiesKit/OWSAttachmentDownloads.h>
#import <SignalUtilitiesKit/OWSBackgroundTask.h>
#import <SignalUtilitiesKit/OWSBlockingManager.h>

View File

@ -586,11 +586,7 @@ public class SignalAttachment: NSObject {
owsFailDebug("Missing expected pasteboard data for UTI: \(dataUTI)")
return nil
}
guard let data = datas[0] as? Data else {
owsFailDebug("Missing expected pasteboard data for UTI: \(dataUTI)")
return nil
}
return data
return datas[0]
}
// MARK: Image Attachments

View File

@ -8,7 +8,7 @@
NS_ASSUME_NONNULL_BEGIN
@class OWSBackupFragment;
@class SSKProtoAttachmentPointer;
@class SNProtoAttachmentPointer;
@class TSAttachmentStream;
@class TSMessage;
@ -57,11 +57,11 @@ typedef NS_ENUM(NSUInteger, TSAttachmentPointerState) {
- (instancetype)initForRestoreWithAttachmentStream:(TSAttachmentStream *)attachmentStream NS_DESIGNATED_INITIALIZER;
+ (nullable TSAttachmentPointer *)attachmentPointerFromProto:(SSKProtoAttachmentPointer *)attachmentProto
+ (nullable TSAttachmentPointer *)attachmentPointerFromProto:(SNProtoAttachmentPointer *)attachmentProto
albumMessage:(nullable TSMessage *)message;
+ (NSArray<TSAttachmentPointer *> *)attachmentPointersFromProtos:
(NSArray<SSKProtoAttachmentPointer *> *)attachmentProtos
(NSArray<SNProtoAttachmentPointer *> *)attachmentProtos
albumMessage:(TSMessage *)message;
#pragma mark - Update With... Methods

View File

@ -105,7 +105,7 @@ NS_ASSUME_NONNULL_BEGIN
return self;
}
+ (nullable TSAttachmentPointer *)attachmentPointerFromProto:(SSKProtoAttachmentPointer *)attachmentProto
+ (nullable TSAttachmentPointer *)attachmentPointerFromProto:(SNProtoAttachmentPointer *)attachmentProto
albumMessage:(nullable TSMessage *)albumMessage
{
if (attachmentProto.id < 1) {
@ -139,7 +139,7 @@ NS_ASSUME_NONNULL_BEGIN
TSAttachmentType attachmentType = TSAttachmentTypeDefault;
if ([attachmentProto hasFlags]) {
UInt32 flags = attachmentProto.flags;
if ((flags & (UInt32)SSKProtoAttachmentPointerFlagsVoiceMessage) > 0) {
if ((flags & (UInt32)SNProtoAttachmentPointerFlagsVoiceMessage) > 0) {
attachmentType = TSAttachmentTypeVoiceMessage;
}
}
@ -176,14 +176,14 @@ NS_ASSUME_NONNULL_BEGIN
}
+ (NSArray<TSAttachmentPointer *> *)attachmentPointersFromProtos:
(NSArray<SSKProtoAttachmentPointer *> *)attachmentProtos
(NSArray<SNProtoAttachmentPointer *> *)attachmentProtos
albumMessage:(TSMessage *)albumMessage
{
OWSAssertDebug(attachmentProtos);
OWSAssertDebug(albumMessage);
NSMutableArray *attachmentPointers = [NSMutableArray new];
for (SSKProtoAttachmentPointer *attachmentProto in attachmentProtos) {
for (SNProtoAttachmentPointer *attachmentProto in attachmentProtos) {
TSAttachmentPointer *_Nullable attachmentPointer =
[self attachmentPointerFromProto:attachmentProto albumMessage:albumMessage];
if (attachmentPointer) {
@ -206,7 +206,7 @@ NS_ASSUME_NONNULL_BEGIN
OWSAssertDebug([self isDecimalNumberText:self.uniqueId]);
if ([self isDecimalNumberText:self.uniqueId]) {
// For legacy instances, try to parse the serverId from the uniqueId.
self.serverId = [self.uniqueId integerValue];
self.serverId = (UInt64)[self.uniqueId integerValue];
} else {
OWSLogError(@"invalid legacy attachment uniqueId: %@.", self.uniqueId);
}

View File

@ -12,7 +12,7 @@
NS_ASSUME_NONNULL_BEGIN
@class SSKProtoAttachmentPointer;
@class SNProtoAttachmentPointer;
@class TSAttachmentPointer;
@class YapDatabaseReadWriteTransaction;
@ -99,9 +99,9 @@ typedef void (^OWSThumbnailFailure)(void);
#pragma mark - Protobuf
+ (nullable SSKProtoAttachmentPointer *)buildProtoForAttachmentId:(nullable NSString *)attachmentId;
+ (nullable SNProtoAttachmentPointer *)buildProtoForAttachmentId:(nullable NSString *)attachmentId;
- (nullable SSKProtoAttachmentPointer *)buildProto;
- (nullable SNProtoAttachmentPointer *)buildProto;
@end

View File

@ -21,7 +21,7 @@ const NSUInteger ThumbnailDimensionPointsLarge()
{
CGSize screenSizePoints = UIScreen.mainScreen.bounds.size;
const CGFloat kMinZoomFactor = 2.f;
return MAX(screenSizePoints.width, screenSizePoints.height) * kMinZoomFactor;
return (NSUInteger)MAX(screenSizePoints.width, screenSizePoints.height) * kMinZoomFactor;
}
typedef void (^OWSLoadedThumbnailSuccess)(OWSLoadedThumbnail *loadedThumbnail);
@ -821,7 +821,7 @@ typedef void (^OWSLoadedThumbnailSuccess)(OWSLoadedThumbnail *loadedThumbnail);
// MARK: Protobuf serialization
+ (nullable SSKProtoAttachmentPointer *)buildProtoForAttachmentId:(nullable NSString *)attachmentId
+ (nullable SNProtoAttachmentPointer *)buildProtoForAttachmentId:(nullable NSString *)attachmentId
{
OWSAssertDebug(attachmentId.length > 0);
@ -839,9 +839,9 @@ typedef void (^OWSLoadedThumbnailSuccess)(OWSLoadedThumbnail *loadedThumbnail);
}
- (nullable SSKProtoAttachmentPointer *)buildProto
- (nullable SNProtoAttachmentPointer *)buildProto
{
SSKProtoAttachmentPointerBuilder *builder = [SSKProtoAttachmentPointer builderWithId:self.serverId];
SNProtoAttachmentPointerBuilder *builder = [SNProtoAttachmentPointer builderWithId:self.serverId];
OWSAssertDebug(self.contentType.length > 0);
builder.contentType = self.contentType;
@ -857,7 +857,7 @@ typedef void (^OWSLoadedThumbnailSuccess)(OWSLoadedThumbnail *loadedThumbnail);
builder.size = self.byteCount;
builder.key = self.encryptionKey;
builder.digest = self.digest;
builder.flags = self.isVoiceMessage ? SSKProtoAttachmentPointerFlagsVoiceMessage : 0;
builder.flags = self.isVoiceMessage ? SNProtoAttachmentPointerFlagsVoiceMessage : 0;
if (self.shouldHaveImageSize) {
CGSize imageSize = self.imageSize;
@ -874,7 +874,7 @@ typedef void (^OWSLoadedThumbnailSuccess)(OWSLoadedThumbnail *loadedThumbnail);
builder.url = self.downloadURL;
NSError *error;
SSKProtoAttachmentPointer *_Nullable attachmentProto = [builder buildAndReturnError:&error];
SNProtoAttachmentPointer *_Nullable attachmentProto = [builder buildAndReturnError:&error];
if (error || !attachmentProto) {
OWSFailDebug(@"could not build protobuf: %@", error);
return nil;

View File

@ -248,7 +248,7 @@ public final class ClosedGroupsProtocol : NSObject {
// MARK: - Receiving
@objc(handleSharedSenderKeysUpdateIfNeeded:from:transaction:)
public static func handleSharedSenderKeysUpdateIfNeeded(_ dataMessage: SSKProtoDataMessage, from publicKey: String, using transaction: YapDatabaseReadWriteTransaction) {
public static func handleSharedSenderKeysUpdateIfNeeded(_ dataMessage: SNProtoDataMessage, from publicKey: String, using transaction: YapDatabaseReadWriteTransaction) {
// Note that `publicKey` is either the public key of the group or the public key of the
// sender, depending on how the message was sent
guard let closedGroupUpdate = dataMessage.closedGroupUpdate, isValid(closedGroupUpdate) else { return }
@ -260,7 +260,7 @@ public final class ClosedGroupsProtocol : NSObject {
}
}
private static func isValid(_ closedGroupUpdate: SSKProtoDataMessageClosedGroupUpdate) -> Bool {
private static func isValid(_ closedGroupUpdate: SNProtoDataMessageClosedGroupUpdate) -> Bool {
guard !closedGroupUpdate.groupPublicKey.isEmpty else { return false }
switch closedGroupUpdate.type {
case .new: return !(closedGroupUpdate.name ?? "").isEmpty && !(closedGroupUpdate.groupPrivateKey ?? Data()).isEmpty && !closedGroupUpdate.members.isEmpty
@ -271,7 +271,7 @@ public final class ClosedGroupsProtocol : NSObject {
}
}
private static func handleNewGroupMessage(_ closedGroupUpdate: SSKProtoDataMessageClosedGroupUpdate, using transaction: YapDatabaseReadWriteTransaction) {
private static func handleNewGroupMessage(_ closedGroupUpdate: SNProtoDataMessageClosedGroupUpdate, using transaction: YapDatabaseReadWriteTransaction) {
// Unwrap the message
let groupPublicKey = closedGroupUpdate.groupPublicKey.toHexString()
let name = closedGroupUpdate.name
@ -330,7 +330,7 @@ public final class ClosedGroupsProtocol : NSObject {
/// Invoked upon receiving a group update. A group update is sent out when a group's name is changed, when new users are added, when users leave or are
/// kicked, or if the group admins are changed.
private static func handleInfoMessage(_ closedGroupUpdate: SSKProtoDataMessageClosedGroupUpdate, from senderPublicKey: String,
private static func handleInfoMessage(_ closedGroupUpdate: SNProtoDataMessageClosedGroupUpdate, from senderPublicKey: String,
using transaction: YapDatabaseReadWriteTransaction) {
// Unwrap the message
let groupPublicKey = closedGroupUpdate.groupPublicKey.toHexString()
@ -397,7 +397,7 @@ public final class ClosedGroupsProtocol : NSObject {
}
}
private static func handleSenderKeyRequestMessage(_ closedGroupUpdate: SSKProtoDataMessageClosedGroupUpdate, from senderPublicKey: String, using transaction: YapDatabaseReadWriteTransaction) {
private static func handleSenderKeyRequestMessage(_ closedGroupUpdate: SNProtoDataMessageClosedGroupUpdate, from senderPublicKey: String, using transaction: YapDatabaseReadWriteTransaction) {
// Prepare
let userPublicKey = getUserHexEncodedPublicKey()
let groupPublicKey = closedGroupUpdate.groupPublicKey.toHexString()
@ -426,7 +426,7 @@ public final class ClosedGroupsProtocol : NSObject {
}
/// Invoked upon receiving a sender key from another user.
private static func handleSenderKeyMessage(_ closedGroupUpdate: SSKProtoDataMessageClosedGroupUpdate, from senderPublicKey: String, using transaction: YapDatabaseReadWriteTransaction) {
private static func handleSenderKeyMessage(_ closedGroupUpdate: SNProtoDataMessageClosedGroupUpdate, from senderPublicKey: String, using transaction: YapDatabaseReadWriteTransaction) {
// Prepare
let groupPublicKey = closedGroupUpdate.groupPublicKey.toHexString()
guard let senderKey = closedGroupUpdate.senderKeys.first else {
@ -451,7 +451,7 @@ public final class ClosedGroupsProtocol : NSObject {
}
@objc(shouldIgnoreClosedGroupMessage:inThread:wrappedIn:)
public static func shouldIgnoreClosedGroupMessage(_ dataMessage: SSKProtoDataMessage, in thread: TSGroupThread, wrappedIn envelope: SSKProtoEnvelope) -> Bool {
public static func shouldIgnoreClosedGroupMessage(_ dataMessage: SNProtoDataMessage, in thread: TSGroupThread, wrappedIn envelope: SNProtoEnvelope) -> Bool {
guard thread.groupModel.groupType == .closedGroup else { return true }
let publicKey = envelope.source! // Set during UD decryption
return !thread.isUserMember(inGroup: publicKey)
@ -459,7 +459,7 @@ public final class ClosedGroupsProtocol : NSObject {
/// - Note: Deprecated.
@objc(shouldIgnoreClosedGroupUpdateMessage:inThread:wrappedIn:)
public static func shouldIgnoreClosedGroupUpdateMessage(_ dataMessage: SSKProtoDataMessage, in thread: TSGroupThread, wrappedIn envelope: SSKProtoEnvelope) -> Bool {
public static func shouldIgnoreClosedGroupUpdateMessage(_ dataMessage: SNProtoDataMessage, in thread: TSGroupThread, wrappedIn envelope: SNProtoEnvelope) -> Bool {
guard thread.groupModel.groupType == .closedGroup else { return true }
let publicKey = envelope.source! // Set during UD decryption
return !thread.isUserAdmin(inGroup: publicKey)

View File

@ -4,7 +4,6 @@
import Foundation
@objc
public class ContentProxy: NSObject {

View File

@ -69,8 +69,6 @@ NS_ASSUME_NONNULL_BEGIN
{
OWSAssertDebug(completion);
OWSDatabaseConnection *dbConnection = (OWSDatabaseConnection *)self.primaryStorage.newDatabaseConnection;
[LKStorage writeWithBlock:^(YapDatabaseReadWriteTransaction *_Nonnull transaction) {
[self runUpWithTransaction:transaction];
}

View File

@ -1,24 +0,0 @@
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import <SignalUtilitiesKit/OWSPrimaryStorage.h>
NS_ASSUME_NONNULL_BEGIN
@interface OWSPrimaryStorage (Calling)
// phoneNumber is an e164 formatted phone number.
//
// callKitId is expected to have CallKitCallManager.kAnonymousCallHandlePrefix.
- (void)setPhoneNumber:(NSString *)phoneNumber forCallKitId:(NSString *)callKitId;
// returns an e164 formatted phone number or nil if no
// record can be found.
//
// callKitId is expected to have CallKitCallManager.kAnonymousCallHandlePrefix.
- (NSString *)phoneNumberForCallKitId:(NSString *)callKitId;
@end
NS_ASSUME_NONNULL_END

View File

@ -1,35 +0,0 @@
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import "OWSPrimaryStorage+Calling.h"
#import "YapDatabaseConnection+OWS.h"
#import <SessionProtocolKit/SessionProtocolKit.h>
NS_ASSUME_NONNULL_BEGIN
NSString *const OWSPrimaryStorageCallKitIdToPhoneNumberCollection = @"TSStorageManagerCallKitIdToPhoneNumberCollection";
@implementation OWSPrimaryStorage (Calling)
- (void)setPhoneNumber:(NSString *)phoneNumber forCallKitId:(NSString *)callKitId
{
OWSAssertDebug(phoneNumber.length > 0);
OWSAssertDebug(callKitId.length > 0);
[self.dbReadWriteConnection setObject:phoneNumber
forKey:callKitId
inCollection:OWSPrimaryStorageCallKitIdToPhoneNumberCollection];
}
- (NSString *)phoneNumberForCallKitId:(NSString *)callKitId
{
OWSAssertDebug(callKitId.length > 0);
return
[self.dbReadConnection objectForKey:callKitId inCollection:OWSPrimaryStorageCallKitIdToPhoneNumberCollection];
}
@end
NS_ASSUME_NONNULL_END

View File

@ -9,7 +9,6 @@
#import "OWSFailedMessagesJob.h"
#import "OWSFileSystem.h"
#import "OWSIncomingMessageFinder.h"
#import "OWSIncompleteCallsJob.h"
#import "OWSMediaGalleryFinder.h"
#import "OWSStorage+Subclass.h"
#import "SSKEnvironment.h"
@ -203,7 +202,6 @@ void VerifyRegistrationsForPrimaryStorage(OWSStorage *storage)
[OWSIncomingMessageFinder asyncRegisterExtensionWithPrimaryStorage:self];
[OWSDisappearingMessagesFinder asyncRegisterDatabaseExtensions:self];
[OWSFailedMessagesJob asyncRegisterDatabaseExtensionsWithPrimaryStorage:self];
[OWSIncompleteCallsJob asyncRegisterDatabaseExtensionsWithPrimaryStorage:self];
[OWSFailedAttachmentDownloadsJob asyncRegisterDatabaseExtensionsWithPrimaryStorage:self];
[OWSMediaGalleryFinder asyncRegisterDatabaseExtensionsWithPrimaryStorage:self];
[TSDatabaseView asyncRegisterLazyRestoreAttachmentsDatabaseView:self];

View File

@ -1,13 +0,0 @@
public extension Dictionary {
public var prettifiedDescription: String {
return "[ " + map { key, value in
let keyDescription = String(describing: key)
let valueDescription = String(describing: value)
let maxLength = 20
let truncatedValueDescription = valueDescription.count > maxLength ? valueDescription.prefix(maxLength) + "..." : valueDescription
return keyDescription + " : " + truncatedValueDescription
}.joined(separator: ", ") + " ]"
}
}

View File

@ -1,164 +0,0 @@
// DO NOT EDIT.
// swift-format-ignore-file
//
// Generated by the Swift generator plugin for the protocol buffer compiler.
// Source: Fingerprint.proto
//
// For information on using the generated types, please see the documentation:
// https://github.com/apple/swift-protobuf/
/// iOS - since we use a modern proto-compiler, we must specify
/// the legacy proto format.
import Foundation
import SwiftProtobuf
// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
// incompatible with the version of SwiftProtobuf to which you are linking.
// Please ensure that you are building against the same version of the API
// that was used to generate this file.
fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
typealias Version = _2
}
struct FingerprintProtos_LogicalFingerprint {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
/// @required
var identityData: Data {
get {return _identityData ?? SwiftProtobuf.Internal.emptyData}
set {_identityData = newValue}
}
/// Returns true if `identityData` has been explicitly set.
var hasIdentityData: Bool {return self._identityData != nil}
/// Clears the value of `identityData`. Subsequent reads from it will return its default value.
mutating func clearIdentityData() {self._identityData = nil}
var unknownFields = SwiftProtobuf.UnknownStorage()
init() {}
fileprivate var _identityData: Data? = nil
}
struct FingerprintProtos_LogicalFingerprints {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
/// @required
var version: UInt32 {
get {return _version ?? 0}
set {_version = newValue}
}
/// Returns true if `version` has been explicitly set.
var hasVersion: Bool {return self._version != nil}
/// Clears the value of `version`. Subsequent reads from it will return its default value.
mutating func clearVersion() {self._version = nil}
/// @required
var localFingerprint: FingerprintProtos_LogicalFingerprint {
get {return _localFingerprint ?? FingerprintProtos_LogicalFingerprint()}
set {_localFingerprint = newValue}
}
/// Returns true if `localFingerprint` has been explicitly set.
var hasLocalFingerprint: Bool {return self._localFingerprint != nil}
/// Clears the value of `localFingerprint`. Subsequent reads from it will return its default value.
mutating func clearLocalFingerprint() {self._localFingerprint = nil}
/// @required
var remoteFingerprint: FingerprintProtos_LogicalFingerprint {
get {return _remoteFingerprint ?? FingerprintProtos_LogicalFingerprint()}
set {_remoteFingerprint = newValue}
}
/// Returns true if `remoteFingerprint` has been explicitly set.
var hasRemoteFingerprint: Bool {return self._remoteFingerprint != nil}
/// Clears the value of `remoteFingerprint`. Subsequent reads from it will return its default value.
mutating func clearRemoteFingerprint() {self._remoteFingerprint = nil}
var unknownFields = SwiftProtobuf.UnknownStorage()
init() {}
fileprivate var _version: UInt32? = nil
fileprivate var _localFingerprint: FingerprintProtos_LogicalFingerprint? = nil
fileprivate var _remoteFingerprint: FingerprintProtos_LogicalFingerprint? = nil
}
// MARK: - Code below here is support for the SwiftProtobuf runtime.
fileprivate let _protobuf_package = "FingerprintProtos"
extension FingerprintProtos_LogicalFingerprint: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let protoMessageName: String = _protobuf_package + ".LogicalFingerprint"
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "identityData"),
]
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
switch fieldNumber {
case 1: try decoder.decodeSingularBytesField(value: &self._identityData)
default: break
}
}
}
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
if let v = self._identityData {
try visitor.visitSingularBytesField(value: v, fieldNumber: 1)
}
try unknownFields.traverse(visitor: &visitor)
}
static func ==(lhs: FingerprintProtos_LogicalFingerprint, rhs: FingerprintProtos_LogicalFingerprint) -> Bool {
if lhs._identityData != rhs._identityData {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}
extension FingerprintProtos_LogicalFingerprints: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let protoMessageName: String = _protobuf_package + ".LogicalFingerprints"
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "version"),
2: .same(proto: "localFingerprint"),
3: .same(proto: "remoteFingerprint"),
]
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
switch fieldNumber {
case 1: try decoder.decodeSingularUInt32Field(value: &self._version)
case 2: try decoder.decodeSingularMessageField(value: &self._localFingerprint)
case 3: try decoder.decodeSingularMessageField(value: &self._remoteFingerprint)
default: break
}
}
}
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
if let v = self._version {
try visitor.visitSingularUInt32Field(value: v, fieldNumber: 1)
}
if let v = self._localFingerprint {
try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
}
if let v = self._remoteFingerprint {
try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
}
try unknownFields.traverse(visitor: &visitor)
}
static func ==(lhs: FingerprintProtos_LogicalFingerprints, rhs: FingerprintProtos_LogicalFingerprints) -> Bool {
if lhs._version != rhs._version {return false}
if lhs._localFingerprint != rhs._localFingerprint {return false}
if lhs._remoteFingerprint != rhs._remoteFingerprint {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}

View File

@ -1,235 +0,0 @@
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
import Foundation
// WARNING: This code is generated. Only edit within the markers.
public enum FingerprintProtoError: Error {
case invalidProtobuf(description: String)
}
// MARK: - FingerprintProtoLogicalFingerprint
@objc public class FingerprintProtoLogicalFingerprint: NSObject {
// MARK: - FingerprintProtoLogicalFingerprintBuilder
@objc public class func builder(identityData: Data) -> FingerprintProtoLogicalFingerprintBuilder {
return FingerprintProtoLogicalFingerprintBuilder(identityData: identityData)
}
// asBuilder() constructs a builder that reflects the proto's contents.
@objc public func asBuilder() -> FingerprintProtoLogicalFingerprintBuilder {
let builder = FingerprintProtoLogicalFingerprintBuilder(identityData: identityData)
return builder
}
@objc public class FingerprintProtoLogicalFingerprintBuilder: NSObject {
private var proto = FingerprintProtos_LogicalFingerprint()
@objc fileprivate override init() {}
@objc fileprivate init(identityData: Data) {
super.init()
setIdentityData(identityData)
}
@objc public func setIdentityData(_ valueParam: Data) {
proto.identityData = valueParam
}
@objc public func build() throws -> FingerprintProtoLogicalFingerprint {
return try FingerprintProtoLogicalFingerprint.parseProto(proto)
}
@objc public func buildSerializedData() throws -> Data {
return try FingerprintProtoLogicalFingerprint.parseProto(proto).serializedData()
}
}
fileprivate let proto: FingerprintProtos_LogicalFingerprint
@objc public let identityData: Data
private init(proto: FingerprintProtos_LogicalFingerprint,
identityData: Data) {
self.proto = proto
self.identityData = identityData
}
@objc
public func serializedData() throws -> Data {
return try self.proto.serializedData()
}
@objc public class func parseData(_ serializedData: Data) throws -> FingerprintProtoLogicalFingerprint {
let proto = try FingerprintProtos_LogicalFingerprint(serializedData: serializedData)
return try parseProto(proto)
}
fileprivate class func parseProto(_ proto: FingerprintProtos_LogicalFingerprint) throws -> FingerprintProtoLogicalFingerprint {
guard proto.hasIdentityData else {
throw FingerprintProtoError.invalidProtobuf(description: "\(logTag) missing required field: identityData")
}
let identityData = proto.identityData
// MARK: - Begin Validation Logic for FingerprintProtoLogicalFingerprint -
// MARK: - End Validation Logic for FingerprintProtoLogicalFingerprint -
let result = FingerprintProtoLogicalFingerprint(proto: proto,
identityData: identityData)
return result
}
@objc public override var debugDescription: String {
return "\(proto)"
}
}
#if DEBUG
extension FingerprintProtoLogicalFingerprint {
@objc public func serializedDataIgnoringErrors() -> Data? {
return try! self.serializedData()
}
}
extension FingerprintProtoLogicalFingerprint.FingerprintProtoLogicalFingerprintBuilder {
@objc public func buildIgnoringErrors() -> FingerprintProtoLogicalFingerprint? {
return try! self.build()
}
}
#endif
// MARK: - FingerprintProtoLogicalFingerprints
@objc public class FingerprintProtoLogicalFingerprints: NSObject {
// MARK: - FingerprintProtoLogicalFingerprintsBuilder
@objc public class func builder(version: UInt32, localFingerprint: FingerprintProtoLogicalFingerprint, remoteFingerprint: FingerprintProtoLogicalFingerprint) -> FingerprintProtoLogicalFingerprintsBuilder {
return FingerprintProtoLogicalFingerprintsBuilder(version: version, localFingerprint: localFingerprint, remoteFingerprint: remoteFingerprint)
}
// asBuilder() constructs a builder that reflects the proto's contents.
@objc public func asBuilder() -> FingerprintProtoLogicalFingerprintsBuilder {
let builder = FingerprintProtoLogicalFingerprintsBuilder(version: version, localFingerprint: localFingerprint, remoteFingerprint: remoteFingerprint)
return builder
}
@objc public class FingerprintProtoLogicalFingerprintsBuilder: NSObject {
private var proto = FingerprintProtos_LogicalFingerprints()
@objc fileprivate override init() {}
@objc fileprivate init(version: UInt32, localFingerprint: FingerprintProtoLogicalFingerprint, remoteFingerprint: FingerprintProtoLogicalFingerprint) {
super.init()
setVersion(version)
setLocalFingerprint(localFingerprint)
setRemoteFingerprint(remoteFingerprint)
}
@objc public func setVersion(_ valueParam: UInt32) {
proto.version = valueParam
}
@objc public func setLocalFingerprint(_ valueParam: FingerprintProtoLogicalFingerprint) {
proto.localFingerprint = valueParam.proto
}
@objc public func setRemoteFingerprint(_ valueParam: FingerprintProtoLogicalFingerprint) {
proto.remoteFingerprint = valueParam.proto
}
@objc public func build() throws -> FingerprintProtoLogicalFingerprints {
return try FingerprintProtoLogicalFingerprints.parseProto(proto)
}
@objc public func buildSerializedData() throws -> Data {
return try FingerprintProtoLogicalFingerprints.parseProto(proto).serializedData()
}
}
fileprivate let proto: FingerprintProtos_LogicalFingerprints
@objc public let version: UInt32
@objc public let localFingerprint: FingerprintProtoLogicalFingerprint
@objc public let remoteFingerprint: FingerprintProtoLogicalFingerprint
private init(proto: FingerprintProtos_LogicalFingerprints,
version: UInt32,
localFingerprint: FingerprintProtoLogicalFingerprint,
remoteFingerprint: FingerprintProtoLogicalFingerprint) {
self.proto = proto
self.version = version
self.localFingerprint = localFingerprint
self.remoteFingerprint = remoteFingerprint
}
@objc
public func serializedData() throws -> Data {
return try self.proto.serializedData()
}
@objc public class func parseData(_ serializedData: Data) throws -> FingerprintProtoLogicalFingerprints {
let proto = try FingerprintProtos_LogicalFingerprints(serializedData: serializedData)
return try parseProto(proto)
}
fileprivate class func parseProto(_ proto: FingerprintProtos_LogicalFingerprints) throws -> FingerprintProtoLogicalFingerprints {
guard proto.hasVersion else {
throw FingerprintProtoError.invalidProtobuf(description: "\(logTag) missing required field: version")
}
let version = proto.version
guard proto.hasLocalFingerprint else {
throw FingerprintProtoError.invalidProtobuf(description: "\(logTag) missing required field: localFingerprint")
}
let localFingerprint = try FingerprintProtoLogicalFingerprint.parseProto(proto.localFingerprint)
guard proto.hasRemoteFingerprint else {
throw FingerprintProtoError.invalidProtobuf(description: "\(logTag) missing required field: remoteFingerprint")
}
let remoteFingerprint = try FingerprintProtoLogicalFingerprint.parseProto(proto.remoteFingerprint)
// MARK: - Begin Validation Logic for FingerprintProtoLogicalFingerprints -
// MARK: - End Validation Logic for FingerprintProtoLogicalFingerprints -
let result = FingerprintProtoLogicalFingerprints(proto: proto,
version: version,
localFingerprint: localFingerprint,
remoteFingerprint: remoteFingerprint)
return result
}
@objc public override var debugDescription: String {
return "\(proto)"
}
}
#if DEBUG
extension FingerprintProtoLogicalFingerprints {
@objc public func serializedDataIgnoringErrors() -> Data? {
return try! self.serializedData()
}
}
extension FingerprintProtoLogicalFingerprints.FingerprintProtoLogicalFingerprintsBuilder {
@objc public func buildIgnoringErrors() -> FingerprintProtoLogicalFingerprints? {
return try! self.build()
}
}
#endif

View File

@ -181,7 +181,7 @@ public class FullTextSearchFinder: NSObject {
}
private static let recipientIndexer: SearchIndexer<String> = SearchIndexer { (recipientId: String, transaction: YapDatabaseReadTransaction) in
let displayName = SSKEnvironment.shared.profileManager.profileNameForRecipient(withID: recipientId, avoidingWriteTransaction: true)
let displayName = SSKEnvironment.shared.profileManager.profileNameForRecipient(withID: recipientId, avoidingWriteTransaction: true)!
return "\(recipientId) \(displayName)"
}

View File

@ -7,7 +7,7 @@
NS_ASSUME_NONNULL_BEGIN
@class SSKProtoEnvelope;
@class SNProtoEnvelope;
typedef NS_ENUM(int32_t, TSErrorMessageType) {
TSErrorMessageNoSession,
@ -52,18 +52,18 @@ typedef NS_ENUM(int32_t, TSErrorMessageType) {
failedMessageType:(TSErrorMessageType)errorMessageType
recipientId:(nullable NSString *)recipientId NS_DESIGNATED_INITIALIZER;
+ (instancetype)corruptedMessageWithEnvelope:(SSKProtoEnvelope *)envelope
+ (instancetype)corruptedMessageWithEnvelope:(SNProtoEnvelope *)envelope
withTransaction:(YapDatabaseReadWriteTransaction *)transaction;
+ (instancetype)corruptedMessageInUnknownThread;
+ (instancetype)invalidVersionWithEnvelope:(SSKProtoEnvelope *)envelope
+ (instancetype)invalidVersionWithEnvelope:(SNProtoEnvelope *)envelope
withTransaction:(YapDatabaseReadWriteTransaction *)transaction;
+ (instancetype)invalidKeyExceptionWithEnvelope:(SSKProtoEnvelope *)envelope
+ (instancetype)invalidKeyExceptionWithEnvelope:(SNProtoEnvelope *)envelope
withTransaction:(YapDatabaseReadWriteTransaction *)transaction;
+ (instancetype)missingSessionWithEnvelope:(SSKProtoEnvelope *)envelope
+ (instancetype)missingSessionWithEnvelope:(SNProtoEnvelope *)envelope
withTransaction:(YapDatabaseReadWriteTransaction *)transaction;
+ (instancetype)nonblockingIdentityChangeInThread:(TSThread *)thread recipientId:(NSString *)recipientId;

View File

@ -59,7 +59,6 @@ NSUInteger TSErrorMessageSchemaVersion = 1;
expiresInSeconds:0
expireStartedAt:0
quotedMessage:nil
contactShare:nil
linkPreview:nil];
if (!self) {
@ -84,7 +83,7 @@ NSUInteger TSErrorMessageSchemaVersion = 1;
return [self initWithTimestamp:timestamp inThread:thread failedMessageType:errorMessageType recipientId:nil];
}
- (instancetype)initWithEnvelope:(SSKProtoEnvelope *)envelope
- (instancetype)initWithEnvelope:(SNProtoEnvelope *)envelope
withTransaction:(YapDatabaseReadWriteTransaction *)transaction
failedMessageType:(TSErrorMessageType)errorMessageType
{
@ -143,7 +142,7 @@ NSUInteger TSErrorMessageSchemaVersion = 1;
}
}
+ (instancetype)corruptedMessageWithEnvelope:(SSKProtoEnvelope *)envelope
+ (instancetype)corruptedMessageWithEnvelope:(SNProtoEnvelope *)envelope
withTransaction:(YapDatabaseReadWriteTransaction *)transaction
{
return [[self alloc] initWithEnvelope:envelope
@ -159,7 +158,7 @@ NSUInteger TSErrorMessageSchemaVersion = 1;
failedMessageType:TSErrorMessageInvalidMessage];
}
+ (instancetype)invalidVersionWithEnvelope:(SSKProtoEnvelope *)envelope
+ (instancetype)invalidVersionWithEnvelope:(SNProtoEnvelope *)envelope
withTransaction:(YapDatabaseReadWriteTransaction *)transaction
{
return [[self alloc] initWithEnvelope:envelope
@ -167,7 +166,7 @@ NSUInteger TSErrorMessageSchemaVersion = 1;
failedMessageType:TSErrorMessageInvalidVersion];
}
+ (instancetype)invalidKeyExceptionWithEnvelope:(SSKProtoEnvelope *)envelope
+ (instancetype)invalidKeyExceptionWithEnvelope:(SNProtoEnvelope *)envelope
withTransaction:(YapDatabaseReadWriteTransaction *)transaction
{
return [[self alloc] initWithEnvelope:envelope
@ -175,7 +174,7 @@ NSUInteger TSErrorMessageSchemaVersion = 1;
failedMessageType:TSErrorMessageInvalidKeyException];
}
+ (instancetype)missingSessionWithEnvelope:(SSKProtoEnvelope *)envelope
+ (instancetype)missingSessionWithEnvelope:(SNProtoEnvelope *)envelope
withTransaction:(YapDatabaseReadWriteTransaction *)transaction
{
return

View File

@ -2,7 +2,7 @@
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import "TSErrorMessage.h"
#import <SignalUtilitiesKit/TSErrorMessage.h>
NS_ASSUME_NONNULL_BEGIN

View File

@ -48,18 +48,17 @@ NS_ASSUME_NONNULL_BEGIN
*
* @return initiated incoming group message
*/
- (instancetype)initIncomingMessageWithTimestamp:(uint64_t)timestamp
inThread:(TSThread *)thread
authorId:(NSString *)authorId
sourceDeviceId:(uint32_t)sourceDeviceId
messageBody:(nullable NSString *)body
attachmentIds:(NSArray<NSString *> *)attachmentIds
expiresInSeconds:(uint32_t)expiresInSeconds
quotedMessage:(nullable TSQuotedMessage *)quotedMessage
contactShare:(nullable OWSContact *)contactShare
linkPreview:(nullable OWSLinkPreview *)linkPreview
serverTimestamp:(nullable NSNumber *)serverTimestamp
wasReceivedByUD:(BOOL)wasReceivedByUD NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithTimestamp:(uint64_t)timestamp
inThread:(TSThread *)thread
authorId:(NSString *)authorId
sourceDeviceId:(uint32_t)sourceDeviceId
messageBody:(nullable NSString *)body
attachmentIds:(NSArray<NSString *> *)attachmentIds
expiresInSeconds:(uint32_t)expiresInSeconds
quotedMessage:(nullable TSQuotedMessage *)quotedMessage
linkPreview:(nullable OWSLinkPreview *)linkPreview
serverTimestamp:(nullable NSNumber *)serverTimestamp
wasReceivedByUD:(BOOL)wasReceivedByUD NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;

View File

@ -43,18 +43,17 @@ NS_ASSUME_NONNULL_BEGIN
return self;
}
- (instancetype)initIncomingMessageWithTimestamp:(uint64_t)timestamp
inThread:(TSThread *)thread
authorId:(NSString *)authorId
sourceDeviceId:(uint32_t)sourceDeviceId
messageBody:(nullable NSString *)body
attachmentIds:(NSArray<NSString *> *)attachmentIds
expiresInSeconds:(uint32_t)expiresInSeconds
quotedMessage:(nullable TSQuotedMessage *)quotedMessage
contactShare:(nullable OWSContact *)contactShare
linkPreview:(nullable OWSLinkPreview *)linkPreview
serverTimestamp:(nullable NSNumber *)serverTimestamp
wasReceivedByUD:(BOOL)wasReceivedByUD
- (instancetype)initWithTimestamp:(uint64_t)timestamp
inThread:(TSThread *)thread
authorId:(NSString *)authorId
sourceDeviceId:(uint32_t)sourceDeviceId
messageBody:(nullable NSString *)body
attachmentIds:(NSArray<NSString *> *)attachmentIds
expiresInSeconds:(uint32_t)expiresInSeconds
quotedMessage:(nullable TSQuotedMessage *)quotedMessage
linkPreview:(nullable OWSLinkPreview *)linkPreview
serverTimestamp:(nullable NSNumber *)serverTimestamp
wasReceivedByUD:(BOOL)wasReceivedByUD
{
self = [super initMessageWithTimestamp:timestamp
inThread:thread
@ -63,7 +62,6 @@ NS_ASSUME_NONNULL_BEGIN
expiresInSeconds:expiresInSeconds
expireStartedAt:0
quotedMessage:quotedMessage
contactShare:contactShare
linkPreview:linkPreview];
if (!self) {

View File

@ -56,7 +56,6 @@ NSUInteger TSInfoMessageSchemaVersion = 1;
expiresInSeconds:0
expireStartedAt:0
quotedMessage:nil
contactShare:nil
linkPreview:nil];
if (!self) {

View File

@ -6,14 +6,14 @@
NS_ASSUME_NONNULL_BEGIN
@class SSKProtoEnvelope;
@class SNProtoEnvelope;
// DEPRECATED - we no longer create new instances of this class (as of mid-2017); However, existing instances may
// exist, so we should keep this class around to honor their old behavior.
__attribute__((deprecated)) @interface TSInvalidIdentityKeyReceivingErrorMessage : TSInvalidIdentityKeyErrorMessage
#ifdef DEBUG
+ (nullable instancetype)untrustedKeyWithEnvelope:(SSKProtoEnvelope *)envelope
+ (nullable instancetype)untrustedKeyWithEnvelope:(SNProtoEnvelope *)envelope
withTransaction:(YapDatabaseReadWriteTransaction *)transaction;
#endif

View File

@ -25,7 +25,7 @@ __attribute__((deprecated)) @interface TSInvalidIdentityKeyReceivingErrorMessage
@implementation TSInvalidIdentityKeyReceivingErrorMessage {
// Not using a property declaration in order to exclude from DB serialization
SSKProtoEnvelope *_Nullable _envelope;
SNProtoEnvelope *_Nullable _envelope;
}
@synthesize envelopeData = _envelopeData;
@ -33,7 +33,7 @@ __attribute__((deprecated)) @interface TSInvalidIdentityKeyReceivingErrorMessage
#ifdef DEBUG
// We no longer create these messages, but they might exist on legacy clients so it's useful to be able to
// create them with the debug UI
+ (nullable instancetype)untrustedKeyWithEnvelope:(SSKProtoEnvelope *)envelope
+ (nullable instancetype)untrustedKeyWithEnvelope:(SNProtoEnvelope *)envelope
withTransaction:(YapDatabaseReadWriteTransaction *)transaction
{
TSContactThread *contactThread =
@ -49,7 +49,7 @@ __attribute__((deprecated)) @interface TSInvalidIdentityKeyReceivingErrorMessage
- (nullable instancetype)initForUnknownIdentityKeyWithTimestamp:(uint64_t)timestamp
inThread:(TSThread *)thread
incomingEnvelope:(SSKProtoEnvelope *)envelope
incomingEnvelope:(SNProtoEnvelope *)envelope
{
self = [self initWithTimestamp:timestamp inThread:thread failedMessageType:TSErrorMessageWrongTrustedIdentityKey];
if (!self) {
@ -69,11 +69,11 @@ __attribute__((deprecated)) @interface TSInvalidIdentityKeyReceivingErrorMessage
}
#endif
- (nullable SSKProtoEnvelope *)envelope
- (nullable SNProtoEnvelope *)envelope
{
if (!_envelope) {
NSError *error;
SSKProtoEnvelope *_Nullable envelope = [SSKProtoEnvelope parseData:self.envelopeData error:&error];
SNProtoEnvelope *_Nullable envelope = [SNProtoEnvelope parseData:self.envelopeData error:&error];
if (error || envelope == nil) {
OWSFailDebug(@"Could not parse proto: %@", error);
} else {
@ -120,7 +120,7 @@ __attribute__((deprecated)) @interface TSInvalidIdentityKeyReceivingErrorMessage
return nil;
}
if (self.envelope.type != SSKProtoEnvelopeTypePrekeyBundle) {
if (self.envelope.type != SNProtoEnvelopeTypePrekeyBundle) {
OWSLogError(@"Refusing to attempt key extraction from an envelope which isn't a prekey bundle");
return nil;
}

View File

@ -26,7 +26,6 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, readonly) uint64_t expiresAt;
@property (nonatomic, readonly) BOOL isExpiringMessage;
@property (nonatomic, readonly, nullable) TSQuotedMessage *quotedMessage;
@property (nonatomic, readonly, nullable) OWSContact *contactShare;
@property (nonatomic, nullable) OWSLinkPreview *linkPreview;
@property BOOL skipSave;
// Open groups
@ -44,7 +43,6 @@ NS_ASSUME_NONNULL_BEGIN
expiresInSeconds:(uint32_t)expiresInSeconds
expireStartedAt:(uint64_t)expireStartedAt
quotedMessage:(nullable TSQuotedMessage *)quotedMessage
contactShare:(nullable OWSContact *)contactShare
linkPreview:(nullable OWSLinkPreview *)linkPreview NS_DESIGNATED_INITIALIZER;
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;

View File

@ -63,7 +63,6 @@ static const NSUInteger OWSMessageSchemaVersion = 4;
expiresInSeconds:(uint32_t)expiresInSeconds
expireStartedAt:(uint64_t)expireStartedAt
quotedMessage:(nullable TSQuotedMessage *)quotedMessage
contactShare:(nullable OWSContact *)contactShare
linkPreview:(nullable OWSLinkPreview *)linkPreview
{
self = [super initInteractionWithTimestamp:timestamp inThread:thread];
@ -80,7 +79,6 @@ static const NSUInteger OWSMessageSchemaVersion = 4;
_expireStartedAt = expireStartedAt;
[self updateExpiresAt];
_quotedMessage = quotedMessage;
_contactShare = contactShare;
_linkPreview = linkPreview;
_openGroupServerMessageID = -1;

View File

@ -54,10 +54,10 @@ typedef NS_ENUM(NSInteger, TSGroupMetaMessage) {
TSGroupMetaMessageRequestInfo,
};
@class SSKProtoAttachmentPointer;
@class SSKProtoContentBuilder;
@class SSKProtoDataMessage;
@class SSKProtoDataMessageBuilder;
@class SNProtoAttachmentPointer;
@class SNProtoContentBuilder;
@class SNProtoDataMessage;
@class SNProtoDataMessageBuilder;
@class SignalRecipient;
@interface TSOutgoingMessageRecipientState : MTLModel
@ -83,7 +83,6 @@ typedef NS_ENUM(NSInteger, TSGroupMetaMessage) {
expiresInSeconds:(uint32_t)expiresInSeconds
expireStartedAt:(uint64_t)expireStartedAt
quotedMessage:(nullable TSQuotedMessage *)quotedMessage
contactShare:(nullable OWSContact *)contactShare
linkPreview:(nullable OWSLinkPreview *)linkPreview NS_UNAVAILABLE;
// MJK TODO - Can we remove the sender timestamp param?
@ -96,7 +95,6 @@ typedef NS_ENUM(NSInteger, TSGroupMetaMessage) {
isVoiceMessage:(BOOL)isVoiceMessage
groupMetaMessage:(TSGroupMetaMessage)groupMetaMessage
quotedMessage:(nullable TSQuotedMessage *)quotedMessage
contactShare:(nullable OWSContact *)contactShare
linkPreview:(nullable OWSLinkPreview *)linkPreview NS_DESIGNATED_INITIALIZER;
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
@ -156,7 +154,7 @@ typedef NS_ENUM(NSInteger, TSGroupMetaMessage) {
*/
- (nullable id)dataMessageBuilder;
- (nullable SSKProtoDataMessage *)buildDataMessage:(NSString *_Nullable)recipientId;
- (nullable SNProtoDataMessage *)buildDataMessage:(NSString *_Nullable)recipientId;
/**
* Allows subclasses to supply a custom content builder that has already prepared part of the message.

View File

@ -276,7 +276,6 @@ NSString *NSStringForOutgoingMessageRecipientState(OWSOutgoingMessageRecipientSt
isVoiceMessage:NO
groupMetaMessage:TSGroupMetaMessageUnspecified
quotedMessage:quotedMessage
contactShare:nil
linkPreview:linkPreview];
}
@ -294,7 +293,6 @@ NSString *NSStringForOutgoingMessageRecipientState(OWSOutgoingMessageRecipientSt
isVoiceMessage:NO
groupMetaMessage:groupMetaMessage
quotedMessage:nil
contactShare:nil
linkPreview:nil];
}
@ -307,7 +305,6 @@ NSString *NSStringForOutgoingMessageRecipientState(OWSOutgoingMessageRecipientSt
isVoiceMessage:(BOOL)isVoiceMessage
groupMetaMessage:(TSGroupMetaMessage)groupMetaMessage
quotedMessage:(nullable TSQuotedMessage *)quotedMessage
contactShare:(nullable OWSContact *)contactShare
linkPreview:(nullable OWSLinkPreview *)linkPreview
{
self = [super initMessageWithTimestamp:timestamp
@ -317,7 +314,6 @@ NSString *NSStringForOutgoingMessageRecipientState(OWSOutgoingMessageRecipientSt
expiresInSeconds:expiresInSeconds
expireStartedAt:expireStartedAt
quotedMessage:quotedMessage
contactShare:contactShare
linkPreview:linkPreview];
if (!self) {
return self;
@ -345,16 +341,7 @@ NSString *NSStringForOutgoingMessageRecipientState(OWSOutgoingMessageRecipientSt
// New outgoing messages should immediately determine their
// recipient list from current thread state.
NSMutableDictionary<NSString *, TSOutgoingMessageRecipientState *> *recipientStateMap = [NSMutableDictionary new];
NSArray<NSString *> *recipientIds;
// if ([self isKindOfClass:[OWSOutgoingSyncMessage class]]) {
// NSString *_Nullable localNumber = [TSAccountManager localNumber];
// OWSAssertDebug(localNumber);
// recipientIds = @[
// localNumber,
// ];
// } else {
// recipientIds = [thread recipientIdentifiers];
// }
NSArray<NSString *> *recipientIds = [thread recipientIdentifiers];
for (NSString *recipientId in recipientIds) {
TSOutgoingMessageRecipientState *recipientState = [TSOutgoingMessageRecipientState new];
recipientState.state = OWSOutgoingMessageRecipientStateSending;
@ -884,7 +871,7 @@ NSString *NSStringForOutgoingMessageRecipientState(OWSOutgoingMessageRecipientSt
TSThread *thread = self.thread;
OWSAssertDebug(thread);
SSKProtoDataMessageBuilder *builder = [SSKProtoDataMessage builder];
SNProtoDataMessageBuilder *builder = [SNProtoDataMessage builder];
[builder setTimestamp:self.timestamp];
if ([self.body lengthOfBytesUsingEncoding:NSUTF8StringEncoding] <= kOversizeTextMessageSizeThreshold) {
@ -905,25 +892,25 @@ NSString *NSStringForOutgoingMessageRecipientState(OWSOutgoingMessageRecipientSt
BOOL attachmentWasGroupAvatar = NO;
if ([thread isKindOfClass:[TSGroupThread class]]) {
TSGroupThread *gThread = (TSGroupThread *)thread;
SSKProtoGroupContextType groupMessageType;
SNProtoGroupContextType groupMessageType;
switch (self.groupMetaMessage) {
case TSGroupMetaMessageQuit:
groupMessageType = SSKProtoGroupContextTypeQuit;
groupMessageType = SNProtoGroupContextTypeQuit;
break;
case TSGroupMetaMessageUpdate:
case TSGroupMetaMessageNew:
groupMessageType = SSKProtoGroupContextTypeUpdate;
groupMessageType = SNProtoGroupContextTypeUpdate;
break;
default:
groupMessageType = SSKProtoGroupContextTypeDeliver;
groupMessageType = SNProtoGroupContextTypeDeliver;
break;
}
SSKProtoGroupContextBuilder *groupBuilder =
[SSKProtoGroupContext builderWithId:gThread.groupModel.groupId type:groupMessageType];
if (groupMessageType == SSKProtoGroupContextTypeUpdate) {
SNProtoGroupContextBuilder *groupBuilder =
[SNProtoGroupContext builderWithId:gThread.groupModel.groupId type:groupMessageType];
if (groupMessageType == SNProtoGroupContextTypeUpdate) {
if (gThread.groupModel.groupImage != nil && self.attachmentIds.count == 1) {
attachmentWasGroupAvatar = YES;
SSKProtoAttachmentPointer *_Nullable attachmentProto =
SNProtoAttachmentPointer *_Nullable attachmentProto =
[TSAttachmentStream buildProtoForAttachmentId:self.attachmentIds.firstObject];
if (!attachmentProto) {
OWSFailDebug(@"could not build protobuf.");
@ -937,7 +924,7 @@ NSString *NSStringForOutgoingMessageRecipientState(OWSOutgoingMessageRecipientSt
[groupBuilder setAdmins:gThread.groupModel.groupAdminIds];
}
NSError *error;
SSKProtoGroupContext *_Nullable groupContextProto = [groupBuilder buildAndReturnError:&error];
SNProtoGroupContext *_Nullable groupContextProto = [groupBuilder buildAndReturnError:&error];
if (error || !groupContextProto) {
OWSFailDebug(@"could not build protobuf: %@.", error);
return nil;
@ -949,7 +936,7 @@ NSString *NSStringForOutgoingMessageRecipientState(OWSOutgoingMessageRecipientSt
if (!attachmentWasGroupAvatar) {
NSMutableArray *attachments = [NSMutableArray new];
for (NSString *attachmentId in self.attachmentIds) {
SSKProtoAttachmentPointer *_Nullable attachmentProto =
SNProtoAttachmentPointer *_Nullable attachmentProto =
[TSAttachmentStream buildProtoForAttachmentId:attachmentId];
if (!attachmentProto) {
OWSFailDebug(@"could not build protobuf.");
@ -961,10 +948,10 @@ NSString *NSStringForOutgoingMessageRecipientState(OWSOutgoingMessageRecipientSt
}
// Quoted Reply
SSKProtoDataMessageQuoteBuilder *_Nullable quotedMessageBuilder = self.quotedMessageBuilder;
SNProtoDataMessageQuoteBuilder *_Nullable quotedMessageBuilder = self.quotedMessageBuilder;
if (quotedMessageBuilder) {
NSError *error;
SSKProtoDataMessageQuote *_Nullable quoteProto = [quotedMessageBuilder buildAndReturnError:&error];
SNProtoDataMessageQuote *_Nullable quoteProto = [quotedMessageBuilder buildAndReturnError:&error];
if (error || !quoteProto) {
OWSFailDebug(@"could not build protobuf: %@.", error);
return nil;
@ -974,13 +961,13 @@ NSString *NSStringForOutgoingMessageRecipientState(OWSOutgoingMessageRecipientSt
// Link Preview
if (self.linkPreview) {
SSKProtoDataMessagePreviewBuilder *previewBuilder =
[SSKProtoDataMessagePreview builderWithUrl:self.linkPreview.urlString];
SNProtoDataMessagePreviewBuilder *previewBuilder =
[SNProtoDataMessagePreview builderWithUrl:self.linkPreview.urlString];
if (self.linkPreview.title.length > 0) {
[previewBuilder setTitle:self.linkPreview.title];
}
if (self.linkPreview.imageAttachmentId) {
SSKProtoAttachmentPointer *_Nullable attachmentProto =
SNProtoAttachmentPointer *_Nullable attachmentProto =
[TSAttachmentStream buildProtoForAttachmentId:self.linkPreview.imageAttachmentId];
if (!attachmentProto) {
OWSFailDebug(@"Could not build link preview image protobuf.");
@ -990,7 +977,7 @@ NSString *NSStringForOutgoingMessageRecipientState(OWSOutgoingMessageRecipientSt
}
NSError *error;
SSKProtoDataMessagePreview *_Nullable previewProto = [previewBuilder buildAndReturnError:&error];
SNProtoDataMessagePreview *_Nullable previewProto = [previewBuilder buildAndReturnError:&error];
if (error || !previewProto) {
OWSFailDebug(@"Could not build link preview protobuf: %@.", error);
} else {
@ -1001,15 +988,15 @@ NSString *NSStringForOutgoingMessageRecipientState(OWSOutgoingMessageRecipientSt
return builder;
}
- (nullable SSKProtoDataMessageQuoteBuilder *)quotedMessageBuilder
- (nullable SNProtoDataMessageQuoteBuilder *)quotedMessageBuilder
{
if (!self.quotedMessage) {
return nil;
}
TSQuotedMessage *quotedMessage = self.quotedMessage;
SSKProtoDataMessageQuoteBuilder *quoteBuilder =
[SSKProtoDataMessageQuote builderWithId:quotedMessage.timestamp author:quotedMessage.authorId];
SNProtoDataMessageQuoteBuilder *quoteBuilder =
[SNProtoDataMessageQuote builderWithId:quotedMessage.timestamp author:quotedMessage.authorId];
BOOL hasQuotedText = NO;
BOOL hasQuotedAttachment = NO;
@ -1022,8 +1009,8 @@ NSString *NSStringForOutgoingMessageRecipientState(OWSOutgoingMessageRecipientSt
for (OWSAttachmentInfo *attachment in quotedMessage.quotedAttachments) {
hasQuotedAttachment = YES;
SSKProtoDataMessageQuoteQuotedAttachmentBuilder *quotedAttachmentBuilder =
[SSKProtoDataMessageQuoteQuotedAttachment builder];
SNProtoDataMessageQuoteQuotedAttachmentBuilder *quotedAttachmentBuilder =
[SNProtoDataMessageQuoteQuotedAttachment builder];
quotedAttachmentBuilder.contentType = attachment.contentType;
quotedAttachmentBuilder.fileName = attachment.sourceFilename;
@ -1033,7 +1020,7 @@ NSString *NSStringForOutgoingMessageRecipientState(OWSOutgoingMessageRecipientSt
}
NSError *error;
SSKProtoDataMessageQuoteQuotedAttachment *_Nullable quotedAttachmentMessage =
SNProtoDataMessageQuoteQuotedAttachment *_Nullable quotedAttachmentMessage =
[quotedAttachmentBuilder buildAndReturnError:&error];
if (error || !quotedAttachmentMessage) {
OWSFailDebug(@"could not build protobuf: %@", error);
@ -1053,10 +1040,10 @@ NSString *NSStringForOutgoingMessageRecipientState(OWSOutgoingMessageRecipientSt
}
// recipientId is nil when building "sent" sync messages for messages sent to groups.
- (nullable SSKProtoDataMessage *)buildDataMessage:(NSString *_Nullable)recipientId
- (nullable SNProtoDataMessage *)buildDataMessage:(NSString *_Nullable)recipientId
{
OWSAssertDebug(self.thread);
SSKProtoDataMessageBuilder *_Nullable builder = [self dataMessageBuilder];
SNProtoDataMessageBuilder *_Nullable builder = [self dataMessageBuilder];
if (builder == nil) {
OWSFailDebug(@"Couldn't build protobuf.");
return nil;
@ -1073,14 +1060,14 @@ NSString *NSStringForOutgoingMessageRecipientState(OWSOutgoingMessageRecipientSt
displayName = profileManager.localProfileName;
}
NSString *profilePictureURL = profileManager.profilePictureURL;
SSKProtoDataMessageLokiProfileBuilder *profileBuilder = [SSKProtoDataMessageLokiProfile builder];
SNProtoDataMessageLokiProfileBuilder *profileBuilder = [SNProtoDataMessageLokiProfile builder];
[profileBuilder setDisplayName:displayName];
[profileBuilder setProfilePicture:profilePictureURL ?: @""];
SSKProtoDataMessageLokiProfile *profile = [profileBuilder buildAndReturnError:nil];
SNProtoDataMessageLokiProfile *profile = [profileBuilder buildAndReturnError:nil];
[builder setProfile:profile];
NSError *error;
SSKProtoDataMessage *_Nullable dataProto = [builder buildAndReturnError:&error];
SNProtoDataMessage *_Nullable dataProto = [builder buildAndReturnError:&error];
if (error != nil || dataProto == nil) {
OWSFailDebug(@"Couldn't build protobuf due to error: %@.", error);
return nil;
@ -1089,14 +1076,14 @@ NSString *NSStringForOutgoingMessageRecipientState(OWSOutgoingMessageRecipientSt
}
- (nullable id)prepareCustomContentBuilder:(SignalRecipient *)recipient {
SSKProtoDataMessage *_Nullable dataMessage = [self buildDataMessage:recipient.recipientId];
SNProtoDataMessage *_Nullable dataMessage = [self buildDataMessage:recipient.recipientId];
if (dataMessage == nil) {
OWSFailDebug(@"Couldn't build protobuf.");
return nil;
}
SSKProtoContentBuilder *contentBuilder = SSKProtoContent.builder;
SNProtoContentBuilder *contentBuilder = SNProtoContent.builder;
[contentBuilder setDataMessage:dataMessage];
return contentBuilder;
@ -1104,7 +1091,7 @@ NSString *NSStringForOutgoingMessageRecipientState(OWSOutgoingMessageRecipientSt
- (nullable NSData *)buildPlainTextData:(SignalRecipient *)recipient
{
SSKProtoContentBuilder *contentBuilder = [self prepareCustomContentBuilder:recipient];
SNProtoContentBuilder *contentBuilder = [self prepareCustomContentBuilder:recipient];
NSError *error;
NSData *_Nullable contentData = [contentBuilder buildSerializedDataAndReturnError:&error];

View File

@ -7,7 +7,7 @@
NS_ASSUME_NONNULL_BEGIN
@class SSKProtoDataMessage;
@class SNProtoDataMessage;
@class TSAttachment;
@class TSAttachmentStream;
@class TSQuotedMessage;
@ -97,7 +97,7 @@ typedef NS_ENUM(NSUInteger, TSQuotedMessageContentSource) {
quotedAttachmentsForSending:(NSArray<TSAttachment *> *)attachments;
+ (nullable instancetype)quotedMessageForDataMessage:(SSKProtoDataMessage *)dataMessage
+ (nullable instancetype)quotedMessageForDataMessage:(SNProtoDataMessage *)dataMessage
thread:(TSThread *)thread
transaction:(YapDatabaseReadWriteTransaction *)transaction;

View File

@ -106,7 +106,7 @@ NS_ASSUME_NONNULL_BEGIN
return self;
}
+ (TSQuotedMessage *_Nullable)quotedMessageForDataMessage:(SSKProtoDataMessage *)dataMessage
+ (TSQuotedMessage *_Nullable)quotedMessageForDataMessage:(SNProtoDataMessage *)dataMessage
thread:(TSThread *)thread
transaction:(YapDatabaseReadWriteTransaction *)transaction
{
@ -116,7 +116,7 @@ NS_ASSUME_NONNULL_BEGIN
return nil;
}
SSKProtoDataMessageQuote *quoteProto = [dataMessage quote];
SNProtoDataMessageQuote *quoteProto = [dataMessage quote];
if (quoteProto.id == 0) {
OWSFailDebug(@"quoted message missing id");
@ -158,7 +158,7 @@ NS_ASSUME_NONNULL_BEGIN
}
NSMutableArray<OWSAttachmentInfo *> *attachmentInfos = [NSMutableArray new];
for (SSKProtoDataMessageQuoteQuotedAttachment *quotedAttachment in quoteProto.attachments) {
for (SNProtoDataMessageQuoteQuotedAttachment *quotedAttachment in quoteProto.attachments) {
hasAttachment = YES;
OWSAttachmentInfo *attachmentInfo = [[OWSAttachmentInfo alloc] initWithAttachmentId:nil
contentType:quotedAttachment.contentType
@ -185,7 +185,7 @@ NS_ASSUME_NONNULL_BEGIN
thread.uniqueId,
(unsigned long)timestamp);
SSKProtoAttachmentPointer *thumbnailAttachmentProto = quotedAttachment.thumbnail;
SNProtoAttachmentPointer *thumbnailAttachmentProto = quotedAttachment.thumbnail;
TSAttachmentPointer *_Nullable thumbnailPointer =
[TSAttachmentPointer attachmentPointerFromProto:thumbnailAttachmentProto albumMessage:nil];
if (thumbnailPointer) {

View File

@ -33,8 +33,6 @@ FOUNDATION_EXPORT const unsigned char SignalUtilitiesKitVersionString[];
#import <SignalUtilitiesKit/OWSBackgroundTask.h>
#import <SignalUtilitiesKit/OWSBackupFragment.h>
#import <SignalUtilitiesKit/OWSBlockingManager.h>
#import <SignalUtilitiesKit/OWSCallMessageHandler.h>
#import <SignalUtilitiesKit/OWSContactOffersInteraction.h>
#import <SignalUtilitiesKit/OWSDisappearingMessagesConfiguration.h>
#import <SignalUtilitiesKit/OWSDisappearingMessagesJob.h>
#import <SignalUtilitiesKit/OWSDispatch.h>
@ -77,7 +75,6 @@ FOUNDATION_EXPORT const unsigned char SignalUtilitiesKitVersionString[];
#import <SignalUtilitiesKit/ThreadUtil.h>
#import <SignalUtilitiesKit/TSAttachmentPointer.h>
#import <SignalUtilitiesKit/TSAttachmentStream.h>
#import <SignalUtilitiesKit/TSCall.h>
#import <SignalUtilitiesKit/TSContactThread.h>
#import <SignalUtilitiesKit/TSDatabaseView.h>
#import <SignalUtilitiesKit/TSErrorMessage.h>
@ -85,6 +82,8 @@ FOUNDATION_EXPORT const unsigned char SignalUtilitiesKitVersionString[];
#import <SignalUtilitiesKit/TSGroupThread.h>
#import <SignalUtilitiesKit/TSIncomingMessage.h>
#import <SignalUtilitiesKit/TSInfoMessage.h>
#import <SignalUtilitiesKit/TSInteraction.h>
#import <SignalUtilitiesKit/TSMessage.h>
#import <SignalUtilitiesKit/TSOutgoingMessage.h>
#import <SignalUtilitiesKit/TSPreKeyManager.h>
#import <SignalUtilitiesKit/TSQuotedMessage.h>

View File

@ -1,29 +0,0 @@
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
@objc
public class NoopCallMessageHandler: NSObject, OWSCallMessageHandler {
public func receivedOffer(_ offer: SSKProtoCallMessageOffer, from callerId: String) {
owsFailDebug("")
}
public func receivedAnswer(_ answer: SSKProtoCallMessageAnswer, from callerId: String) {
owsFailDebug("")
}
public func receivedIceUpdate(_ iceUpdate: SSKProtoCallMessageIceUpdate, from callerId: String) {
owsFailDebug("")
}
public func receivedHangup(_ hangup: SSKProtoCallMessageHangup, from callerId: String) {
owsFailDebug("")
}
public func receivedBusy(_ busy: SSKProtoCallMessageBusy, from callerId: String) {
owsFailDebug("")
}
}

View File

@ -10,7 +10,7 @@ extern NSString *const kAttachmentDownloadProgressNotification;
extern NSString *const kAttachmentDownloadProgressKey;
extern NSString *const kAttachmentDownloadAttachmentIDKey;
@class SSKProtoAttachmentPointer;
@class SNProtoAttachmentPointer;
@class TSAttachment;
@class TSAttachmentPointer;
@class TSAttachmentStream;

View File

@ -1,30 +0,0 @@
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@class SSKProtoCallMessageAnswer;
@class SSKProtoCallMessageBusy;
@class SSKProtoCallMessageHangup;
@class SSKProtoCallMessageIceUpdate;
@class SSKProtoCallMessageOffer;
@protocol OWSCallMessageHandler <NSObject>
- (void)receivedOffer:(SSKProtoCallMessageOffer *)offer
fromCallerId:(NSString *)callerId NS_SWIFT_NAME(receivedOffer(_:from:));
- (void)receivedAnswer:(SSKProtoCallMessageAnswer *)answer
fromCallerId:(NSString *)callerId NS_SWIFT_NAME(receivedAnswer(_:from:));
- (void)receivedIceUpdate:(SSKProtoCallMessageIceUpdate *)iceUpdate
fromCallerId:(NSString *)callerId NS_SWIFT_NAME(receivedIceUpdate(_:from:));
- (void)receivedHangup:(SSKProtoCallMessageHangup *)hangup
fromCallerId:(NSString *)callerId NS_SWIFT_NAME(receivedHangup(_:from:));
- (void)receivedBusy:(SSKProtoCallMessageBusy *)busy
fromCallerId:(NSString *)callerId NS_SWIFT_NAME(receivedBusy(_:from:));
@end
NS_ASSUME_NONNULL_END

View File

@ -1,38 +0,0 @@
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import <SignalUtilitiesKit/TSInteraction.h>
@class YapDatabaseReadWriteTransaction;
NS_ASSUME_NONNULL_BEGIN
@interface OWSContactOffersInteraction : TSInteraction
@property (nonatomic, readonly) BOOL hasBlockOffer;
@property (nonatomic, readonly) BOOL hasAddToContactsOffer;
@property (nonatomic, readonly) BOOL hasAddToProfileWhitelistOffer;
// TODO - remove this recipientId param
// it's redundant with the interaction's TSContactThread
@property (nonatomic, readonly) NSString *recipientId;
@property (nonatomic, readonly) NSString *beforeInteractionId;
- (instancetype)initInteractionWithTimestamp:(uint64_t)timestamp inThread:(TSThread *)thread NS_UNAVAILABLE;
- (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
// MJK TODO should be safe to remove this timestamp param
- (instancetype)initInteractionWithUniqueId:(NSString *)uniqueId
timestamp:(uint64_t)timestamp
thread:(TSThread *)thread
hasBlockOffer:(BOOL)hasBlockOffer
hasAddToContactsOffer:(BOOL)hasAddToContactsOffer
hasAddToProfileWhitelistOffer:(BOOL)hasAddToProfileWhitelistOffer
recipientId:(NSString *)recipientId
beforeInteractionId:(NSString *)beforeInteractionId NS_DESIGNATED_INITIALIZER;
@end
NS_ASSUME_NONNULL_END

View File

@ -1,73 +0,0 @@
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import "OWSContactOffersInteraction.h"
NS_ASSUME_NONNULL_BEGIN
@interface OWSContactOffersInteraction ()
@property (nonatomic) BOOL hasBlockOffer;
@property (nonatomic) BOOL hasAddToContactsOffer;
@property (nonatomic) BOOL hasAddToProfileWhitelistOffer;
@end
@implementation OWSContactOffersInteraction
- (instancetype)initWithCoder:(NSCoder *)coder
{
return [super initWithCoder:coder];
}
- (instancetype)initInteractionWithUniqueId:(NSString *)uniqueId
timestamp:(uint64_t)timestamp
thread:(TSThread *)thread
hasBlockOffer:(BOOL)hasBlockOffer
hasAddToContactsOffer:(BOOL)hasAddToContactsOffer
hasAddToProfileWhitelistOffer:(BOOL)hasAddToProfileWhitelistOffer
recipientId:(NSString *)recipientId
beforeInteractionId:(NSString *)beforeInteractionId
{
self = [super initInteractionWithUniqueId:uniqueId timestamp:timestamp inThread:thread];
if (!self) {
return self;
}
_hasBlockOffer = hasBlockOffer;
_hasAddToContactsOffer = hasAddToContactsOffer;
_hasAddToProfileWhitelistOffer = hasAddToProfileWhitelistOffer;
OWSAssertDebug(recipientId.length > 0);
_recipientId = recipientId;
_beforeInteractionId = beforeInteractionId;
return self;
}
- (BOOL)shouldUseReceiptDateForSorting
{
// Use the timestamp, not the "received at" timestamp to sort,
// since we're creating these interactions after the fact and back-dating them.
return NO;
}
- (BOOL)isDynamicInteraction
{
return YES;
}
- (OWSInteractionType)interactionType
{
return OWSInteractionType_Offer;
}
- (void)saveWithTransaction:(YapDatabaseReadWriteTransaction *)transaction
{
OWSFailDebug(@"This interaction should never be saved to the database.");
}
@end
NS_ASSUME_NONNULL_END

View File

@ -30,13 +30,13 @@ disappearingMessagesConfiguration:(nullable OWSDisappearingMessagesConfiguration
OWSAssertDebug(signalAccount);
OWSAssertDebug(contactsManager);
SSKProtoContactDetailsBuilder *contactBuilder =
[SSKProtoContactDetails builderWithNumber:signalAccount.recipientId];
SNProtoContactDetailsBuilder *contactBuilder =
[SNProtoContactDetails builderWithNumber:signalAccount.recipientId];
[contactBuilder setName:[LKUserDisplayNameUtilities getPrivateChatDisplayNameFor:signalAccount.recipientId] ?: signalAccount.recipientId];
[contactBuilder setColor:conversationColorName];
if (recipientIdentity != nil) {
SSKProtoVerified *_Nullable verified = BuildVerifiedProtoWithRecipientId(recipientIdentity.recipientId,
SNProtoVerified *_Nullable verified = BuildVerifiedProtoWithRecipientId(recipientIdentity.recipientId,
[recipientIdentity.identityKey prependKeyType],
recipientIdentity.verificationState,
0);

View File

@ -22,7 +22,7 @@ NS_ASSUME_NONNULL_BEGIN
{
return [self initWithThreadId:threadId
enabled:NO
durationSeconds:OWSDisappearingMessagesConfigurationDefaultExpirationDuration];
durationSeconds:(NSTimeInterval)OWSDisappearingMessagesConfigurationDefaultExpirationDuration];
}
- (nullable instancetype)initWithCoder:(NSCoder *)coder

View File

@ -22,7 +22,7 @@ NS_ASSUME_NONNULL_BEGIN
TSGroupModel *group = groupThread.groupModel;
OWSAssertDebug(group);
SSKProtoGroupDetailsBuilder *groupBuilder = [SSKProtoGroupDetails builderWithId:group.groupId];
SNProtoGroupDetailsBuilder *groupBuilder = [SNProtoGroupDetails builderWithId:group.groupId];
[groupBuilder setName:group.groupName];
[groupBuilder setMembers:group.groupMemberIds];
[groupBuilder setAdmins:group.groupAdminIds];

View File

@ -28,7 +28,7 @@ extern const NSUInteger kStoredIdentityKeyLength;
@class OWSRecipientIdentity;
@class OWSStorage;
@class SSKProtoVerified;
@class SNProtoVerified;
@class YapDatabaseReadWriteTransaction;
// This class can be safely accessed and used from any thread.
@ -54,7 +54,7 @@ extern const NSUInteger kStoredIdentityKeyLength;
- (nullable OWSRecipientIdentity *)untrustedIdentityForSendingToRecipientId:(NSString *)recipientId;
// This method can be called from any thread.
- (void)throws_processIncomingSyncMessage:(SSKProtoVerified *)verified
- (void)throws_processIncomingSyncMessage:(SNProtoVerified *)verified
transaction:(YapDatabaseReadWriteTransaction *)transaction;
- (BOOL)saveRemoteIdentity:(NSData *)identityKey recipientId:(NSString *)recipientId;

View File

@ -527,7 +527,7 @@ NSString *const kNSNotificationName_IdentityStateDidChange = @"kNSNotificationNa
[transaction removeObjectForKey:recipientId inCollection:OWSIdentityManager_QueuedVerificationStateSyncMessages];
}
- (void)throws_processIncomingSyncMessage:(SSKProtoVerified *)verified
- (void)throws_processIncomingSyncMessage:(SNProtoVerified *)verified
transaction:(YapDatabaseReadWriteTransaction *)transaction
{
OWSAssertDebug(verified);
@ -548,21 +548,21 @@ NSString *const kNSNotificationName_IdentityStateDidChange = @"kNSNotificationNa
NSData *identityKey = [rawIdentityKey throws_removeKeyType];
switch (verified.state) {
case SSKProtoVerifiedStateDefault:
case SNProtoVerifiedStateDefault:
[self tryToApplyVerificationStateFromSyncMessage:OWSVerificationStateDefault
recipientId:recipientId
identityKey:identityKey
overwriteOnConflict:NO
transaction:transaction];
break;
case SSKProtoVerifiedStateVerified:
case SNProtoVerifiedStateVerified:
[self tryToApplyVerificationStateFromSyncMessage:OWSVerificationStateVerified
recipientId:recipientId
identityKey:identityKey
overwriteOnConflict:YES
transaction:transaction];
break;
case SSKProtoVerifiedStateUnverified:
case SNProtoVerifiedStateUnverified:
OWSFailDebug(@"Verification state sync message for recipientId: %@ has unexpected value: %@.",
recipientId,
OWSVerificationStateToString(OWSVerificationStateNoLongerVerified));

View File

@ -1,31 +0,0 @@
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@class OWSPrimaryStorage;
@class OWSStorage;
@interface OWSIncompleteCallsJob : NSObject
- (instancetype)init NS_UNAVAILABLE;
- (instancetype)initWithPrimaryStorage:(OWSPrimaryStorage *)primaryStorage NS_DESIGNATED_INITIALIZER;
- (void)run;
+ (NSString *)databaseExtensionName;
+ (void)asyncRegisterDatabaseExtensionsWithPrimaryStorage:(OWSStorage *)storage;
#ifdef DEBUG
/**
* Only use the sync version for testing, generally we'll want to register extensions async
*/
- (void)blockingRegisterDatabaseExtensions;
#endif
@end
NS_ASSUME_NONNULL_END

View File

@ -1,160 +0,0 @@
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import "OWSIncompleteCallsJob.h"
#import "AppContext.h"
#import "OWSPrimaryStorage.h"
#import "TSCall.h"
#import <SignalCoreKit/NSDate+OWS.h>
#import <YapDatabase/YapDatabase.h>
#import <YapDatabase/YapDatabaseQuery.h>
#import <YapDatabase/YapDatabaseSecondaryIndex.h>
#import <SignalUtilitiesKit/SignalUtilitiesKit-Swift.h>
NS_ASSUME_NONNULL_BEGIN
static NSString *const OWSIncompleteCallsJobCallTypeColumn = @"call_type";
static NSString *const OWSIncompleteCallsJobCallTypeIndex = @"index_calls_on_call_type";
@interface OWSIncompleteCallsJob ()
@property (nonatomic, readonly) OWSPrimaryStorage *primaryStorage;
@end
#pragma mark -
@implementation OWSIncompleteCallsJob
- (instancetype)initWithPrimaryStorage:(OWSPrimaryStorage *)primaryStorage
{
self = [super init];
if (!self) {
return self;
}
_primaryStorage = primaryStorage;
return self;
}
- (NSArray<NSString *> *)fetchIncompleteCallIdsWithTransaction:(YapDatabaseReadWriteTransaction *)transaction
{
OWSAssertDebug(transaction);
NSMutableArray<NSString *> *messageIds = [NSMutableArray new];
NSString *formattedString = [NSString stringWithFormat:@"WHERE %@ == %d OR %@ == %d",
OWSIncompleteCallsJobCallTypeColumn,
(int)RPRecentCallTypeOutgoingIncomplete,
OWSIncompleteCallsJobCallTypeColumn,
(int)RPRecentCallTypeIncomingIncomplete];
YapDatabaseQuery *query = [YapDatabaseQuery queryWithFormat:formattedString];
[[transaction ext:OWSIncompleteCallsJobCallTypeIndex]
enumerateKeysMatchingQuery:query
usingBlock:^void(NSString *collection, NSString *key, BOOL *stop) {
[messageIds addObject:key];
}];
return [messageIds copy];
}
- (void)enumerateIncompleteCallsWithBlock:(void (^)(TSCall *call))block
transaction:(YapDatabaseReadWriteTransaction *)transaction
{
OWSAssertDebug(transaction);
// Since we can't directly mutate the enumerated "incomplete" calls, we store only their ids in hopes
// of saving a little memory and then enumerate the (larger) TSCall objects one at a time.
for (NSString *callId in [self fetchIncompleteCallIdsWithTransaction:transaction]) {
TSCall *_Nullable call = [TSCall fetchObjectWithUniqueID:callId transaction:transaction];
if ([call isKindOfClass:[TSCall class]]) {
block(call);
} else {
OWSLogError(@"unexpected object: %@", call);
}
}
}
- (void)run
{
__block uint count = 0;
OWSAssertDebug(CurrentAppContext().appLaunchTime);
uint64_t cutoffTimestamp = [NSDate ows_millisecondsSince1970ForDate:CurrentAppContext().appLaunchTime];
[LKStorage writeSyncWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
[self
enumerateIncompleteCallsWithBlock:^(TSCall *call) {
if (call.timestamp <= cutoffTimestamp) {
OWSLogInfo(@"ignoring new call: %@", call.uniqueId);
return;
}
if (call.callType == RPRecentCallTypeOutgoingIncomplete) {
OWSLogDebug(@"marking call as missed: %@", call.uniqueId);
[call updateCallType:RPRecentCallTypeOutgoingMissed transaction:transaction];
OWSAssertDebug(call.callType == RPRecentCallTypeOutgoingMissed);
} else if (call.callType == RPRecentCallTypeIncomingIncomplete) {
OWSLogDebug(@"marking call as missed: %@", call.uniqueId);
[call updateCallType:RPRecentCallTypeIncomingMissed transaction:transaction];
OWSAssertDebug(call.callType == RPRecentCallTypeIncomingMissed);
} else {
OWSFailDebug(@"call has unexpected call type: %@", NSStringFromCallType(call.callType));
return;
}
count++;
}
transaction:transaction];
}];
OWSLogInfo(@"Marked %u calls as missed", count);
}
#pragma mark - YapDatabaseExtension
+ (YapDatabaseSecondaryIndex *)indexDatabaseExtension
{
YapDatabaseSecondaryIndexSetup *setup = [YapDatabaseSecondaryIndexSetup new];
[setup addColumn:OWSIncompleteCallsJobCallTypeColumn withType:YapDatabaseSecondaryIndexTypeInteger];
YapDatabaseSecondaryIndexHandler *handler =
[YapDatabaseSecondaryIndexHandler withObjectBlock:^(YapDatabaseReadTransaction *transaction,
NSMutableDictionary *dict,
NSString *collection,
NSString *key,
id object) {
if (![object isKindOfClass:[TSCall class]]) {
return;
}
TSCall *call = (TSCall *)object;
dict[OWSIncompleteCallsJobCallTypeColumn] = @(call.callType);
}];
return [[YapDatabaseSecondaryIndex alloc] initWithSetup:setup handler:handler versionTag:nil];
}
#ifdef DEBUG
// Useful for tests, don't use in app startup path because it's slow.
- (void)blockingRegisterDatabaseExtensions
{
[self.primaryStorage registerExtension:[self.class indexDatabaseExtension]
withName:OWSIncompleteCallsJobCallTypeIndex];
}
#endif
+ (NSString *)databaseExtensionName
{
return OWSIncompleteCallsJobCallTypeIndex;
}
+ (void)asyncRegisterDatabaseExtensionsWithPrimaryStorage:(OWSStorage *)storage
{
[storage asyncRegisterExtension:[self indexDatabaseExtension] withName:OWSIncompleteCallsJobCallTypeIndex];
}
@end
NS_ASSUME_NONNULL_END

View File

@ -128,7 +128,7 @@ public class OWSLinkPreview: MTLModel {
}
@objc
public class func buildValidatedLinkPreview(dataMessage: SSKProtoDataMessage,
public class func buildValidatedLinkPreview(dataMessage: SNProtoDataMessage,
body: String?,
transaction: YapDatabaseReadWriteTransaction) throws -> OWSLinkPreview {
guard OWSLinkPreview.featureEnabled else {

View File

@ -7,7 +7,7 @@
NS_ASSUME_NONNULL_BEGIN
@class OWSPrimaryStorage;
@class SSKProtoEnvelope;
@class SNProtoEnvelope;
@interface OWSOutgoingReceiptManager : NSObject
@ -15,7 +15,7 @@ NS_ASSUME_NONNULL_BEGIN
- (instancetype)initWithPrimaryStorage:(OWSPrimaryStorage *)primaryStorage NS_DESIGNATED_INITIALIZER;
+ (instancetype)sharedManager;
- (void)enqueueDeliveryReceiptForEnvelope:(SSKProtoEnvelope *)envelope;
- (void)enqueueDeliveryReceiptForEnvelope:(SNProtoEnvelope *)envelope;
- (void)enqueueReadReceiptForEnvelope:(NSString *)messageAuthorId timestamp:(uint64_t)timestamp;

View File

@ -217,7 +217,7 @@ NSString *const kOutgoingReadReceiptManagerCollection = @"kOutgoingReadReceiptMa
return [sendPromises copy];
}
- (void)enqueueDeliveryReceiptForEnvelope:(SSKProtoEnvelope *)envelope
- (void)enqueueDeliveryReceiptForEnvelope:(SNProtoEnvelope *)envelope
{
[self enqueueReceiptWithRecipientId:envelope.source
timestamp:envelope.timestamp

View File

@ -7,7 +7,7 @@
NS_ASSUME_NONNULL_BEGIN
@class OWSPrimaryStorage;
@class SSKProtoSyncMessageRead;
@class SNProtoSyncMessageRead;
@class TSIncomingMessage;
@class TSOutgoingMessage;
@class TSThread;
@ -53,7 +53,7 @@ extern NSString *const kIncomingMessageMarkedAsReadNotification;
#pragma mark - Linked Device Read Receipts
- (void)processReadReceiptsFromLinkedDevice:(NSArray<SSKProtoSyncMessageRead *> *)readReceiptProtos
- (void)processReadReceiptsFromLinkedDevice:(NSArray<SNProtoSyncMessageRead *> *)readReceiptProtos
readTimestamp:(uint64_t)readTimestamp
transaction:(YapDatabaseReadWriteTransaction *)transaction;

View File

@ -396,7 +396,7 @@ NSString *const OWSReadReceiptManagerAreReadReceiptsEnabled = @"areReadReceiptsE
*/
}
- (void)processReadReceiptsFromLinkedDevice:(NSArray<SSKProtoSyncMessageRead *> *)readReceiptProtos
- (void)processReadReceiptsFromLinkedDevice:(NSArray<SNProtoSyncMessageRead *> *)readReceiptProtos
readTimestamp:(uint64_t)readTimestamp
transaction:(YapDatabaseReadWriteTransaction *)transaction
{
@ -406,7 +406,7 @@ NSString *const OWSReadReceiptManagerAreReadReceiptsEnabled = @"areReadReceiptsE
OWSAssertDebug(readReceiptProtos);
OWSAssertDebug(transaction);
for (SSKProtoSyncMessageRead *readReceiptProto in readReceiptProtos) {
for (SNProtoSyncMessageRead *readReceiptProto in readReceiptProtos) {
NSString *_Nullable senderId = readReceiptProto.sender;
uint64_t messageIdTimestamp = readReceiptProto.timestamp;

View File

@ -12,10 +12,10 @@ typedef NS_ENUM(NSUInteger, OWSVerificationState) {
OWSVerificationStateNoLongerVerified,
};
@class SSKProtoVerified;
@class SNProtoVerified;
NSString *OWSVerificationStateToString(OWSVerificationState verificationState);
SSKProtoVerified *_Nullable BuildVerifiedProtoWithRecipientId(NSString *destinationRecipientId,
SNProtoVerified *_Nullable BuildVerifiedProtoWithRecipientId(NSString *destinationRecipientId,
NSData *identityKey,
OWSVerificationState verificationState,
NSUInteger paddingBytesLength);

View File

@ -24,19 +24,19 @@ NSString *OWSVerificationStateToString(OWSVerificationState verificationState)
}
}
SSKProtoVerifiedState OWSVerificationStateToProtoState(OWSVerificationState verificationState)
SNProtoVerifiedState OWSVerificationStateToProtoState(OWSVerificationState verificationState)
{
switch (verificationState) {
case OWSVerificationStateDefault:
return SSKProtoVerifiedStateDefault;
return SNProtoVerifiedStateDefault;
case OWSVerificationStateVerified:
return SSKProtoVerifiedStateVerified;
return SNProtoVerifiedStateVerified;
case OWSVerificationStateNoLongerVerified:
return SSKProtoVerifiedStateUnverified;
return SNProtoVerifiedStateUnverified;
}
}
SSKProtoVerified *_Nullable BuildVerifiedProtoWithRecipientId(NSString *destinationRecipientId,
SNProtoVerified *_Nullable BuildVerifiedProtoWithRecipientId(NSString *destinationRecipientId,
NSData *identityKey,
OWSVerificationState verificationState,
NSUInteger paddingBytesLength)
@ -47,7 +47,7 @@ SSKProtoVerified *_Nullable BuildVerifiedProtoWithRecipientId(NSString *destinat
// will figure that out on it's own.
OWSCAssertDebug(verificationState != OWSVerificationStateNoLongerVerified);
SSKProtoVerifiedBuilder *verifiedBuilder = [SSKProtoVerified builderWithDestination:destinationRecipientId];
SNProtoVerifiedBuilder *verifiedBuilder = [SNProtoVerified builderWithDestination:destinationRecipientId];
verifiedBuilder.identityKey = identityKey;
verifiedBuilder.state = OWSVerificationStateToProtoState(verificationState);
@ -61,7 +61,7 @@ SSKProtoVerified *_Nullable BuildVerifiedProtoWithRecipientId(NSString *destinat
}
NSError *error;
SSKProtoVerified *_Nullable verifiedProto = [verifiedBuilder buildAndReturnError:&error];
SNProtoVerified *_Nullable verifiedProto = [verifiedBuilder buildAndReturnError:&error];
if (error || !verifiedProto) {
OWSCFailDebug(@"%@ could not build protobuf: %@", @"[BuildVerifiedProtoWithRecipientId]", error);
return nil;

View File

@ -7,7 +7,7 @@
NS_ASSUME_NONNULL_BEGIN
@class OWSIncomingSentMessageTranscript;
@class SSKProtoSyncMessageSentUpdate;
@class SNProtoSyncMessageSentUpdate;
@class TSAttachmentStream;
@class YapDatabaseReadWriteTransaction;

View File

@ -32,7 +32,7 @@ public class OWSProximityMonitoringManagerImpl: NSObject, OWSProximityMonitoring
public func add(lifetime: AnyObject) {
objc_sync_enter(self)
if !lifetimes.contains { $0.value === lifetime } {
if !lifetimes.contains(where: { $0.value === lifetime }) {
lifetimes.append(Weak(value: lifetime))
}
reconcile()

View File

@ -73,12 +73,12 @@ public final class PublicChatPoller : NSObject {
}
let senderDisplayName = UserDisplayNameUtilities.getPublicChatDisplayName(for: senderPublicKey, in: publicChat.channel, on: publicChat.server) ?? generateDisplayName(from: NSLocalizedString("Anonymous", comment: ""))
let id = LKGroupUtilities.getEncodedOpenGroupIDAsData(publicChat.id)
let groupContext = SSKProtoGroupContext.builder(id: id, type: .deliver)
let groupContext = SNProtoGroupContext.builder(id: id, type: .deliver)
groupContext.setName(publicChat.displayName)
let dataMessage = SSKProtoDataMessage.builder()
let attachments: [SSKProtoAttachmentPointer] = message.attachments.compactMap { attachment in
let dataMessage = SNProtoDataMessage.builder()
let attachments: [SNProtoAttachmentPointer] = message.attachments.compactMap { attachment in
guard attachment.kind == .attachment else { return nil }
let result = SSKProtoAttachmentPointer.builder(id: attachment.serverID)
let result = SNProtoAttachmentPointer.builder(id: attachment.serverID)
result.setContentType(attachment.contentType)
result.setSize(UInt32(attachment.size))
result.setFileName(attachment.fileName)
@ -93,9 +93,9 @@ public final class PublicChatPoller : NSObject {
}
dataMessage.setAttachments(attachments)
if let linkPreview = message.attachments.first(where: { $0.kind == .linkPreview }) {
let signalLinkPreview = SSKProtoDataMessagePreview.builder(url: linkPreview.linkPreviewURL!)
let signalLinkPreview = SNProtoDataMessagePreview.builder(url: linkPreview.linkPreviewURL!)
signalLinkPreview.setTitle(linkPreview.linkPreviewTitle!)
let attachment = SSKProtoAttachmentPointer.builder(id: linkPreview.serverID)
let attachment = SNProtoAttachmentPointer.builder(id: linkPreview.serverID)
attachment.setContentType(linkPreview.contentType)
attachment.setSize(UInt32(linkPreview.size))
attachment.setFileName(linkPreview.fileName)
@ -109,7 +109,7 @@ public final class PublicChatPoller : NSObject {
signalLinkPreview.setImage(try! attachment.build())
dataMessage.setPreview([ try! signalLinkPreview.build() ])
}
let profile = SSKProtoDataMessageLokiProfile.builder()
let profile = SNProtoDataMessageLokiProfile.builder()
profile.setDisplayName(message.displayName)
if let profilePicture = message.profilePicture {
profile.setProfilePicture(profilePicture.url)
@ -119,31 +119,31 @@ public final class PublicChatPoller : NSObject {
dataMessage.setTimestamp(message.timestamp)
dataMessage.setGroup(try! groupContext.build())
if let quote = message.quote {
let signalQuote = SSKProtoDataMessageQuote.builder(id: quote.quotedMessageTimestamp, author: quote.quoteePublicKey)
let signalQuote = SNProtoDataMessageQuote.builder(id: quote.quotedMessageTimestamp, author: quote.quoteePublicKey)
signalQuote.setText(quote.quotedMessageBody)
dataMessage.setQuote(try! signalQuote.build())
}
let body = (message.body == message.timestamp.description) ? "" : message.body // Workaround for the fact that the back-end doesn't accept messages without a body
dataMessage.setBody(body)
if let messageServerID = message.serverID {
let publicChatInfo = SSKProtoPublicChatInfo.builder()
let publicChatInfo = SNProtoPublicChatInfo.builder()
publicChatInfo.setServerID(messageServerID)
dataMessage.setPublicChatInfo(try! publicChatInfo.build())
}
let content = SSKProtoContent.builder()
let content = SNProtoContent.builder()
if !wasSentByCurrentUser {
content.setDataMessage(try! dataMessage.build())
} else {
let syncMessageSentBuilder = SSKProtoSyncMessageSent.builder()
let syncMessageSentBuilder = SNProtoSyncMessageSent.builder()
syncMessageSentBuilder.setMessage(try! dataMessage.build())
syncMessageSentBuilder.setDestination(userPublicKey)
syncMessageSentBuilder.setTimestamp(message.timestamp)
let syncMessageSent = try! syncMessageSentBuilder.build()
let syncMessageBuilder = SSKProtoSyncMessage.builder()
let syncMessageBuilder = SNProtoSyncMessage.builder()
syncMessageBuilder.setSent(syncMessageSent)
content.setSyncMessage(try! syncMessageBuilder.build())
}
let envelope = SSKProtoEnvelope.builder(type: .ciphertext, timestamp: message.timestamp)
let envelope = SNProtoEnvelope.builder(type: .ciphertext, timestamp: message.timestamp)
envelope.setSource(senderPublicKey)
envelope.setSourceDevice(1)
envelope.setContent(try! content.build().serializedData())

Some files were not shown because too many files have changed in this diff Show More