diff --git a/Session/Components/ConversationCell.swift b/Session/Components/ConversationCell.swift index c86a5d098..e4230a88d 100644 --- a/Session/Components/ConversationCell.swift +++ b/Session/Components/ConversationCell.swift @@ -166,7 +166,7 @@ final class ConversationCell : UITableViewCell { let image: UIImage let status = MessageRecipientStatusUtils.recipientStatus(outgoingMessage: lastMessage) switch status { - case .calculatingPoW, .uploading, .sending: image = #imageLiteral(resourceName: "CircleDotDotDot").asTintedImage(color: Colors.text)! + case .uploading, .sending: image = #imageLiteral(resourceName: "CircleDotDotDot").asTintedImage(color: Colors.text)! case .sent, .skipped, .delivered: image = #imageLiteral(resourceName: "CircleCheck").asTintedImage(color: Colors.text)! case .read: statusIndicatorView.backgroundColor = isLightMode ? .black : .white diff --git a/Session/Components/MentionCandidateSelectionView.swift b/Session/Components/MentionCandidateSelectionView.swift index a2eef63e9..f62d50d8b 100644 --- a/Session/Components/MentionCandidateSelectionView.swift +++ b/Session/Components/MentionCandidateSelectionView.swift @@ -1,6 +1,4 @@ -// MARK: - User Selection View - @objc(LKMentionCandidateSelectionView) final class MentionCandidateSelectionView : UIView, UITableViewDataSource, UITableViewDelegate { @objc var mentionCandidates: [Mention] = [] { didSet { tableView.reloadData() } } @@ -173,7 +171,8 @@ private extension MentionCandidateSelectionView { } } -// MARK: Delegate +// MARK: - Delegate + @objc(LKMentionCandidateSelectionViewDelegate) protocol MentionCandidateSelectionViewDelegate { diff --git a/Session/MessageHandler.swift b/Session/MessageReceiverDelegate.swift similarity index 100% rename from Session/MessageHandler.swift rename to Session/MessageReceiverDelegate.swift diff --git a/Session/Signal/AddToGroupViewController.h b/Session/Signal/AddToGroupViewController.h deleted file mode 100644 index dae373b41..000000000 --- a/Session/Signal/AddToGroupViewController.h +++ /dev/null @@ -1,27 +0,0 @@ -// -// Copyright (c) 2018 Open Whisper Systems. All rights reserved. -// - -#import "SelectRecipientViewController.h" - -NS_ASSUME_NONNULL_BEGIN - -@protocol AddToGroupViewControllerDelegate - -- (void)recipientIdWasAdded:(NSString *)recipientId; - -- (BOOL)isRecipientGroupMember:(NSString *)recipientId; - -@end - -#pragma mark - - -@interface AddToGroupViewController : SelectRecipientViewController - -@property (nonatomic, weak) id addToGroupDelegate; - -@property (nonatomic) BOOL hideContacts; - -@end - -NS_ASSUME_NONNULL_END diff --git a/Session/Signal/AddToGroupViewController.m b/Session/Signal/AddToGroupViewController.m deleted file mode 100644 index c021ce8c3..000000000 --- a/Session/Signal/AddToGroupViewController.m +++ /dev/null @@ -1,138 +0,0 @@ -// -// Copyright (c) 2018 Open Whisper Systems. All rights reserved. -// - -#import "AddToGroupViewController.h" -#import "BlockListUIUtils.h" - -#import "Session-Swift.h" - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface AddToGroupViewController () - -@end - -#pragma mark - - -@implementation AddToGroupViewController - -- (void)loadView -{ - self.delegate = self; - - [super loadView]; - - self.title = NSLocalizedString(@"ADD_GROUP_MEMBER_VIEW_TITLE", @"Title for the 'add group member' view."); -} - -- (NSString *)phoneNumberSectionTitle -{ - return NSLocalizedString(@"ADD_GROUP_MEMBER_VIEW_PHONE_NUMBER_TITLE", - @"Title for the 'add by phone number' section of the 'add group member' view."); -} - -- (NSString *)phoneNumberButtonText -{ - return NSLocalizedString(@"ADD_GROUP_MEMBER_VIEW_BUTTON", - @"A label for the 'add by phone number' button in the 'add group member' view"); -} - -- (NSString *)contactsSectionTitle -{ - return NSLocalizedString( - @"ADD_GROUP_MEMBER_VIEW_CONTACT_TITLE", @"Title for the 'add contact' section of the 'add group member' view."); -} - -- (void)phoneNumberWasSelected:(NSString *)phoneNumber -{ - OWSAssertDebug(phoneNumber.length > 0); - - __weak AddToGroupViewController *weakSelf = self; - - if ([SSKEnvironment.shared.blockingManager isRecipientIdBlocked:phoneNumber]) { - [BlockListUIUtils showUnblockPhoneNumberActionSheet:phoneNumber - fromViewController:self - blockingManager:SSKEnvironment.shared.blockingManager - completionBlock:^(BOOL isBlocked) { - if (!isBlocked) { - [weakSelf addToGroup:phoneNumber]; - } - }]; - return; - } - - [self addToGroup:phoneNumber]; -} - -- (BOOL)canSignalAccountBeSelected:(SignalAccount *)signalAccount -{ - OWSAssertDebug(signalAccount); - - return ![self.addToGroupDelegate isRecipientGroupMember:signalAccount.recipientId]; -} - -- (void)signalAccountWasSelected:(SignalAccount *)signalAccount -{ - OWSAssertDebug(signalAccount); - - __weak AddToGroupViewController *weakSelf = self; - if ([self.addToGroupDelegate isRecipientGroupMember:signalAccount.recipientId]) { - OWSFailDebug(@"Cannot add user to group member if already a member."); - return; - } - - if ([SSKEnvironment.shared.blockingManager isRecipientIdBlocked:signalAccount.recipientId]) { - [BlockListUIUtils showUnblockSignalAccountActionSheet:signalAccount - fromViewController:self - blockingManager:SSKEnvironment.shared.blockingManager - completionBlock:^(BOOL isBlocked) { - if (!isBlocked) { - [weakSelf addToGroup:signalAccount.recipientId]; - } - }]; - return; - } - - [self addToGroup:signalAccount.recipientId]; -} - -- (void)addToGroup:(NSString *)recipientId -{ - OWSAssertDebug(recipientId.length > 0); - - [self.addToGroupDelegate recipientIdWasAdded:recipientId]; - [self.navigationController popViewControllerAnimated:YES]; -} - -- (BOOL)shouldHideLocalNumber -{ - return YES; -} - -- (BOOL)shouldHideContacts -{ - return self.hideContacts; -} - -- (BOOL)shouldValidatePhoneNumbers -{ - return YES; -} - -- (nullable NSString *)accessoryMessageForSignalAccount:(SignalAccount *)signalAccount -{ - OWSAssertDebug(signalAccount); - - if ([self.addToGroupDelegate isRecipientGroupMember:signalAccount.recipientId]) { - return NSLocalizedString(@"NEW_GROUP_MEMBER_LABEL", @"An indicator that a user is a member of the new group."); - } - - return nil; -} - -@end - -NS_ASSUME_NONNULL_END diff --git a/Session/Signal/AppEnvironment.swift b/Session/Signal/AppEnvironment.swift index 2df0f0dc8..cfacd98f3 100644 --- a/Session/Signal/AppEnvironment.swift +++ b/Session/Signal/AppEnvironment.swift @@ -86,10 +86,7 @@ import SignalUtilitiesKit @objc public func setup() { -// callService.createCallUIAdapter() - // Hang certain singletons on SSKEnvironment too. SSKEnvironment.shared.notificationsManager = notificationPresenter -// SSKEnvironment.shared.callMessageHandler = callMessageHandler } } diff --git a/Session/Signal/AvatarViewHelper.m b/Session/Signal/AvatarViewHelper.m index b5d4b7972..bf4664007 100644 --- a/Session/Signal/AvatarViewHelper.m +++ b/Session/Signal/AvatarViewHelper.m @@ -36,14 +36,6 @@ NS_ASSUME_NONNULL_BEGIN preferredStyle:UIAlertControllerStyleActionSheet]; [actionSheet addAction:[OWSAlerts cancelAction]]; -// UIAlertAction *takePictureAction = [UIAlertAction -// actionWithTitle:NSLocalizedString(@"MEDIA_FROM_CAMERA_BUTTON", @"media picker option to take photo or video") -// style:UIAlertActionStyleDefault -// handler:^(UIAlertAction *_Nonnull action) { -// [self takePicture]; -// }]; -// [actionSheet addAction:takePictureAction]; - UIAlertAction *choosePictureAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"MEDIA_FROM_LIBRARY_BUTTON", @"media picker option to choose from library") style:UIAlertActionStyleDefault diff --git a/Session/Signal/CallVideoHintView.swift b/Session/Signal/CallVideoHintView.swift deleted file mode 100644 index ba49030d0..000000000 --- a/Session/Signal/CallVideoHintView.swift +++ /dev/null @@ -1,83 +0,0 @@ -// -// Copyright (c) 2019 Open Whisper Systems. All rights reserved. -// - -import Foundation - -protocol CallVideoHintViewDelegate: AnyObject { - func didTapCallVideoHintView(_ videoHintView: CallVideoHintView) -} - -class CallVideoHintView: UIView { - let label = UILabel() - var tapGesture: UITapGestureRecognizer! - weak var delegate: CallVideoHintViewDelegate? - - let kTailHMargin: CGFloat = 12 - let kTailWidth: CGFloat = 16 - let kTailHeight: CGFloat = 8 - - init() { - super.init(frame: .zero) - - tapGesture = UITapGestureRecognizer(target: self, action: #selector(didTap(tapGesture:))) - addGestureRecognizer(tapGesture) - - let layerView = OWSLayerView(frame: .zero) { _ in } - let shapeLayer = CAShapeLayer() - shapeLayer.fillColor = UIColor.ows_signalBlue.cgColor - layerView.layer.addSublayer(shapeLayer) - addSubview(layerView) - layerView.autoPinEdgesToSuperviewEdges() - - let container = UIView() - addSubview(container) - container.autoSetDimension(.width, toSize: ScaleFromIPhone5(250), relation: .lessThanOrEqual) - container.layoutMargins = UIEdgeInsets(top: 7, leading: 12, bottom: 7, trailing: 12) - container.autoPinEdgesToSuperviewEdges(with: UIEdgeInsets(top: 0, leading: 0, bottom: kTailHeight, trailing: 0)) - - container.addSubview(label) - label.autoPinEdgesToSuperviewMargins() - label.setCompressionResistanceHigh() - label.setContentHuggingHigh() - label.font = UIFont.ows_dynamicTypeBody - label.textColor = .ows_white - label.numberOfLines = 0 - label.text = NSLocalizedString("CALL_VIEW_ENABLE_VIDEO_HINT", comment: "tooltip label when remote party has enabled their video") - - layerView.layoutCallback = { view in - let bezierPath = UIBezierPath() - - // Bubble - let bubbleBounds = container.bounds - bezierPath.append(UIBezierPath(roundedRect: bubbleBounds, cornerRadius: 8)) - - // Tail - var tailBottom = CGPoint(x: self.kTailHMargin + self.kTailWidth * 0.5, y: view.height()) - var tailLeft = CGPoint(x: self.kTailHMargin, y: view.height() - self.kTailHeight) - var tailRight = CGPoint(x: self.kTailHMargin + self.kTailWidth, y: view.height() - self.kTailHeight) - if (!CurrentAppContext().isRTL) { - tailBottom.x = view.width() - tailBottom.x - tailLeft.x = view.width() - tailLeft.x - tailRight.x = view.width() - tailRight.x - } - bezierPath.move(to: tailBottom) - bezierPath.addLine(to: tailLeft) - bezierPath.addLine(to: tailRight) - bezierPath.addLine(to: tailBottom) - shapeLayer.path = bezierPath.cgPath - shapeLayer.frame = view.bounds - } - } - - required init?(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - // MARK: - - - @objc - func didTap(tapGesture: UITapGestureRecognizer) { - self.delegate?.didTapCallVideoHintView(self) - } -} diff --git a/Session/Signal/CallViewController.swift b/Session/Signal/CallViewController.swift deleted file mode 100644 index 02e27363d..000000000 --- a/Session/Signal/CallViewController.swift +++ /dev/null @@ -1,1227 +0,0 @@ -//// -//// Copyright (c) 2019 Open Whisper Systems. All rights reserved. -//// -// -//import Foundation -//import WebRTC -//import PromiseKit -//import SignalUtilitiesKit -//import SignalUtilitiesKit -// -//// TODO: Add category so that button handlers can be defined where button is created. -//// TODO: Ensure buttons enabled & disabled as necessary. -//class CallViewController: OWSViewController, CallObserver, CallServiceObserver, CallAudioServiceDelegate { -// -// // Dependencies -// -// var callUIAdapter: CallUIAdapter { -// return AppEnvironment.shared.callService.callUIAdapter -// } -// -// var proximityMonitoringManager: OWSProximityMonitoringManager { -// return Environment.shared.proximityMonitoringManager -// } -// -// // Feature Flag -// @objc public static let kShowCallViewOnSeparateWindow = true -// -// let contactsManager: OWSContactsManager -// -// // MARK: - Properties -// -// let thread: TSContactThread -// let call: SignalCall -// var hasDismissed = false -// -// // MARK: - Views -// -// var hasConstraints = false -// var blurView: UIVisualEffectView! -// var dateFormatter: DateFormatter? -// -// // MARK: - Contact Views -// -// var contactNameLabel: MarqueeLabel! -// var contactAvatarView: AvatarImageView! -// var contactAvatarContainerView: UIView! -// var callStatusLabel: UILabel! -// var callDurationTimer: Timer? -// var leaveCallViewButton: UIButton! -// -// // MARK: - Ongoing Call Controls -// -// var ongoingCallControls: UIStackView! -// -// var ongoingAudioCallControls: UIStackView! -// var ongoingVideoCallControls: UIStackView! -// -// var hangUpButton: UIButton! -// var audioSourceButton: UIButton! -// var audioModeMuteButton: UIButton! -// var audioModeVideoButton: UIButton! -// var videoModeMuteButton: UIButton! -// var videoModeVideoButton: UIButton! -// var videoModeFlipCameraButton: UIButton! -// -// // MARK: - Incoming Call Controls -// -// var incomingCallControls: UIStackView! -// -// var acceptIncomingButton: UIButton! -// var declineIncomingButton: UIButton! -// -// // MARK: - Video Views -// -// var remoteVideoView: RemoteVideoView! -// var localVideoView: RTCCameraPreviewView! -// var hasShownLocalVideo = false -// weak var localCaptureSession: AVCaptureSession? -// weak var remoteVideoTrack: RTCVideoTrack? -// -// override public var canBecomeFirstResponder: Bool { -// return true -// } -// -// var shouldRemoteVideoControlsBeHidden = false { -// didSet { -// updateCallUI(callState: call.state) -// } -// } -// -// // MARK: - Settings Nag Views -// -// var isShowingSettingsNag = false { -// didSet { -// if oldValue != isShowingSettingsNag { -// updateCallUI(callState: call.state) -// } -// } -// } -// var settingsNagView: UIView! -// var settingsNagDescriptionLabel: UILabel! -// -// // MARK: - Audio Source -// -// var hasAlternateAudioSources: Bool { -// Logger.info("available audio sources: \(allAudioSources)") -// // internal mic and speakerphone will be the first two, any more than one indicates e.g. an attached bluetooth device. -// -// // TODO is this sufficient? Are their devices w/ bluetooth but no external speaker? e.g. ipod? -// return allAudioSources.count > 2 -// } -// -// var allAudioSources: Set = Set() -// -// var appropriateAudioSources: Set { -// if call.hasLocalVideo { -// let appropriateForVideo = allAudioSources.filter { audioSource in -// if audioSource.isBuiltInSpeaker { -// return true -// } else { -// guard let portDescription = audioSource.portDescription else { -// owsFailDebug("Only built in speaker should be lacking a port description.") -// return false -// } -// -// // Don't use receiver when video is enabled. Only bluetooth or speaker -// return portDescription.portType != AVAudioSession.Port.builtInMic -// } -// } -// return Set(appropriateForVideo) -// } else { -// return allAudioSources -// } -// } -// -// // MARK: - Initializers -// -// @available(*, unavailable, message: "use init(call:) constructor instead.") -// required init?(coder aDecoder: NSCoder) { -// notImplemented() -// } -// -// required init(call: SignalCall) { -// contactsManager = Environment.shared.contactsManager -// self.call = call -// self.thread = TSContactThread.getOrCreateThread(contactId: call.remotePhoneNumber) -// super.init(nibName: nil, bundle: nil) -// -// allAudioSources = Set(callUIAdapter.audioService.availableInputs) -// -// self.shouldUseTheme = false -// } -// -// deinit { -// Logger.info("") -// NotificationCenter.default.removeObserver(self) -// self.proximityMonitoringManager.remove(lifetime: self) -// } -// -// @objc func didBecomeActive() { -// if (self.isViewLoaded) { -// shouldRemoteVideoControlsBeHidden = false -// } -// } -// -// // MARK: - View Lifecycle -// -// override func viewDidDisappear(_ animated: Bool) { -// super.viewDidDisappear(animated) -// -// callDurationTimer?.invalidate() -// callDurationTimer = nil -// } -// -// override func viewWillAppear(_ animated: Bool) { -// super.viewWillAppear(animated) -// -// ensureProximityMonitoring() -// -// updateCallUI(callState: call.state) -// -// self.becomeFirstResponder() -// } -// -// override func viewDidAppear(_ animated: Bool) { -// super.viewDidAppear(animated) -// -// self.becomeFirstResponder() -// } -// -// override func loadView() { -// self.view = UIView() -// self.view.backgroundColor = UIColor.black -// self.view.layoutMargins = UIEdgeInsets(top: 16, left: 20, bottom: 16, right: 20) -// -// createViews() -// createViewConstraints() -// } -// -// override func viewDidLoad() { -// super.viewDidLoad() -// -// contactNameLabel.text = contactsManager.stringForConversationTitle(withPhoneIdentifier: thread.contactIdentifier()) -// updateAvatarImage() -// NotificationCenter.default.addObserver(forName: .OWSContactsManagerSignalAccountsDidChange, object: nil, queue: nil) { [weak self] _ in -// guard let strongSelf = self else { return } -// Logger.info("updating avatar image") -// strongSelf.updateAvatarImage() -// } -// -// // Subscribe for future call updates -// call.addObserverAndSyncState(observer: self) -// -// AppEnvironment.shared.callService.addObserverAndSyncState(observer: self) -// -// assert(callUIAdapter.audioService.delegate == nil) -// callUIAdapter.audioService.delegate = self -// -// NotificationCenter.default.addObserver(self, -// selector: #selector(didBecomeActive), -// name: NSNotification.Name.OWSApplicationDidBecomeActive, -// object: nil) -// } -// -// override var supportedInterfaceOrientations: UIInterfaceOrientationMask { -// return .portrait -// } -// -// override var preferredStatusBarStyle: UIStatusBarStyle { -// return .lightContent -// } -// -// // MARK: - Create Views -// -// func createViews() { -// self.view.isUserInteractionEnabled = true -// self.view.addGestureRecognizer(UITapGestureRecognizer(target: self, -// action: #selector(didTouchRootView))) -// -// videoHintView.delegate = self -// -// // Dark blurred background. -// let blurEffect = UIBlurEffect(style: .dark) -// blurView = UIVisualEffectView(effect: blurEffect) -// blurView.isUserInteractionEnabled = false -// self.view.addSubview(blurView) -// -// // Create the video views first, as they are under the other views. -// createVideoViews() -// createContactViews() -// createOngoingCallControls() -// createIncomingCallControls() -// createSettingsNagViews() -// } -// -// @objc func didTouchRootView(sender: UIGestureRecognizer) { -// if !remoteVideoView.isHidden { -// shouldRemoteVideoControlsBeHidden = !shouldRemoteVideoControlsBeHidden -// } -// } -// -// func createVideoViews() { -// remoteVideoView = RemoteVideoView() -// remoteVideoView.isUserInteractionEnabled = false -// localVideoView = RTCCameraPreviewView() -// -// remoteVideoView.isHidden = true -// localVideoView.isHidden = true -// self.view.addSubview(remoteVideoView) -// self.view.addSubview(localVideoView) -// } -// -// func createContactViews() { -// -// leaveCallViewButton = UIButton() -// let backButtonImage = CurrentAppContext().isRTL ? #imageLiteral(resourceName: "NavBarBackRTL") : #imageLiteral(resourceName: "NavBarBack") -// leaveCallViewButton.setImage(backButtonImage, for: .normal) -// leaveCallViewButton.autoSetDimensions(to: CGSize(width: 40, height: 40)) -// leaveCallViewButton.addTarget(self, action: #selector(didTapLeaveCall(sender:)), for: .touchUpInside) -// self.view.addSubview(leaveCallViewButton) -// -// contactNameLabel = MarqueeLabel() -// -// // marquee config -// contactNameLabel.type = .continuous -// // This feels pretty slow when you're initially waiting for it, but when you're overlaying video calls, anything faster is distracting. -// contactNameLabel.speed = .duration(30.0) -// contactNameLabel.animationCurve = .linear -// contactNameLabel.fadeLength = 10.0 -// contactNameLabel.animationDelay = 5 -// // Add trailing space after the name scrolls before it wraps around and scrolls back in. -// contactNameLabel.trailingBuffer = ScaleFromIPhone5(80.0) -// -// // label config -// contactNameLabel.font = UIFont.ows_dynamicTypeTitle1 -// contactNameLabel.textAlignment = .center -// contactNameLabel.textColor = UIColor.white -// contactNameLabel.layer.shadowOffset = CGSize.zero -// contactNameLabel.layer.shadowOpacity = 0.35 -// contactNameLabel.layer.shadowRadius = 4 -// -// self.view.addSubview(contactNameLabel) -// -// callStatusLabel = UILabel() -// callStatusLabel.font = UIFont.ows_dynamicTypeBody -// callStatusLabel.textAlignment = .center -// callStatusLabel.textColor = UIColor.white -// callStatusLabel.layer.shadowOffset = CGSize.zero -// callStatusLabel.layer.shadowOpacity = 0.35 -// callStatusLabel.layer.shadowRadius = 4 -// -// self.view.addSubview(callStatusLabel) -// -// contactAvatarContainerView = UIView.container() -// self.view.addSubview(contactAvatarContainerView) -// contactAvatarView = AvatarImageView() -// contactAvatarContainerView.addSubview(contactAvatarView) -// } -// -// func createSettingsNagViews() { -// settingsNagView = UIView() -// settingsNagView.isHidden = true -// self.view.addSubview(settingsNagView) -// -// let viewStack = UIView() -// settingsNagView.addSubview(viewStack) -// viewStack.autoPinWidthToSuperview() -// viewStack.autoVCenterInSuperview() -// -// settingsNagDescriptionLabel = UILabel() -// settingsNagDescriptionLabel.text = NSLocalizedString("CALL_VIEW_SETTINGS_NAG_DESCRIPTION_ALL", -// comment: "Reminder to the user of the benefits of enabling CallKit and disabling CallKit privacy.") -// settingsNagDescriptionLabel.font = UIFont.ows_regularFont(withSize: ScaleFromIPhone5To7Plus(16, 18)) -// settingsNagDescriptionLabel.textColor = UIColor.white -// settingsNagDescriptionLabel.numberOfLines = 0 -// settingsNagDescriptionLabel.lineBreakMode = .byWordWrapping -// viewStack.addSubview(settingsNagDescriptionLabel) -// settingsNagDescriptionLabel.autoPinWidthToSuperview() -// settingsNagDescriptionLabel.autoPinEdge(toSuperviewEdge: .top) -// -// let buttonHeight = ScaleFromIPhone5To7Plus(35, 45) -// let descriptionVSpacingHeight = ScaleFromIPhone5To7Plus(30, 60) -// -// let callSettingsButton = OWSFlatButton.button(title: NSLocalizedString("CALL_VIEW_SETTINGS_NAG_SHOW_CALL_SETTINGS", -// comment: "Label for button that shows the privacy settings."), -// font: OWSFlatButton.fontForHeight(buttonHeight), -// titleColor: UIColor.white, -// backgroundColor: UIColor.ows_signalBrandBlue, -// target: self, -// selector: #selector(didPressShowCallSettings)) -// viewStack.addSubview(callSettingsButton) -// callSettingsButton.autoSetDimension(.height, toSize: buttonHeight) -// callSettingsButton.autoPinWidthToSuperview() -// callSettingsButton.autoPinEdge(.top, to: .bottom, of: settingsNagDescriptionLabel, withOffset: descriptionVSpacingHeight) -// -// let notNowButton = OWSFlatButton.button(title: NSLocalizedString("CALL_VIEW_SETTINGS_NAG_NOT_NOW_BUTTON", -// comment: "Label for button that dismiss the call view's settings nag."), -// font: OWSFlatButton.fontForHeight(buttonHeight), -// titleColor: UIColor.white, -// backgroundColor: UIColor.ows_signalBrandBlue, -// target: self, -// selector: #selector(didPressDismissNag)) -// viewStack.addSubview(notNowButton) -// notNowButton.autoSetDimension(.height, toSize: buttonHeight) -// notNowButton.autoPinWidthToSuperview() -// notNowButton.autoPinEdge(toSuperviewEdge: .bottom) -// notNowButton.autoPinEdge(.top, to: .bottom, of: callSettingsButton, withOffset: 12) -// } -// -// func buttonSize() -> CGFloat { -// return ScaleFromIPhone5To7Plus(84, 108) -// } -// -// func buttonInset() -> CGFloat { -// return ScaleFromIPhone5To7Plus(7, 9) -// } -// -// func createOngoingCallControls() { -// -// audioSourceButton = createButton(image: #imageLiteral(resourceName: "audio-call-speaker-inactive"), -// action: #selector(didPressAudioSource)) -// audioSourceButton.accessibilityLabel = NSLocalizedString("CALL_VIEW_AUDIO_SOURCE_LABEL", -// comment: "Accessibility label for selection the audio source") -// -// hangUpButton = createButton(image: #imageLiteral(resourceName: "hangup-active-wide"), -// action: #selector(didPressHangup)) -// hangUpButton.accessibilityLabel = NSLocalizedString("CALL_VIEW_HANGUP_LABEL", -// comment: "Accessibility label for hang up call") -// -// audioModeMuteButton = createButton(image: #imageLiteral(resourceName: "audio-call-mute-inactive"), -// action: #selector(didPressMute)) -// audioModeMuteButton.setImage(#imageLiteral(resourceName: "audio-call-mute-active"), for: .selected) -// -// audioModeMuteButton.accessibilityLabel = NSLocalizedString("CALL_VIEW_MUTE_LABEL", -// comment: "Accessibility label for muting the microphone") -// -// audioModeVideoButton = createButton(image: #imageLiteral(resourceName: "audio-call-video-inactive"), -// action: #selector(didPressVideo)) -// audioModeVideoButton.setImage(#imageLiteral(resourceName: "audio-call-video-active"), for: .selected) -// audioModeVideoButton.accessibilityLabel = NSLocalizedString("CALL_VIEW_SWITCH_TO_VIDEO_LABEL", comment: "Accessibility label to switch to video call") -// -// videoModeMuteButton = createButton(image: #imageLiteral(resourceName: "video-mute-unselected"), -// action: #selector(didPressMute)) -// videoModeMuteButton.setImage(#imageLiteral(resourceName: "video-mute-selected"), for: .selected) -// videoModeMuteButton.accessibilityLabel = NSLocalizedString("CALL_VIEW_MUTE_LABEL", comment: "Accessibility label for muting the microphone") -// videoModeMuteButton.alpha = 0.9 -// -// videoModeFlipCameraButton = createButton(image: #imageLiteral(resourceName: "video-switch-camera-unselected"), -// action: #selector(didPressFlipCamera)) -// -// videoModeFlipCameraButton.accessibilityLabel = NSLocalizedString("CALL_VIEW_SWITCH_CAMERA_DIRECTION", comment: "Accessibility label to toggle front- vs. rear-facing camera") -// videoModeFlipCameraButton.alpha = 0.9 -// -// videoModeVideoButton = createButton(image: #imageLiteral(resourceName: "video-video-unselected"), -// action: #selector(didPressVideo)) -// videoModeVideoButton.setImage(#imageLiteral(resourceName: "video-video-selected"), for: .selected) -// videoModeVideoButton.accessibilityLabel = NSLocalizedString("CALL_VIEW_SWITCH_TO_AUDIO_LABEL", comment: "Accessibility label to switch to audio only") -// videoModeVideoButton.alpha = 0.9 -// -// ongoingCallControls = UIStackView(arrangedSubviews: [hangUpButton]) -// ongoingCallControls.axis = .vertical -// ongoingCallControls.alignment = .center -// view.addSubview(ongoingCallControls) -// -// ongoingAudioCallControls = UIStackView(arrangedSubviews: [audioModeMuteButton, audioSourceButton, audioModeVideoButton]) -// ongoingAudioCallControls.distribution = .equalSpacing -// ongoingAudioCallControls.axis = .horizontal -// -// ongoingVideoCallControls = UIStackView(arrangedSubviews: [videoModeMuteButton, videoModeFlipCameraButton, videoModeVideoButton]) -// ongoingAudioCallControls.distribution = .equalSpacing -// ongoingVideoCallControls.axis = .horizontal -// } -// -// func presentAudioSourcePicker() { -// AssertIsOnMainThread() -// -// let actionSheetController = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet) -// -// let dismissAction = UIAlertAction(title: CommonStrings.dismissButton, style: .cancel, handler: nil) -// actionSheetController.addAction(dismissAction) -// -// let currentAudioSource = callUIAdapter.audioService.currentAudioSource(call: self.call) -// for audioSource in self.appropriateAudioSources { -// let routeAudioAction = UIAlertAction(title: audioSource.localizedName, style: .default) { _ in -// self.callUIAdapter.setAudioSource(call: self.call, audioSource: audioSource) -// } -// -// // HACK: private API to create checkmark for active audio source. -// routeAudioAction.setValue(currentAudioSource == audioSource, forKey: "checked") -// -// // TODO: pick some icons. Leaving out for MVP -// // HACK: private API to add image to actionsheet -// // routeAudioAction.setValue(audioSource.image, forKey: "image") -// -// actionSheetController.addAction(routeAudioAction) -// } -// -// // Note: It's critical that we present from this view and -// // not the "frontmost view controller" since this view may -// // reside on a separate window. -// presentAlert(actionSheetController) -// } -// -// func updateAvatarImage() { -// contactAvatarView.image = OWSAvatarBuilder.buildImage(thread: thread, diameter: 400) -// } -// -// func createIncomingCallControls() { -// -// acceptIncomingButton = createButton(image: #imageLiteral(resourceName: "call-active-wide"), -// action: #selector(didPressAnswerCall)) -// acceptIncomingButton.accessibilityLabel = NSLocalizedString("CALL_VIEW_ACCEPT_INCOMING_CALL_LABEL", -// comment: "Accessibility label for accepting incoming calls") -// declineIncomingButton = createButton(image: #imageLiteral(resourceName: "hangup-active-wide"), -// action: #selector(didPressDeclineCall)) -// declineIncomingButton.accessibilityLabel = NSLocalizedString("CALL_VIEW_DECLINE_INCOMING_CALL_LABEL", -// comment: "Accessibility label for declining incoming calls") -// -// incomingCallControls = UIStackView(arrangedSubviews: [acceptIncomingButton, declineIncomingButton]) -// incomingCallControls.axis = .horizontal -// incomingCallControls.alignment = .center -// incomingCallControls.distribution = .equalSpacing -// -// view.addSubview(incomingCallControls) -// } -// -// func createButton(image: UIImage, action: Selector) -> UIButton { -// let button = UIButton() -// button.setImage(image, for: .normal) -// button.imageEdgeInsets = UIEdgeInsets(top: buttonInset(), -// left: buttonInset(), -// bottom: buttonInset(), -// right: buttonInset()) -// button.addTarget(self, action: action, for: .touchUpInside) -// button.autoSetDimension(.width, toSize: buttonSize()) -// button.autoSetDimension(.height, toSize: buttonSize()) -// return button -// } -// -// // MARK: - Layout -// -// var localVideoViewTopConstraintDefault: NSLayoutConstraint! -// var localVideoViewTopConstraintHidden: NSLayoutConstraint! -// -// func createViewConstraints() { -// -// let contactVSpacing = CGFloat(3) -// let settingsNagHMargin = CGFloat(30) -// let ongoingBottomMargin = ScaleFromIPhone5To7Plus(23, 41) -// let incomingHMargin = ScaleFromIPhone5To7Plus(30, 56) -// let incomingBottomMargin = CGFloat(41) -// let settingsNagBottomMargin = CGFloat(41) -// let avatarTopSpacing = ScaleFromIPhone5To7Plus(25, 50) -// // The buttons have built-in 10% margins, so to appear centered -// // the avatar's bottom spacing should be a bit less. -// let avatarBottomSpacing = ScaleFromIPhone5To7Plus(18, 41) -// // Layout of the local video view is a bit unusual because -// // although the view is square, it will be used -// let videoPreviewHMargin = CGFloat(0) -// -// // Dark blurred background. -// blurView.autoPinEdgesToSuperviewEdges() -// -// leaveCallViewButton.autoPinEdge(toSuperviewEdge: .leading) -// -// if #available(iOS 11, *) { -// leaveCallViewButton.autoPinEdge(toSuperviewMargin: .top) -// contactNameLabel.autoPinEdge(toSuperviewMargin: .top) -// } else { -// leaveCallViewButton.autoPinEdge(.top, to: .top, of: view) -// contactNameLabel.autoPinEdge(.top, to: .top, of: view) -// } -// -// contactNameLabel.autoPinEdge(.leading, to: .trailing, of: leaveCallViewButton, withOffset: 8, relation: .greaterThanOrEqual) -// contactNameLabel.autoHCenterInSuperview() -// contactNameLabel.setContentHuggingVerticalHigh() -// contactNameLabel.setCompressionResistanceHigh() -// -// callStatusLabel.autoPinEdge(.top, to: .bottom, of: contactNameLabel, withOffset: contactVSpacing) -// callStatusLabel.autoHCenterInSuperview() -// callStatusLabel.setContentHuggingVerticalHigh() -// callStatusLabel.setCompressionResistanceHigh() -// -// localVideoView.autoPinTrailingToSuperviewMargin(withInset: videoPreviewHMargin) -// -// self.localVideoViewTopConstraintDefault = localVideoView.autoPinEdge(.top, to: .bottom, of: callStatusLabel, withOffset: 4) -// self.localVideoViewTopConstraintHidden = localVideoView.autoPinEdge(toSuperviewMargin: .top) -// let localVideoSize = ScaleFromIPhone5To7Plus(80, 100) -// localVideoView.autoSetDimension(.width, toSize: localVideoSize) -// localVideoView.autoSetDimension(.height, toSize: localVideoSize) -// -// remoteVideoView.autoPinEdgesToSuperviewEdges() -// -// contactAvatarContainerView.autoPinEdge(.top, to: .bottom, of: callStatusLabel, withOffset: +avatarTopSpacing) -// contactAvatarContainerView.autoPinEdge(.bottom, to: .top, of: ongoingCallControls, withOffset: -avatarBottomSpacing) -// contactAvatarContainerView.autoPinWidthToSuperview(withMargin: avatarTopSpacing) -// -// contactAvatarView.autoCenterInSuperview() -// -// // Ensure ContacAvatarView gets as close as possible to it's superview edges while maintaining -// // aspect ratio. -// contactAvatarView.autoPinToSquareAspectRatio() -// contactAvatarView.autoPinEdge(toSuperviewEdge: .top, withInset: 0, relation: .greaterThanOrEqual) -// contactAvatarView.autoPinEdge(toSuperviewEdge: .right, withInset: 0, relation: .greaterThanOrEqual) -// contactAvatarView.autoPinEdge(toSuperviewEdge: .bottom, withInset: 0, relation: .greaterThanOrEqual) -// contactAvatarView.autoPinEdge(toSuperviewEdge: .left, withInset: 0, relation: .greaterThanOrEqual) -// NSLayoutConstraint.autoSetPriority(UILayoutPriority.defaultLow) { -// contactAvatarView.autoPinEdgesToSuperviewMargins() -// } -// -// // Ongoing call controls -// ongoingCallControls.autoPinEdge(toSuperviewEdge: .bottom, withInset: ongoingBottomMargin) -// ongoingCallControls.autoPinLeadingToSuperviewMargin() -// ongoingCallControls.autoPinTrailingToSuperviewMargin() -// ongoingCallControls.setContentHuggingVerticalHigh() -// -// // Incoming call controls -// incomingCallControls.autoPinEdge(toSuperviewEdge: .bottom, withInset: incomingBottomMargin) -// incomingCallControls.autoPinLeadingToSuperviewMargin(withInset: incomingHMargin) -// incomingCallControls.autoPinTrailingToSuperviewMargin(withInset: incomingHMargin) -// incomingCallControls.setContentHuggingVerticalHigh() -// -// // Settings nag views -// settingsNagView.autoPinEdge(toSuperviewEdge: .bottom, withInset: settingsNagBottomMargin) -// settingsNagView.autoPinWidthToSuperview(withMargin: settingsNagHMargin) -// settingsNagView.autoPinEdge(.top, to: .bottom, of: callStatusLabel) -// } -// -// override func updateViewConstraints() { -// updateRemoteVideoLayout() -// updateLocalVideoLayout() -// -// super.updateViewConstraints() -// } -// -// internal func updateRemoteVideoLayout() { -// remoteVideoView.isHidden = !self.hasRemoteVideoTrack -// updateCallUI(callState: call.state) -// } -// -// let videoHintView = CallVideoHintView() -// -// internal func updateLocalVideoLayout() { -// if !localVideoView.isHidden { -// localVideoView.superview?.bringSubviewToFront(localVideoView) -// } -// -// updateCallUI(callState: call.state) -// } -// -// // MARK: - Methods -// -// func showCallFailed(error: Error) { -// // TODO Show something in UI. -// Logger.error("call failed with error: \(error)") -// } -// -// // MARK: - View State -// -// func localizedTextForCallState(_ callState: CallState) -> String { -// assert(Thread.isMainThread) -// -// switch callState { -// case .idle, .remoteHangup, .localHangup: -// return NSLocalizedString("IN_CALL_TERMINATED", comment: "Call setup status label") -// case .dialing: -// return NSLocalizedString("IN_CALL_CONNECTING", comment: "Call setup status label") -// case .remoteRinging, .localRinging: -// return NSLocalizedString("IN_CALL_RINGING", comment: "Call setup status label") -// case .answering: -// return NSLocalizedString("IN_CALL_SECURING", comment: "Call setup status label") -// case .connected: -// let callDuration = call.connectionDuration() -// let callDurationDate = Date(timeIntervalSinceReferenceDate: callDuration) -// if dateFormatter == nil { -// dateFormatter = DateFormatter() -// dateFormatter!.dateFormat = "HH:mm:ss" -// dateFormatter!.timeZone = TimeZone(identifier: "UTC")! -// } -// var formattedDate = dateFormatter!.string(from: callDurationDate) -// if formattedDate.hasPrefix("00:") { -// // Don't show the "hours" portion of the date format unless the -// // call duration is at least 1 hour. -// formattedDate = String(formattedDate[formattedDate.index(formattedDate.startIndex, offsetBy: 3)...]) -// } else { -// // If showing the "hours" portion of the date format, strip any leading -// // zeroes. -// if formattedDate.hasPrefix("0") { -// formattedDate = String(formattedDate[formattedDate.index(formattedDate.startIndex, offsetBy: 1)...]) -// } -// } -// return formattedDate -// case .reconnecting: -// return NSLocalizedString("IN_CALL_RECONNECTING", comment: "Call setup status label") -// case .remoteBusy: -// return NSLocalizedString("END_CALL_RESPONDER_IS_BUSY", comment: "Call setup status label") -// case .localFailure: -// if let error = call.error { -// switch error { -// case .timeout(description: _): -// if self.call.direction == .outgoing { -// return NSLocalizedString("CALL_SCREEN_STATUS_NO_ANSWER", comment: "Call setup status label after outgoing call times out") -// } -// default: -// break -// } -// } -// -// return NSLocalizedString("END_CALL_UNCATEGORIZED_FAILURE", comment: "Call setup status label") -// } -// } -// -// var isBlinkingReconnectLabel = false -// func updateCallStatusLabel(callState: CallState) { -// assert(Thread.isMainThread) -// -// let text = String(format: CallStrings.callStatusFormat, -// localizedTextForCallState(callState)) -// self.callStatusLabel.text = text -// -// // Handle reconnecting blinking -// if case .reconnecting = callState { -// if !isBlinkingReconnectLabel { -// isBlinkingReconnectLabel = true -// UIView.animate(withDuration: 0.7, delay: 0, options: [.autoreverse, .repeat], -// animations: { -// self.callStatusLabel.alpha = 0.2 -// }, completion: nil) -// } else { -// // already blinking -// } -// } else { -// // We're no longer in a reconnecting state, either the call failed or we reconnected. -// // Stop the blinking animation -// if isBlinkingReconnectLabel { -// self.callStatusLabel.layer.removeAllAnimations() -// self.callStatusLabel.alpha = 1 -// isBlinkingReconnectLabel = false -// } -// } -// } -// -// func updateCallUI(callState: CallState) { -// assert(Thread.isMainThread) -// updateCallStatusLabel(callState: callState) -// if isShowingSettingsNag { -// settingsNagView.isHidden = false -// contactAvatarView.isHidden = true -// ongoingCallControls.isHidden = true -// return -// } -// -// // Marquee scrolling is distracting during a video call, disable it. -// contactNameLabel.labelize = call.hasLocalVideo -// -// audioModeMuteButton.isSelected = call.isMuted -// videoModeMuteButton.isSelected = call.isMuted -// audioModeVideoButton.isSelected = call.hasLocalVideo -// videoModeVideoButton.isSelected = call.hasLocalVideo -// -// // Show Incoming vs. Ongoing call controls -// let isRinging = callState == .localRinging -// incomingCallControls.isHidden = !isRinging -// incomingCallControls.isUserInteractionEnabled = isRinging -// ongoingCallControls.isHidden = isRinging -// ongoingCallControls.isUserInteractionEnabled = !isRinging -// -// // Rework control state if remote video is available. -// let hasRemoteVideo = !remoteVideoView.isHidden -// contactAvatarView.isHidden = hasRemoteVideo -// -// // Rework control state if local video is available. -// let hasLocalVideo = !localVideoView.isHidden -// -// if hasLocalVideo { -// ongoingAudioCallControls.removeFromSuperview() -// ongoingCallControls.insertArrangedSubview(ongoingVideoCallControls, at: 0) -// } else { -// ongoingVideoCallControls.removeFromSuperview() -// ongoingCallControls.insertArrangedSubview(ongoingAudioCallControls, at: 0) -// } -// // Layout immediately to avoid spurious animation. -// ongoingCallControls.layoutIfNeeded() -// -// // Also hide other controls if user has tapped to hide them. -// if shouldRemoteVideoControlsBeHidden && !remoteVideoView.isHidden { -// leaveCallViewButton.isHidden = true -// contactNameLabel.isHidden = true -// callStatusLabel.isHidden = true -// ongoingCallControls.isHidden = true -// videoHintView.isHidden = true -// } else { -// leaveCallViewButton.isHidden = false -// contactNameLabel.isHidden = false -// callStatusLabel.isHidden = false -// -// if hasRemoteVideo && !hasLocalVideo && !hasShownLocalVideo && !hasUserDismissedVideoHint { -// view.addSubview(videoHintView) -// videoHintView.isHidden = false -// videoHintView.autoPinEdge(.bottom, to: .top, of: audioModeVideoButton) -// videoHintView.autoPinEdge(.trailing, to: .leading, of: audioModeVideoButton, withOffset: buttonSize() / 2 + videoHintView.kTailHMargin + videoHintView.kTailWidth / 2) -// } else { -// videoHintView.removeFromSuperview() -// } -// } -// -// let doLocalVideoLayout = { -// self.localVideoViewTopConstraintDefault.isActive = !self.contactNameLabel.isHidden -// self.localVideoViewTopConstraintHidden.isActive = self.contactNameLabel.isHidden -// self.localVideoView.superview?.layoutIfNeeded() -// } -// if hasShownLocalVideo { -// // Animate. -// UIView.animate(withDuration: 0.25, animations: doLocalVideoLayout) -// } else { -// // Don't animate. -// doLocalVideoLayout() -// } -// -// // Audio Source Handling (bluetooth) -// if self.hasAlternateAudioSources { -// // With bluetooth, button does not stay selected. Pressing it pops an actionsheet -// // and the button should immediately "unselect". -// audioSourceButton.isSelected = false -// -// if hasLocalVideo { -// audioSourceButton.setImage(#imageLiteral(resourceName: "ic_speaker_bluetooth_inactive_video_mode"), for: .normal) -// audioSourceButton.setImage(#imageLiteral(resourceName: "ic_speaker_bluetooth_inactive_video_mode"), for: .selected) -// } else { -// audioSourceButton.setImage(#imageLiteral(resourceName: "ic_speaker_bluetooth_inactive_audio_mode"), for: .normal) -// audioSourceButton.setImage(#imageLiteral(resourceName: "ic_speaker_bluetooth_inactive_audio_mode"), for: .selected) -// } -// audioSourceButton.isHidden = false -// } else { -// // No bluetooth audio detected -// audioSourceButton.setImage(#imageLiteral(resourceName: "audio-call-speaker-inactive"), for: .normal) -// audioSourceButton.setImage(#imageLiteral(resourceName: "audio-call-speaker-active"), for: .selected) -// -// // If there's no bluetooth, we always use speakerphone, so no need for -// // a button, giving more screen back for the video. -// audioSourceButton.isHidden = hasLocalVideo -// } -// -// // Dismiss Handling -// switch callState { -// case .remoteHangup, .remoteBusy, .localFailure: -// Logger.debug("dismissing after delay because new state is \(callState)") -// dismissIfPossible(shouldDelay: true) -// case .localHangup: -// Logger.debug("dismissing immediately from local hangup") -// dismissIfPossible(shouldDelay: false) -// default: break -// } -// -// if callState == .connected { -// if callDurationTimer == nil { -// let kDurationUpdateFrequencySeconds = 1 / 20.0 -// callDurationTimer = WeakTimer.scheduledTimer(timeInterval: TimeInterval(kDurationUpdateFrequencySeconds), -// target: self, -// userInfo: nil, -// repeats: true) {[weak self] _ in -// self?.updateCallDuration() -// } -// } -// } else { -// callDurationTimer?.invalidate() -// callDurationTimer = nil -// } -// } -// -// func updateCallDuration() { -// updateCallStatusLabel(callState: call.state) -// } -// -// // We update the audioSourceButton outside of the main `updateCallUI` -// // because `updateCallUI` is intended to be idempotent, which isn't possible -// // with external speaker state because: -// // - the system API which enables the external speaker is a (somewhat slow) asyncronous -// // operation -// // - we want to give immediate UI feedback by marking the pressed button as selected -// // before the operation completes. -// func updateAudioSourceButtonIsSelected() { -// guard callUIAdapter.audioService.isSpeakerphoneEnabled else { -// self.audioSourceButton.isSelected = false -// return -// } -// -// // VideoChat mode enables the output speaker, but we don't -// // want to highlight the speaker button in that case. -// guard !call.hasLocalVideo else { -// self.audioSourceButton.isSelected = false -// return -// } -// -// self.audioSourceButton.isSelected = true -// } -// -// // MARK: - Actions -// -// /** -// * Ends a connected call. Do not confuse with `didPressDeclineCall`. -// */ -// @objc func didPressHangup(sender: UIButton) { -// Logger.info("") -// -// callUIAdapter.localHangupCall(call) -// -// dismissIfPossible(shouldDelay: false) -// } -// -// @objc func didPressMute(sender muteButton: UIButton) { -// Logger.info("") -// muteButton.isSelected = !muteButton.isSelected -// -// callUIAdapter.setIsMuted(call: call, isMuted: muteButton.isSelected) -// } -// -// @objc func didPressAudioSource(sender button: UIButton) { -// Logger.info("") -// -// if self.hasAlternateAudioSources { -// presentAudioSourcePicker() -// } else { -// didPressSpeakerphone(sender: button) -// } -// } -// -// func didPressSpeakerphone(sender button: UIButton) { -// Logger.info("") -// -// button.isSelected = !button.isSelected -// callUIAdapter.audioService.requestSpeakerphone(isEnabled: button.isSelected) -// } -// -// func didPressTextMessage(sender button: UIButton) { -// Logger.info("") -// -// dismissIfPossible(shouldDelay: false) -// } -// -// @objc func didPressAnswerCall(sender: UIButton) { -// Logger.info("") -// -// callUIAdapter.answerCall(call) -// } -// -// @objc func didPressVideo(sender: UIButton) { -// Logger.info("") -// let hasLocalVideo = !sender.isSelected -// -// callUIAdapter.setHasLocalVideo(call: call, hasLocalVideo: hasLocalVideo) -// } -// -// @objc func didPressFlipCamera(sender: UIButton) { -// sender.isSelected = !sender.isSelected -// -// let isUsingFrontCamera = !sender.isSelected -// Logger.info("with isUsingFrontCamera: \(isUsingFrontCamera)") -// -// callUIAdapter.setCameraSource(call: call, isUsingFrontCamera: isUsingFrontCamera) -// } -// -// /** -// * Denies an incoming not-yet-connected call, Do not confuse with `didPressHangup`. -// */ -// @objc func didPressDeclineCall(sender: UIButton) { -// Logger.info("") -// -// callUIAdapter.declineCall(call) -// -// dismissIfPossible(shouldDelay: false) -// } -// -// @objc func didPressShowCallSettings(sender: UIButton) { -// Logger.info("") -// -// markSettingsNagAsComplete() -// -// dismissIfPossible(shouldDelay: false, ignoreNag: true, completion: { -// // Find the frontmost presented UIViewController from which to present the -// // settings views. -// let fromViewController = UIApplication.shared.findFrontmostViewController(ignoringAlerts: true) -// assert(fromViewController != nil) -// -// // Construct the "settings" view & push the "privacy settings" view. -// let navigationController = AppSettingsViewController.inModalNavigationController() -// navigationController.pushViewController(PrivacySettingsTableViewController(), animated: false) -// -// fromViewController?.present(navigationController, animated: true, completion: nil) -// }) -// } -// -// @objc func didPressDismissNag(sender: UIButton) { -// Logger.info("") -// -// markSettingsNagAsComplete() -// -// dismissIfPossible(shouldDelay: false, ignoreNag: true) -// } -// -// // We only show the "blocking" settings nag until the user has chosen -// // to view the privacy settings _or_ dismissed the nag at least once. -// // -// // In either case, we set the "CallKit enabled" and "CallKit privacy enabled" -// // settings to their default values to indicate that the user has reviewed -// // them. -// private func markSettingsNagAsComplete() { -// Logger.info("") -// -// let preferences = Environment.shared.preferences! -// -// preferences.setIsCallKitEnabled(preferences.isCallKitEnabled()) -// preferences.setIsCallKitPrivacyEnabled(preferences.isCallKitPrivacyEnabled()) -// } -// -// @objc func didTapLeaveCall(sender: UIButton) { -// OWSWindowManager.shared().leaveCallView() -// } -// -// // MARK: - CallObserver -// -// internal func stateDidChange(call: SignalCall, state: CallState) { -// AssertIsOnMainThread() -// Logger.info("new call status: \(state)") -// -// self.updateCallUI(callState: state) -// } -// -// internal func hasLocalVideoDidChange(call: SignalCall, hasLocalVideo: Bool) { -// AssertIsOnMainThread() -// self.updateCallUI(callState: call.state) -// } -// -// internal func muteDidChange(call: SignalCall, isMuted: Bool) { -// AssertIsOnMainThread() -// self.updateCallUI(callState: call.state) -// } -// -// func holdDidChange(call: SignalCall, isOnHold: Bool) { -// AssertIsOnMainThread() -// self.updateCallUI(callState: call.state) -// } -// -// internal func audioSourceDidChange(call: SignalCall, audioSource: AudioSource?) { -// AssertIsOnMainThread() -// self.updateCallUI(callState: call.state) -// } -// -// // MARK: - CallAudioServiceDelegate -// -// func callAudioService(_ callAudioService: CallAudioService, didUpdateIsSpeakerphoneEnabled isSpeakerphoneEnabled: Bool) { -// AssertIsOnMainThread() -// -// updateAudioSourceButtonIsSelected() -// } -// -// func callAudioServiceDidChangeAudioSession(_ callAudioService: CallAudioService) { -// AssertIsOnMainThread() -// -// // Which sources are available depends on the state of your Session. -// // When the audio session is not yet in PlayAndRecord none are available -// // Then if we're in speakerphone, bluetooth isn't available. -// // So we accrue all possible audio sources in a set, and that list lives as longs as the CallViewController -// // The downside of this is that if you e.g. unpair your bluetooth mid call, it will still appear as an option -// // until your next call. -// // FIXME: There's got to be a better way, but this is where I landed after a bit of work, and seems to work -// // pretty well in practice. -// let availableInputs = callAudioService.availableInputs -// self.allAudioSources.formUnion(availableInputs) -// } -// -// // MARK: - Video -// -// internal func updateLocalVideo(captureSession: AVCaptureSession?) { -// -// AssertIsOnMainThread() -// -// guard localVideoView.captureSession != captureSession else { -// Logger.debug("ignoring redundant update") -// return -// } -// -// localVideoView.captureSession = captureSession -// let isHidden = captureSession == nil -// -// Logger.info("isHidden: \(isHidden)") -// localVideoView.isHidden = isHidden -// -// updateLocalVideoLayout() -// updateAudioSourceButtonIsSelected() -// -// // Don't animate layout of local video view until it has been presented. -// if !isHidden { -// hasShownLocalVideo = true -// } -// } -// -// var hasRemoteVideoTrack: Bool { -// return self.remoteVideoTrack != nil -// } -// -// var hasUserDismissedVideoHint: Bool = false -// -// internal func updateRemoteVideoTrack(remoteVideoTrack: RTCVideoTrack?) { -// AssertIsOnMainThread() -// -// guard self.remoteVideoTrack != remoteVideoTrack else { -// Logger.debug("ignoring redundant update") -// return -// } -// -// self.remoteVideoTrack?.remove(remoteVideoView) -// self.remoteVideoTrack = nil -// remoteVideoView.renderFrame(nil) -// self.remoteVideoTrack = remoteVideoTrack -// self.remoteVideoTrack?.add(remoteVideoView) -// -// shouldRemoteVideoControlsBeHidden = false -// -// if remoteVideoTrack != nil { -// playRemoteEnabledVideoHapticFeedback() -// } -// -// updateRemoteVideoLayout() -// } -// -// // MARK: Video Haptics -// -// let feedbackGenerator = NotificationHapticFeedback() -// var lastHapticTime: TimeInterval = CACurrentMediaTime() -// func playRemoteEnabledVideoHapticFeedback() { -// let currentTime = CACurrentMediaTime() -// guard currentTime - lastHapticTime > 5 else { -// Logger.debug("ignoring haptic feedback since it's too soon") -// return -// } -// feedbackGenerator.notificationOccurred(.success) -// lastHapticTime = currentTime -// } -// -// // MARK: - Dismiss -// -// internal func dismissIfPossible(shouldDelay: Bool, ignoreNag ignoreNagParam: Bool = false, completion: (() -> Void)? = nil) { -// callUIAdapter.audioService.delegate = nil -// -// let ignoreNag: Bool = { -// // Nothing to nag about on iOS11 -// if #available(iOS 11, *) { -// return true -// } else { -// // otherwise on iOS10, nag as specified -// return ignoreNagParam -// } -// }() -// -// if hasDismissed { -// // Don't dismiss twice. -// return -// } else if !ignoreNag && -// call.direction == .incoming && -// UIDevice.current.supportsCallKit && -// (!Environment.shared.preferences.isCallKitEnabled() || -// Environment.shared.preferences.isCallKitPrivacyEnabled()) { -// -// isShowingSettingsNag = true -// -// // Update the nag view's copy to reflect the settings state. -// if Environment.shared.preferences.isCallKitEnabled() { -// settingsNagDescriptionLabel.text = NSLocalizedString("CALL_VIEW_SETTINGS_NAG_DESCRIPTION_PRIVACY", -// comment: "Reminder to the user of the benefits of disabling CallKit privacy.") -// } else { -// settingsNagDescriptionLabel.text = NSLocalizedString("CALL_VIEW_SETTINGS_NAG_DESCRIPTION_ALL", -// comment: "Reminder to the user of the benefits of enabling CallKit and disabling CallKit privacy.") -// } -// settingsNagDescriptionLabel.superview?.setNeedsLayout() -// -// if Environment.shared.preferences.isCallKitEnabledSet() || -// Environment.shared.preferences.isCallKitPrivacySet() { -// // User has already touched these preferences, only show -// // the "fleeting" nag, not the "blocking" nag. -// -// // Show nag for N seconds. -// DispatchQueue.main.asyncAfter(deadline: .now() + 5) { [weak self] in -// guard let strongSelf = self else { return } -// strongSelf.dismissIfPossible(shouldDelay: false, ignoreNag: true) -// } -// } -// } else if shouldDelay { -// hasDismissed = true -// DispatchQueue.main.asyncAfter(deadline: .now() + 1.5) { [weak self] in -// guard let strongSelf = self else { return } -// strongSelf.dismissImmediately(completion: completion) -// } -// } else { -// hasDismissed = true -// dismissImmediately(completion: completion) -// } -// } -// -// internal func dismissImmediately(completion: (() -> Void)?) { -// if CallViewController.kShowCallViewOnSeparateWindow { -// OWSWindowManager.shared().endCall(self) -// completion?() -// } else { -// self.dismiss(animated: true, completion: completion) -// } -// } -// -// // MARK: - CallServiceObserver -// -// internal func didUpdateCall(call: SignalCall?) { -// // Do nothing. -// } -// -// internal func didUpdateVideoTracks(call: SignalCall?, -// localCaptureSession: AVCaptureSession?, -// remoteVideoTrack: RTCVideoTrack?) { -// AssertIsOnMainThread() -// -// updateLocalVideo(captureSession: localCaptureSession) -// updateRemoteVideoTrack(remoteVideoTrack: remoteVideoTrack) -// } -// -// // MARK: - Proximity Monitoring -// -// func ensureProximityMonitoring() { -// if #available(iOS 11, *) { -// // BUG: Adding `self` as a Weak reference to the proximityMonitoringManager results in -// // the CallViewController never being deallocated, which, besides being a memory leak -// // can interfere with subsequent video capture - presumably because the old capture -// // session is still retained via the callViewController.localVideoView. -// // -// // A code audit has not revealed a retain cycle. -// // -// // Using the XCode memory debugger shows that a strong reference is held by -// // windowManager.callNavigationController->_childViewControllers. -// // Even though, when inspecting via the debugger, the CallViewController is not shown as -// // a childViewController. -// // -// // (lldb) po [[[OWSWindowManager sharedManager] callNavigationController] childViewControllers] -// // <__NSSingleObjectArrayI 0x1c0418bd0>( -// // -// // ) -// // -// // Weirder still, when presenting another CallViewController, the old one remains unallocated -// // and inspecting it in the memory debugger shows _no_ strong references to it (yet it -// // is not deallocated). Some weak references do remain - from the proximityMonitoringManager -// // and the callObserver, both of which use the Weak struct, which could be related. -// // -// // In any case, we can apparently avoid this behavior by not adding self as a Weak lifetime -// // and as of iOS11, the system automatically managages proximityMonitoring -// // via CallKit and AudioSessions. Proximity monitoring will be enabled whenever a call -// // is active, unless we switch to VideoChat audio mode (which is actually desirable -// // behavior), so the proximityMonitoringManager is redundant for calls on iOS11+. -// } else { -// // before iOS11, manually enable proximityMonitoring while we're on a call. -// self.proximityMonitoringManager.add(lifetime: self) -// } -// } -//} -// -//extension CallViewController: CallVideoHintViewDelegate { -// func didTapCallVideoHintView(_ videoHintView: CallVideoHintView) { -// self.hasUserDismissedVideoHint = true -// updateRemoteVideoLayout() -// } -//} diff --git a/Session/Signal/CompareSafetyNumbersActivity.swift b/Session/Signal/CompareSafetyNumbersActivity.swift deleted file mode 100644 index 0d7a22222..000000000 --- a/Session/Signal/CompareSafetyNumbersActivity.swift +++ /dev/null @@ -1,103 +0,0 @@ -// -// Copyright (c) 2019 Open Whisper Systems. All rights reserved. -// - -import Foundation -import SignalUtilitiesKit - -let CompareSafetyNumbersActivityType = "org.whispersystems.signal.activity.CompareSafetyNumbers" - -@objc(OWSCompareSafetyNumbersActivityDelegate) -protocol CompareSafetyNumbersActivityDelegate { - func compareSafetyNumbersActivitySucceeded(activity: CompareSafetyNumbersActivity) - func compareSafetyNumbersActivity(_ activity: CompareSafetyNumbersActivity, failedWithError error: Error) -} - -@objc (OWSCompareSafetyNumbersActivity) -class CompareSafetyNumbersActivity: UIActivity { - - var mySafetyNumbers: String? - let delegate: CompareSafetyNumbersActivityDelegate - - @objc - required init(delegate: CompareSafetyNumbersActivityDelegate) { - self.delegate = delegate - super.init() - } - - // MARK: UIActivity - - override class var activityCategory: UIActivity.Category { - get { return .action } - } - - override var activityType: UIActivity.ActivityType? { - get { return UIActivity.ActivityType(rawValue: CompareSafetyNumbersActivityType) } - } - - override var activityTitle: String? { - get { - return NSLocalizedString("COMPARE_SAFETY_NUMBER_ACTION", comment: "Activity Sheet label") - } - } - - override var activityImage: UIImage? { - get { - return #imageLiteral(resourceName: "ic_lock_outline") - } - } - - override func canPerform(withActivityItems activityItems: [Any]) -> Bool { - return stringsFrom(activityItems: activityItems).count > 0 - } - - override func prepare(withActivityItems activityItems: [Any]) { - let myFormattedSafetyNumbers = stringsFrom(activityItems: activityItems).first - mySafetyNumbers = numericOnly(string: myFormattedSafetyNumbers) - } - - override func perform() { - defer { activityDidFinish(true) } - - let pasteboardString = numericOnly(string: UIPasteboard.general.string) - guard (pasteboardString != nil && pasteboardString!.count == 60) else { - Logger.warn("no valid safety numbers found in pasteboard: \(String(describing: pasteboardString))") - let error = OWSErrorWithCodeDescription(OWSErrorCode.userError, - NSLocalizedString("PRIVACY_VERIFICATION_FAILED_NO_SAFETY_NUMBERS_IN_CLIPBOARD", comment: "Alert body for user error")) - - delegate.compareSafetyNumbersActivity(self, failedWithError: error) - return - } - - let pasteboardSafetyNumbers = pasteboardString! - - if pasteboardSafetyNumbers == mySafetyNumbers { - Logger.info("successfully matched safety numbers. local numbers: \(String(describing: mySafetyNumbers)) pasteboard:\(pasteboardSafetyNumbers)") - delegate.compareSafetyNumbersActivitySucceeded(activity: self) - } else { - Logger.warn("local numbers: \(String(describing: mySafetyNumbers)) didn't match pasteboard:\(pasteboardSafetyNumbers)") - let error = OWSErrorWithCodeDescription(OWSErrorCode.privacyVerificationFailure, - NSLocalizedString("PRIVACY_VERIFICATION_FAILED_MISMATCHED_SAFETY_NUMBERS_IN_CLIPBOARD", comment: "Alert body")) - delegate.compareSafetyNumbersActivity(self, failedWithError: error) - } - } - - // MARK: Helpers - - func numericOnly(string: String?) -> String? { - guard let string = string else { - return nil - } - - var numericOnly: String? - if let regex = try? NSRegularExpression(pattern: "\\D", options: .caseInsensitive) { - numericOnly = regex.stringByReplacingMatches(in: string, options: .withTransparentBounds, range: NSRange(location: 0, length: string.utf16.count), withTemplate: "") - } - - return numericOnly - } - - func stringsFrom(activityItems: [Any]) -> [String] { - return activityItems.map { $0 as? String }.filter { $0 != nil }.map { $0! } - } -} diff --git a/Session/Signal/ConversationView/TypingIndicatorInteraction.swift b/Session/Signal/ConversationView/Cells/TypingIndicatorInteraction.swift similarity index 100% rename from Session/Signal/ConversationView/TypingIndicatorInteraction.swift rename to Session/Signal/ConversationView/Cells/TypingIndicatorInteraction.swift diff --git a/Session/Signal/LegacyNotificationsAdaptee.swift b/Session/Signal/LegacyNotificationsAdaptee.swift index 6d92bd199..10cb0e538 100644 --- a/Session/Signal/LegacyNotificationsAdaptee.swift +++ b/Session/Signal/LegacyNotificationsAdaptee.swift @@ -18,30 +18,6 @@ struct LegacyNotificationConfig { static func notificationAction(_ action: AppNotificationAction) -> UIUserNotificationAction { switch action { -// case .answerCall: -// let mutableAction = UIMutableUserNotificationAction() -// mutableAction.identifier = action.identifier -// mutableAction.title = CallStrings.answerCallButtonTitle -// mutableAction.activationMode = .foreground -// mutableAction.isDestructive = false -// mutableAction.isAuthenticationRequired = false -// return mutableAction -// case .callBack: -// let mutableAction = UIMutableUserNotificationAction() -// mutableAction.identifier = action.identifier -// mutableAction.title = CallStrings.callBackButtonTitle -// mutableAction.activationMode = .foreground -// mutableAction.isDestructive = false -// mutableAction.isAuthenticationRequired = true -// return mutableAction -// case .declineCall: -// let mutableAction = UIMutableUserNotificationAction() -// mutableAction.identifier = action.identifier -// mutableAction.title = CallStrings.declineCallButtonTitle -// mutableAction.activationMode = .background -// mutableAction.isDestructive = false -// mutableAction.isAuthenticationRequired = false -// return mutableAction case .markAsRead: let mutableAction = UIMutableUserNotificationAction() mutableAction.identifier = action.identifier @@ -283,12 +259,6 @@ public class LegacyNotificationActionHandler: NSObject { } switch action { -// case .answerCall: -// return try actionHandler.answerCall(userInfo: userInfo) -// case .callBack: -// return try actionHandler.callBack(userInfo: userInfo) -// case .declineCall: -// return try actionHandler.declineCall(userInfo: userInfo) case .markAsRead: return try actionHandler.markAsRead(userInfo: userInfo) case .reply: diff --git a/Session/Signal/MessageDetailViewController.swift b/Session/Signal/MessageDetailViewController.swift index f752c5391..89d6cdcf2 100644 --- a/Session/Signal/MessageDetailViewController.swift +++ b/Session/Signal/MessageDetailViewController.swift @@ -546,8 +546,6 @@ class MessageDetailViewController: OWSViewController, MediaGalleryDataSourceDele private func string(for messageReceiptStatus: MessageReceiptStatus) -> String { switch messageReceiptStatus { - case .calculatingPoW: - return NSLocalizedString("Calculating proof of work", comment: "") case .uploading: return NSLocalizedString("MESSAGE_METADATA_VIEW_MESSAGE_STATUS_UPLOADING", comment: "Status label for messages which are uploading.") diff --git a/Session/Signal/MessageRecipientStatusUtils.swift b/Session/Signal/MessageRecipientStatusUtils.swift index 5e7f8638e..52ac383ff 100644 --- a/Session/Signal/MessageRecipientStatusUtils.swift +++ b/Session/Signal/MessageRecipientStatusUtils.swift @@ -14,7 +14,6 @@ import SignalUtilitiesKit case read case failed case skipped - case calculatingPoW } @objc @@ -165,8 +164,6 @@ public class MessageRecipientStatusUtils: NSObject { return "failed" case .skipped: return "skipped" - case .calculatingPoW: - return "calculatingPoW" } } } diff --git a/Session/Signal/NotificationSettingsOptionsViewController.m b/Session/Signal/NotificationSettingsOptionsViewController.m index 2a15a33ba..8f675bd10 100644 --- a/Session/Signal/NotificationSettingsOptionsViewController.m +++ b/Session/Signal/NotificationSettingsOptionsViewController.m @@ -63,9 +63,6 @@ { [Environment.shared.preferences setNotificationPreviewType:notificationType]; - // rebuild callUIAdapter since notification configuration changed. -// [AppEnvironment.shared.callService createCallUIAdapter]; - [self.navigationController popViewControllerAnimated:YES]; } diff --git a/Session/Signal/OnboardingCaptchaViewController.swift b/Session/Signal/OnboardingCaptchaViewController.swift deleted file mode 100644 index a9f76abcc..000000000 --- a/Session/Signal/OnboardingCaptchaViewController.swift +++ /dev/null @@ -1,201 +0,0 @@ -// -// Copyright (c) 2019 Open Whisper Systems. All rights reserved. -// - -/* -import UIKit -import WebKit - -@objc -public class OnboardingCaptchaViewController: OnboardingBaseViewController { - - private var webView: WKWebView? - - override public func loadView() { - super.loadView() - - view.backgroundColor = Theme.backgroundColor - view.layoutMargins = .zero - - let titleLabel = self.createTitleLabel(text: NSLocalizedString("ONBOARDING_CAPTCHA_TITLE", comment: "Title of the 'onboarding Captcha' view.")) - titleLabel.accessibilityIdentifier = "onboarding.captcha." + "titleLabel" - - let titleRow = UIStackView(arrangedSubviews: [ - titleLabel - ]) - titleRow.axis = .vertical - titleRow.alignment = .fill - titleRow.layoutMargins = UIEdgeInsets(top: 10, left: 0, bottom: 0, right: 0) - titleRow.isLayoutMarginsRelativeArrangement = true - - // We want the CAPTCHA web content to "fill the screen (honoring margins)". - // The way to do this with WKWebView is to inject a javascript snippet that - // manipulates the viewport. - let jscript = "var meta = document.createElement('meta'); meta.setAttribute('name', 'viewport'); meta.setAttribute('content', 'width=device-width'); document.getElementsByTagName('head')[0].appendChild(meta);" - let userScript = WKUserScript(source: jscript, injectionTime: .atDocumentEnd, forMainFrameOnly: true) - let wkUController = WKUserContentController() - wkUController.addUserScript(userScript) - let wkWebConfig = WKWebViewConfiguration() - wkWebConfig.userContentController = wkUController - let webView = WKWebView(frame: self.view.bounds, configuration: wkWebConfig) - self.webView = webView - webView.navigationDelegate = self - webView.allowsBackForwardNavigationGestures = false - webView.customUserAgent = "Signal iOS (+https://signal.org/download)" - webView.allowsLinkPreview = false - webView.scrollView.contentInset = .zero - webView.layoutMargins = .zero - webView.accessibilityIdentifier = "onboarding.captcha." + "webView" - - let stackView = UIStackView(arrangedSubviews: [ - titleRow, - webView - ]) - stackView.axis = .vertical - stackView.alignment = .fill - stackView.layoutMargins = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0) - stackView.isLayoutMarginsRelativeArrangement = true - view.addSubview(stackView) - stackView.autoPinWidthToSuperviewMargins() - stackView.autoPinEdge(.top, to: .top, of: view) - autoPinView(toBottomOfViewControllerOrKeyboard: stackView, avoidNotch: true) - - NotificationCenter.default.addObserver(self, - selector: #selector(didBecomeActive), - name: NSNotification.Name.OWSApplicationDidBecomeActive, - object: nil) - } - - deinit { - NotificationCenter.default.removeObserver(self) - } - - public override func viewWillAppear(_ animated: Bool) { - super.viewWillAppear(animated) - - loadContent() - - webView?.scrollView.contentOffset = .zero - } - - public override func viewDidAppear(_ animated: Bool) { - super.viewDidAppear(animated) - - webView?.scrollView.contentOffset = .zero - } - - fileprivate let contentUrl = "https://signalcaptchas.org/registration/generate.html" - - private func loadContent() { - guard let webView = webView else { - owsFailDebug("Missing webView.") - return - } - guard let url = URL(string: contentUrl) else { - owsFailDebug("Invalid URL.") - return - } - webView.load(URLRequest(url: url)) - webView.scrollView.contentOffset = .zero - } - - // MARK: - Notifications - - @objc func didBecomeActive() { - AssertIsOnMainThread() - - loadContent() - } - - // MARK: - - - private func parseCaptchaAndTryToRegister(url: URL) { - Logger.info("") - - guard let captchaToken = parseCaptcha(url: url) else { - owsFailDebug("Could not parse captcha token: \(url)") - // TODO: Alert? - // - // Reload content so user can try again. - loadContent() - return - } - onboardingController.update(captchaToken: captchaToken) - - onboardingController.tryToRegister(fromViewController: self, smsVerification: true) - } - - private func parseCaptcha(url: URL) -> String? { - Logger.info("") - - // Example URL: - // signalcaptcha://03AF6jDqXgf1PocNNrWRJEENZ9l6RAMIsUoESi2dFKkxTgE2qjdZGVjEW6SZNFQqeRRTgGqOii6zHGG--uLyC1HnhSmRt8wHeKxHcg1hsK4ucTusANIeFXVB8wPPiV7U_0w2jUFVak5clMCvW9_JBfbfzj51_e9sou8DYfwc_R6THuTBTdpSV8Nh0yJalgget-nSukCxh6FPA6hRVbw7lP3r-me1QCykHOfh-V29UVaQ4Fs5upHvwB5rtiViqT_HN8WuGmdIdGcaWxaqy1lQTgFSs2Shdj593wZiXfhJnCWAw9rMn3jSgIZhkFxdXwKOmslQ2E_I8iWkm6 - guard let host = url.host, - host.count > 0 else { - owsFailDebug("Missing host.") - return nil - } - - return host - } -} - -// MARK: - - -extension OnboardingCaptchaViewController: WKNavigationDelegate { - public func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) { - Logger.verbose("navigationAction: \(String(describing: navigationAction.request.url))") - - guard let url: URL = navigationAction.request.url else { - owsFailDebug("Missing URL.") - decisionHandler(.cancel) - return - } - if url.scheme == "signalcaptcha" { - decisionHandler(.cancel) - DispatchQueue.main.async { - self.parseCaptchaAndTryToRegister(url: url) - } - return - } - - // Loading the Captcha content involves a series of actions. - decisionHandler(.allow) - } - - public func webView(_ webView: WKWebView, decidePolicyFor navigationResponse: WKNavigationResponse, decisionHandler: @escaping (WKNavigationResponsePolicy) -> Void) { - Logger.verbose("navigationResponse: \(String(describing: navigationResponse))") - - decisionHandler(.allow) - } - - public func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) { - Logger.verbose("navigation: \(String(describing: navigation))") - } - - public func webView(_ webView: WKWebView, didReceiveServerRedirectForProvisionalNavigation navigation: WKNavigation!) { - Logger.verbose("navigation: \(String(describing: navigation))") - } - - public func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: Error) { - Logger.verbose("navigation: \(String(describing: navigation)), error: \(error)") - } - - public func webView(_ webView: WKWebView, didCommit navigation: WKNavigation!) { - Logger.verbose("navigation: \(String(describing: navigation))") - } - - public func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { - Logger.verbose("navigation: \(String(describing: navigation))") - } - - public func webView(_ webView: WKWebView, didFail navigation: WKNavigation!, withError error: Error) { - Logger.verbose("navigation: \(String(describing: navigation)), error: \(error)") - } - - public func webViewWebContentProcessDidTerminate(_ webView: WKWebView) { - Logger.verbose("") - } -} - */ - diff --git a/Session/Signal/PeerConnectionClient.swift b/Session/Signal/PeerConnectionClient.swift deleted file mode 100644 index 1376ebd26..000000000 --- a/Session/Signal/PeerConnectionClient.swift +++ /dev/null @@ -1,1378 +0,0 @@ -//// -//// Copyright (c) 2019 Open Whisper Systems. All rights reserved. -//// -// -//import Foundation -//import PromiseKit -//import WebRTC -//import SignalUtilitiesKit -//import SignalUtilitiesKit -// -//// HACK - Seeing crazy SEGFAULTs on iOS9 when accessing these objc externs. -//// iOS10 seems unaffected. Reproducible for ~1 in 3 calls. -//// Binding them to a file constant seems to work around the problem. -//let kAudioTrackType = kRTCMediaStreamTrackKindAudio -//let kVideoTrackType = kRTCMediaStreamTrackKindVideo -//let kMediaConstraintsMinWidth = kRTCMediaConstraintsMinWidth -//let kMediaConstraintsMaxWidth = kRTCMediaConstraintsMaxWidth -//let kMediaConstraintsMinHeight = kRTCMediaConstraintsMinHeight -//let kMediaConstraintsMaxHeight = kRTCMediaConstraintsMaxHeight -// -///** -// * The PeerConnectionClient notifies it's delegate (the CallService) of key events in the call signaling life cycle -// * -// * The delegate's methods will always be called on the main thread. -// */ -//protocol PeerConnectionClientDelegate: class { -// -// /** -// * The connection has been established. The clients can now communicate. -// * This can be called multiple times throughout the call in the event of temporary network disconnects. -// */ -// func peerConnectionClientIceConnected(_ peerconnectionClient: PeerConnectionClient) -// -// /** -// * The connection failed to establish. The clients will not be able to communicate. -// */ -// func peerConnectionClientIceFailed(_ peerconnectionClient: PeerConnectionClient) -// -// /** -// * After initially connecting, the connection disconnected. -// * It maybe be temporary, in which case `peerConnectionClientIceConnected` will be called again once we're reconnected. -// * Otherwise, `peerConnectionClientIceFailed` will eventually called. -// */ -// func peerConnectionClientIceDisconnected(_ peerconnectionClient: PeerConnectionClient) -// -// /** -// * During the Signaling process each client generates IceCandidates locally, which contain information about how to -// * reach the local client via the internet. The delegate must shuttle these IceCandates to the other (remote) client -// * out of band, as part of establishing a connection over WebRTC. -// */ -// func peerConnectionClient(_ peerconnectionClient: PeerConnectionClient, addedLocalIceCandidate iceCandidate: RTCIceCandidate) -// -// /** -// * Once the peerconnection is established, we can receive messages via the data channel, and notify the delegate. -// */ -// func peerConnectionClient(_ peerconnectionClient: PeerConnectionClient, received dataChannelMessage: WebRTCProtoData) -// -// /** -// * Fired whenever the local video track become active or inactive. -// */ -// func peerConnectionClient(_ peerconnectionClient: PeerConnectionClient, didUpdateLocalVideoCaptureSession captureSession: AVCaptureSession?) -// -// /** -// * Fired whenever the remote video track become active or inactive. -// */ -// func peerConnectionClient(_ peerconnectionClient: PeerConnectionClient, didUpdateRemoteVideoTrack videoTrack: RTCVideoTrack?) -//} -// -//// In Swift (at least in Swift v3.3), weak variables aren't thread safe. It -//// isn't safe to resolve/acquire/lock a weak reference into a strong reference -//// while the instance might be being deallocated on another thread. -//// -//// PeerConnectionProxy provides thread-safe access to a strong reference. -//// PeerConnectionClient has an PeerConnectionProxy to itself that its many async blocks -//// (which run on more than one thread) can use to safely try to acquire a strong -//// reference to the PeerConnectionClient. In ARC we'd normally, we'd avoid -//// having an instance retain a strong reference to itself to avoid retain -//// cycles, but it's safe in this case: PeerConnectionClient is owned (and only -//// used by) a single entity CallService and CallService always calls -//// [PeerConnectionClient terminate] when it is done with a PeerConnectionClient -//// instance, so terminate is a reliable place where we can break the retain cycle. -//// -//// Note that we use the proxy in two ways: -//// -//// * As a delegate for the peer connection and the data channel, -//// safely forwarding delegate method invocations to the PCC. -//// * To safely obtain references to the PCC within the PCC's -//// async blocks. -//// -//// This should be fixed in Swift 4, but it isn't. -//// -//// To test using the following scenarios: -//// -//// * Alice and Bob place simultaneous calls to each other. Both should get busy. -//// Repeat 10-20x. Then verify that they can connect a call by having just one -//// call the other. -//// * Alice or Bob (randomly alternating) calls the other. Recipient (randomly) -//// accepts call or hangs up. If accepted, Alice or Bob (randomly) hangs up. -//// Repeat immediately, as fast as you can, 10-20x. -//class PeerConnectionProxy: NSObject, RTCPeerConnectionDelegate, RTCDataChannelDelegate { -// -// private var value: PeerConnectionClient? -// -// deinit { -// Logger.info("[PeerConnectionProxy] deinit") -// } -// -// func set(value: PeerConnectionClient) { -// objc_sync_enter(self) -// self.value = value -// objc_sync_exit(self) -// } -// -// func get() -> PeerConnectionClient? { -// objc_sync_enter(self) -// let result = value -// objc_sync_exit(self) -// -// if result == nil { -// // Every time this method returns nil is a -// // possible crash avoided. -// Logger.verbose("cleared get.") -// } -// -// return result -// } -// -// func clear() { -// Logger.info("") -// -// objc_sync_enter(self) -// value = nil -// objc_sync_exit(self) -// } -// -// // MARK: - RTCPeerConnectionDelegate -// -// public func peerConnection(_ peerConnection: RTCPeerConnection, didChange stateChanged: RTCSignalingState) { -// self.get()?.peerConnection(peerConnection, didChange: stateChanged) -// } -// -// public func peerConnection(_ peerConnection: RTCPeerConnection, didAdd stream: RTCMediaStream) { -// self.get()?.peerConnection(peerConnection, didAdd: stream) -// } -// -// public func peerConnection(_ peerConnection: RTCPeerConnection, didRemove stream: RTCMediaStream) { -// self.get()?.peerConnection(peerConnection, didRemove: stream) -// } -// -// public func peerConnectionShouldNegotiate(_ peerConnection: RTCPeerConnection) { -// self.get()?.peerConnectionShouldNegotiate(peerConnection) -// } -// -// public func peerConnection(_ peerConnection: RTCPeerConnection, didChange newState: RTCIceConnectionState) { -// self.get()?.peerConnection(peerConnection, didChange: newState) -// } -// -// public func peerConnection(_ peerConnection: RTCPeerConnection, didChange newState: RTCIceGatheringState) { -// self.get()?.peerConnection(peerConnection, didChange: newState) -// } -// -// public func peerConnection(_ peerConnection: RTCPeerConnection, didGenerate candidate: RTCIceCandidate) { -// self.get()?.peerConnection(peerConnection, didGenerate: candidate) -// } -// -// public func peerConnection(_ peerConnection: RTCPeerConnection, didRemove candidates: [RTCIceCandidate]) { -// self.get()?.peerConnection(peerConnection, didRemove: candidates) -// } -// -// public func peerConnection(_ peerConnection: RTCPeerConnection, didOpen dataChannel: RTCDataChannel) { -// self.get()?.peerConnection(peerConnection, didOpen: dataChannel) -// } -// -// public func peerConnection(_ peerConnection: RTCPeerConnection, didChange connectionState: RTCPeerConnectionState) { -// self.get()?.peerConnection(peerConnection, didChange: connectionState) -// } -// -// // MARK: - RTCDataChannelDelegate -// -// public func dataChannelDidChangeState(_ dataChannel: RTCDataChannel) { -// self.get()?.dataChannelDidChangeState(dataChannel) -// } -// -// public func dataChannel(_ dataChannel: RTCDataChannel, didReceiveMessageWith buffer: RTCDataBuffer) { -// self.get()?.dataChannel(dataChannel, didReceiveMessageWith: buffer) -// } -// -// public func dataChannel(_ dataChannel: RTCDataChannel, didChangeBufferedAmount amount: UInt64) { -// self.get()?.dataChannel(dataChannel, didChangeBufferedAmount: amount) -// } -//} -// -///** -// * `PeerConnectionClient` is our interface to WebRTC. -// * -// * It is primarily a wrapper around `RTCPeerConnection`, which is responsible for sending and receiving our call data -// * including audio, video, and some post-connected signaling (hangup, add video) -// */ -//class PeerConnectionClient: NSObject, RTCPeerConnectionDelegate, RTCDataChannelDelegate, VideoCaptureSettingsDelegate { -// -// enum Identifiers: String { -// case mediaStream = "ARDAMS", -// videoTrack = "ARDAMSv0", -// audioTrack = "ARDAMSa0", -// dataChannelSignaling = "signaling" -// } -// -// // A state in this class should only be accessed on this queue in order to -// // serialize access. -// // -// // This queue is also used to perform expensive calls to the WebRTC API. -// private static let signalingQueue = DispatchQueue(label: "CallServiceSignalingQueue") -// -// // Delegate is notified of key events in the call lifecycle. -// // -// // This property should only be accessed on the main thread. -// private weak var delegate: PeerConnectionClientDelegate? -// -// // Connection -// -// private var peerConnection: RTCPeerConnection? -// private let iceServers: [RTCIceServer] -// private let connectionConstraints: RTCMediaConstraints -// private let configuration: RTCConfiguration -// private let factory: RTCPeerConnectionFactory -// -// // DataChannel -// -// private var dataChannel: RTCDataChannel? -// -// // Audio -// -// private var audioSender: RTCRtpSender? -// private var audioTrack: RTCAudioTrack? -// private var audioConstraints: RTCMediaConstraints -// -// // Video -// -// private var videoCaptureController: VideoCaptureController? -// private var videoSender: RTCRtpSender? -// -// // RTCVideoTrack is fragile and prone to throwing exceptions and/or -// // causing deadlock in its destructor. Therefore we take great care -// // with this property. -// private var localVideoTrack: RTCVideoTrack? -// private var remoteVideoTrack: RTCVideoTrack? -// private var cameraConstraints: RTCMediaConstraints -// -// private let proxy = PeerConnectionProxy() -// // Note that we're deliberately leaking proxy instances using this -// // collection to avoid EXC_BAD_ACCESS. Calls are rare and the proxy -// // is tiny (a single property), so it's better to leak and be safe. -// private static var expiredProxies = [PeerConnectionProxy]() -// -// init(iceServers: [RTCIceServer], delegate: PeerConnectionClientDelegate, callDirection: CallDirection, useTurnOnly: Bool) { -// AssertIsOnMainThread() -// -// self.iceServers = iceServers -// self.delegate = delegate -// -// // Ensure we enable SW decoders to enable VP8 support -// let decoderFactory = RTCDefaultVideoDecoderFactory() -// let encoderFactory = RTCDefaultVideoEncoderFactory() -// let factory = RTCPeerConnectionFactory(encoderFactory: encoderFactory, decoderFactory: decoderFactory) -// -// self.factory = factory -// configuration = RTCConfiguration() -// configuration.iceServers = iceServers -// configuration.bundlePolicy = .maxBundle -// configuration.rtcpMuxPolicy = .require -// if useTurnOnly { -// Logger.debug("using iceTransportPolicy: relay") -// configuration.iceTransportPolicy = .relay -// } else { -// Logger.debug("using iceTransportPolicy: default") -// } -// -// let connectionConstraintsDict = ["DtlsSrtpKeyAgreement": "true"] -// connectionConstraints = RTCMediaConstraints(mandatoryConstraints: nil, optionalConstraints: connectionConstraintsDict) -// -// audioConstraints = RTCMediaConstraints(mandatoryConstraints: nil, optionalConstraints: nil) -// cameraConstraints = RTCMediaConstraints(mandatoryConstraints: nil, optionalConstraints: nil) -// -// super.init() -// -// proxy.set(value: self) -// -// peerConnection = factory.peerConnection(with: configuration, -// constraints: connectionConstraints, -// delegate: proxy) -// createAudioSender() -// createVideoSender() -// -// if callDirection == .outgoing { -// // When placing an outgoing call, it's our responsibility to create the DataChannel. -// // Recipient will not have to do this explicitly. -// createSignalingDataChannel() -// } -// } -// -// deinit { -// // TODO: We can demote this log level to debug once we're confident that -// // this class is always deallocated. -// Logger.info("[PeerConnectionClient] deinit") -// } -// -// // MARK: - Media Streams -// -// private func createSignalingDataChannel() { -// AssertIsOnMainThread() -// guard let peerConnection = peerConnection else { -// Logger.debug("Ignoring obsolete event in terminated client") -// return -// } -// -// let configuration = RTCDataChannelConfiguration() -// // Insist upon an "ordered" TCP data channel for delivery reliability. -// configuration.isOrdered = true -// -// guard let dataChannel = peerConnection.dataChannel(forLabel: Identifiers.dataChannelSignaling.rawValue, -// configuration: configuration) else { -// -// // TODO fail outgoing call? -// owsFailDebug("dataChannel was unexpectedly nil") -// return -// } -// dataChannel.delegate = proxy -// -// assert(self.dataChannel == nil) -// self.dataChannel = dataChannel -// } -// -// // MARK: - Video -// -// fileprivate func createVideoSender() { -// AssertIsOnMainThread() -// Logger.debug("") -// assert(self.videoSender == nil, "\(#function) should only be called once.") -// -// guard !Platform.isSimulator else { -// Logger.warn("Refusing to create local video track on simulator which has no capture device.") -// return -// } -// guard let peerConnection = peerConnection else { -// Logger.debug("Ignoring obsolete event in terminated client") -// return -// } -// -// let videoSource = factory.videoSource() -// -// let localVideoTrack = factory.videoTrack(with: videoSource, trackId: Identifiers.videoTrack.rawValue) -// self.localVideoTrack = localVideoTrack -// // Disable by default until call is connected. -// // FIXME - do we require mic permissions at this point? -// // if so maybe it would be better to not even add the track until the call is connected -// // instead of creating it and disabling it. -// localVideoTrack.isEnabled = false -// -// let capturer = RTCCameraVideoCapturer(delegate: videoSource) -// self.videoCaptureController = VideoCaptureController(capturer: capturer, settingsDelegate: self) -// -// let videoSender = peerConnection.sender(withKind: kVideoTrackType, streamId: Identifiers.mediaStream.rawValue) -// videoSender.track = localVideoTrack -// self.videoSender = videoSender -// } -// -// public func setCameraSource(isUsingFrontCamera: Bool) { -// AssertIsOnMainThread() -// -// let proxyCopy = self.proxy -// PeerConnectionClient.signalingQueue.async { -// guard let strongSelf = proxyCopy.get() else { return } -// -// guard let captureController = strongSelf.videoCaptureController else { -// owsFailDebug("captureController was unexpectedly nil") -// return -// } -// -// captureController.switchCamera(isUsingFrontCamera: isUsingFrontCamera) -// } -// } -// -// public func setLocalVideoEnabled(enabled: Bool) { -// AssertIsOnMainThread() -// let proxyCopy = self.proxy -// let completion = { -// guard let strongSelf = proxyCopy.get() else { return } -// guard let strongDelegate = strongSelf.delegate else { return } -// -// let captureSession: AVCaptureSession? = { -// guard enabled else { -// return nil -// } -// -// guard let captureController = strongSelf.videoCaptureController else { -// owsFailDebug("videoCaptureController was unexpectedly nil") -// return nil -// } -// -// return captureController.captureSession -// }() -// -// strongDelegate.peerConnectionClient(strongSelf, didUpdateLocalVideoCaptureSession: captureSession) -// } -// -// PeerConnectionClient.signalingQueue.async { -// guard let strongSelf = proxyCopy.get() else { return } -// guard strongSelf.peerConnection != nil else { -// Logger.debug("Ignoring obsolete event in terminated client") -// return -// } -// -// guard let videoCaptureController = strongSelf.videoCaptureController else { -// Logger.debug("Ignoring obsolete event in terminated client") -// return -// } -// -// guard let localVideoTrack = strongSelf.localVideoTrack else { -// Logger.debug("Ignoring obsolete event in terminated client") -// return -// } -// localVideoTrack.isEnabled = enabled -// -// if enabled { -// Logger.debug("starting video capture") -// videoCaptureController.startCapture() -// } else { -// Logger.debug("stopping video capture") -// videoCaptureController.stopCapture() -// } -// -// DispatchQueue.main.async(execute: completion) -// } -// } -// -// // MARK: VideoCaptureSettingsDelegate -// -// var videoWidth: Int32 { -// return 400 -// } -// -// var videoHeight: Int32 { -// return 400 -// } -// -// // MARK: - Audio -// -// fileprivate func createAudioSender() { -// AssertIsOnMainThread() -// Logger.debug("") -// assert(self.audioSender == nil, "\(#function) should only be called once.") -// -// guard let peerConnection = peerConnection else { -// Logger.debug("Ignoring obsolete event in terminated client") -// return -// } -// -// let audioSource = factory.audioSource(with: self.audioConstraints) -// -// let audioTrack = factory.audioTrack(with: audioSource, trackId: Identifiers.audioTrack.rawValue) -// self.audioTrack = audioTrack -// -// // Disable by default until call is connected. -// // FIXME - do we require mic permissions at this point? -// // if so maybe it would be better to not even add the track until the call is connected -// // instead of creating it and disabling it. -// audioTrack.isEnabled = false -// -// let audioSender = peerConnection.sender(withKind: kAudioTrackType, streamId: Identifiers.mediaStream.rawValue) -// audioSender.track = audioTrack -// self.audioSender = audioSender -// } -// -// public func setAudioEnabled(enabled: Bool) { -// AssertIsOnMainThread() -// let proxyCopy = self.proxy -// PeerConnectionClient.signalingQueue.async { -// guard let strongSelf = proxyCopy.get() else { return } -// guard strongSelf.peerConnection != nil else { -// Logger.debug("Ignoring obsolete event in terminated client") -// return -// } -// guard let audioTrack = strongSelf.audioTrack else { -// Logger.debug("Ignoring obsolete event in terminated client") -// return -// } -// -// audioTrack.isEnabled = enabled -// } -// } -// -// // MARK: - Session negotiation -// -// private var defaultOfferConstraints: RTCMediaConstraints { -// let mandatoryConstraints = [ -// "OfferToReceiveAudio": "true", -// "OfferToReceiveVideo": "true" -// ] -// return RTCMediaConstraints(mandatoryConstraints: mandatoryConstraints, optionalConstraints: nil) -// } -// -// public func createOffer() -> Promise { -// AssertIsOnMainThread() -// let proxyCopy = self.proxy -// let (promise, resolver) = Promise.pending() -// let completion: ((RTCSessionDescription?, Error?) -> Void) = { (sdp, error) in -// guard let strongSelf = proxyCopy.get() else { -// resolver.reject(NSError(domain: "Obsolete client", code: 0, userInfo: nil)) -// return -// } -// strongSelf.assertOnSignalingQueue() -// guard strongSelf.peerConnection != nil else { -// Logger.debug("Ignoring obsolete event in terminated client") -// resolver.reject(NSError(domain: "Obsolete client", code: 0, userInfo: nil)) -// return -// } -// if let error = error { -// resolver.reject(error) -// return -// } -// -// guard let sessionDescription = sdp else { -// Logger.error("No session description was obtained, even though there was no error reported.") -// let error = OWSErrorMakeUnableToProcessServerResponseError() -// resolver.reject(error) -// return -// } -// -// resolver.fulfill(HardenedRTCSessionDescription(rtcSessionDescription: sessionDescription)) -// } -// -// PeerConnectionClient.signalingQueue.async { -// guard let strongSelf = proxyCopy.get() else { -// resolver.reject(NSError(domain: "Obsolete client", code: 0, userInfo: nil)) -// return -// } -// strongSelf.assertOnSignalingQueue() -// guard let peerConnection = strongSelf.peerConnection else { -// Logger.debug("Ignoring obsolete event in terminated client") -// resolver.reject(NSError(domain: "Obsolete client", code: 0, userInfo: nil)) -// return -// } -// -// peerConnection.offer(for: strongSelf.defaultOfferConstraints, completionHandler: { (sdp: RTCSessionDescription?, error: Error?) in -// PeerConnectionClient.signalingQueue.async { -// completion(sdp, error) -// } -// }) -// } -// -// return promise -// } -// -// public func setLocalSessionDescriptionInternal(_ sessionDescription: HardenedRTCSessionDescription) -> Promise { -// let proxyCopy = self.proxy -// let (promise, resolver) = Promise.pending() -// PeerConnectionClient.signalingQueue.async { -// guard let strongSelf = proxyCopy.get() else { -// resolver.reject(NSError(domain: "Obsolete client", code: 0, userInfo: nil)) -// return -// } -// strongSelf.assertOnSignalingQueue() -// -// guard let peerConnection = strongSelf.peerConnection else { -// Logger.debug("Ignoring obsolete event in terminated client") -// resolver.reject(NSError(domain: "Obsolete client", code: 0, userInfo: nil)) -// return -// } -// -// Logger.verbose("setting local session description: \(sessionDescription)") -// peerConnection.setLocalDescription(sessionDescription.rtcSessionDescription, completionHandler: { (error) in -// if let error = error { -// resolver.reject(error) -// } else { -// resolver.fulfill(()) -// } -// }) -// } -// return promise -// } -// -// public func setLocalSessionDescription(_ sessionDescription: HardenedRTCSessionDescription) -> Promise { -// AssertIsOnMainThread() -// let proxyCopy = self.proxy -// let (promise, resolver) = Promise.pending() -// PeerConnectionClient.signalingQueue.async { -// guard let strongSelf = proxyCopy.get() else { -// resolver.reject(NSError(domain: "Obsolete client", code: 0, userInfo: nil)) -// return -// } -// strongSelf.assertOnSignalingQueue() -// guard let peerConnection = strongSelf.peerConnection else { -// Logger.debug("Ignoring obsolete event in terminated client") -// resolver.reject(NSError(domain: "Obsolete client", code: 0, userInfo: nil)) -// return -// } -// -// Logger.verbose("setting local session description: \(sessionDescription)") -// peerConnection.setLocalDescription(sessionDescription.rtcSessionDescription, -// completionHandler: { error in -// if let error = error { -// resolver.reject(error) -// return -// } -// resolver.fulfill(()) -// }) -// } -// -// return promise -// } -// -// public func negotiateSessionDescription(remoteDescription: RTCSessionDescription, constraints: RTCMediaConstraints) -> Promise { -// AssertIsOnMainThread() -// let proxyCopy = self.proxy -// return setRemoteSessionDescription(remoteDescription) -// .then(on: PeerConnectionClient.signalingQueue) { _ -> Promise in -// guard let strongSelf = proxyCopy.get() else { -// return Promise(error: NSError(domain: "Obsolete client", code: 0, userInfo: nil)) -// } -// return strongSelf.negotiateAnswerSessionDescription(constraints: constraints) -// } -// } -// -// public func setRemoteSessionDescription(_ sessionDescription: RTCSessionDescription) -> Promise { -// AssertIsOnMainThread() -// let proxyCopy = self.proxy -// let (promise, resolver) = Promise.pending() -// PeerConnectionClient.signalingQueue.async { -// guard let strongSelf = proxyCopy.get() else { -// resolver.reject(NSError(domain: "Obsolete client", code: 0, userInfo: nil)) -// return -// } -// strongSelf.assertOnSignalingQueue() -// guard let peerConnection = strongSelf.peerConnection else { -// Logger.debug("Ignoring obsolete event in terminated client") -// resolver.reject(NSError(domain: "Obsolete client", code: 0, userInfo: nil)) -// return -// } -// Logger.verbose("setting remote description: \(sessionDescription)") -// peerConnection.setRemoteDescription(sessionDescription, -// completionHandler: { error in -// if let error = error { -// resolver.reject(error) -// return -// } -// resolver.fulfill(()) -// }) -// } -// return promise -// } -// -// private func negotiateAnswerSessionDescription(constraints: RTCMediaConstraints) -> Promise { -// assertOnSignalingQueue() -// let proxyCopy = self.proxy -// let (promise, resolver) = Promise.pending() -// let completion: ((RTCSessionDescription?, Error?) -> Void) = { (sdp, error) in -// guard let strongSelf = proxyCopy.get() else { -// resolver.reject(NSError(domain: "Obsolete client", code: 0, userInfo: nil)) -// return -// } -// strongSelf.assertOnSignalingQueue() -// guard strongSelf.peerConnection != nil else { -// Logger.debug("Ignoring obsolete event in terminated client") -// resolver.reject(NSError(domain: "Obsolete client", code: 0, userInfo: nil)) -// return -// } -// if let error = error { -// resolver.reject(error) -// return -// } -// -// guard let sessionDescription = sdp else { -// Logger.error("unexpected empty session description, even though no error was reported.") -// let error = OWSErrorMakeUnableToProcessServerResponseError() -// resolver.reject(error) -// return -// } -// -// let hardenedSessionDescription = HardenedRTCSessionDescription(rtcSessionDescription: sessionDescription) -// -// firstly { -// strongSelf.setLocalSessionDescriptionInternal(hardenedSessionDescription) -// }.done(on: PeerConnectionClient.signalingQueue) { -// resolver.fulfill(hardenedSessionDescription) -// }.catch { error in -// resolver.reject(error) -// }.retainUntilComplete() -// } -// -// PeerConnectionClient.signalingQueue.async { -// guard let strongSelf = proxyCopy.get() else { -// resolver.reject(NSError(domain: "Obsolete client", code: 0, userInfo: nil)) -// return -// } -// strongSelf.assertOnSignalingQueue() -// -// guard let peerConnection = strongSelf.peerConnection else { -// Logger.debug("Ignoring obsolete event in terminated client") -// resolver.reject(NSError(domain: "Obsolete client", code: 0, userInfo: nil)) -// return -// } -// -// Logger.debug("negotiating answer session.") -// -// peerConnection.answer(for: constraints, completionHandler: { (sdp: RTCSessionDescription?, error: Error?) in -// PeerConnectionClient.signalingQueue.async { -// completion(sdp, error) -// } -// }) -// } -// return promise -// } -// -// public func addRemoteIceCandidate(_ candidate: RTCIceCandidate) { -// let proxyCopy = self.proxy -// PeerConnectionClient.signalingQueue.async { -// guard let strongSelf = proxyCopy.get() else { return } -// guard let peerConnection = strongSelf.peerConnection else { -// Logger.debug("Ignoring obsolete event in terminated client") -// return -// } -// Logger.info("adding remote ICE candidate: \(candidate.sdp)") -// peerConnection.add(candidate) -// } -// } -// -// public func terminate() { -// AssertIsOnMainThread() -// Logger.debug("") -// -// // Clear the delegate immediately so that we can guarantee that -// // no delegate methods are called after terminate() returns. -// delegate = nil -// -// // Clear the proxy immediately so that enqueued work is aborted -// // going forward. -// PeerConnectionClient.expiredProxies.append(proxy) -// proxy.clear() -// -// // Don't use [weak self]; we always want to perform terminateInternal(). -// PeerConnectionClient.signalingQueue.async { -// self.terminateInternal() -// } -// } -// -// private func terminateInternal() { -// assertOnSignalingQueue() -// Logger.debug("") -// -// // Some notes on preventing crashes while disposing of peerConnection for video calls -// // from: https://groups.google.com/forum/#!searchin/discuss-webrtc/objc$20crash$20dealloc%7Csort:relevance/discuss-webrtc/7D-vk5yLjn8/rBW2D6EW4GYJ -// // The sequence to make it work appears to be -// // -// // [capturer stop]; // I had to add this as a method to RTCVideoCapturer -// // [localRenderer stop]; -// // [remoteRenderer stop]; -// // [peerConnection close]; -// -// // audioTrack is a strong property because we need access to it to mute/unmute, but I was seeing it -// // become nil when it was only a weak property. So we retain it and manually nil the reference here, because -// // we are likely to crash if we retain any peer connection properties when the peerconnection is released -// -// localVideoTrack?.isEnabled = false -// remoteVideoTrack?.isEnabled = false -// -// if let dataChannel = self.dataChannel { -// dataChannel.delegate = nil -// } -// -// dataChannel = nil -// audioSender = nil -// audioTrack = nil -// videoSender = nil -// localVideoTrack = nil -// remoteVideoTrack = nil -// videoCaptureController = nil -// -// if let peerConnection = peerConnection { -// peerConnection.delegate = nil -// peerConnection.close() -// } -// peerConnection = nil -// } -// -// // MARK: - Data Channel -// -// // should only be accessed on PeerConnectionClient.signalingQueue -// var pendingDataChannelMessages: [PendingDataChannelMessage] = [] -// struct PendingDataChannelMessage { -// let data: Data -// let description: String -// let isCritical: Bool -// } -// -// public func sendDataChannelMessage(data: Data, description: String, isCritical: Bool) { -// AssertIsOnMainThread() -// let proxyCopy = self.proxy -// PeerConnectionClient.signalingQueue.async { -// guard let strongSelf = proxyCopy.get() else { return } -// -// guard strongSelf.peerConnection != nil else { -// Logger.debug("Ignoring obsolete event in terminated client: \(description)") -// return -// } -// -// guard let dataChannel = strongSelf.dataChannel else { -// if isCritical { -// Logger.info("enqueuing critical data channel message for after we have a dataChannel: \(description)") -// strongSelf.pendingDataChannelMessages.append(PendingDataChannelMessage(data: data, description: description, isCritical: isCritical)) -// } else { -// Logger.error("ignoring sending \(data) for nil dataChannel: \(description)") -// } -// return -// } -// -// Logger.debug("sendDataChannelMessage trying: \(description)") -// -// let buffer = RTCDataBuffer(data: data, isBinary: false) -// let result = dataChannel.sendData(buffer) -// -// if result { -// Logger.debug("sendDataChannelMessage succeeded: \(description)") -// } else { -// Logger.warn("sendDataChannelMessage failed: \(description)") -// if isCritical { -// OWSProdError(OWSAnalyticsEvents.peerConnectionClientErrorSendDataChannelMessageFailed(), file: #file, function: #function, line: #line) -// } -// } -// } -// } -// -// // MARK: RTCDataChannelDelegate -// -// /** The data channel state changed. */ -// internal func dataChannelDidChangeState(_ dataChannel: RTCDataChannel) { -// Logger.debug("dataChannelDidChangeState: \(dataChannel)") -// } -// -// /** The data channel successfully received a data buffer. */ -// internal func dataChannel(_ dataChannel: RTCDataChannel, didReceiveMessageWith buffer: RTCDataBuffer) { -// let proxyCopy = self.proxy -// let completion: (WebRTCProtoData) -> Void = { (dataChannelMessage) in -// AssertIsOnMainThread() -// guard let strongSelf = proxyCopy.get() else { return } -// guard let strongDelegate = strongSelf.delegate else { return } -// strongDelegate.peerConnectionClient(strongSelf, received: dataChannelMessage) -// } -// -// PeerConnectionClient.signalingQueue.async { -// guard let strongSelf = proxyCopy.get() else { return } -// guard strongSelf.peerConnection != nil else { -// Logger.debug("Ignoring obsolete event in terminated client") -// return -// } -// Logger.debug("dataChannel didReceiveMessageWith buffer:\(buffer)") -// -// var dataChannelMessage: WebRTCProtoData -// do { -// dataChannelMessage = try WebRTCProtoData.parseData(buffer.data) -// } catch { -// Logger.error("failed to parse dataProto") -// return -// } -// -// DispatchQueue.main.async { -// completion(dataChannelMessage) -// } -// } -// } -// -// /** The data channel's |bufferedAmount| changed. */ -// internal func dataChannel(_ dataChannel: RTCDataChannel, didChangeBufferedAmount amount: UInt64) { -// Logger.debug("didChangeBufferedAmount: \(amount)") -// } -// -// // MARK: - RTCPeerConnectionDelegate -// -// /** Called when the SignalingState changed. */ -// internal func peerConnection(_ peerConnectionParam: RTCPeerConnection, didChange stateChanged: RTCSignalingState) { -// Logger.debug("didChange signalingState:\(stateChanged.debugDescription)") -// } -// -// /** Called when media is received on a new stream from remote peer. */ -// internal func peerConnection(_ peerConnectionParam: RTCPeerConnection, didAdd stream: RTCMediaStream) { -// let proxyCopy = self.proxy -// let completion: (RTCVideoTrack) -> Void = { (remoteVideoTrack) in -// AssertIsOnMainThread() -// guard let strongSelf = proxyCopy.get() else { return } -// guard let strongDelegate = strongSelf.delegate else { return } -// -// // TODO: Consider checking for termination here. -// -// strongDelegate.peerConnectionClient(strongSelf, didUpdateRemoteVideoTrack: remoteVideoTrack) -// } -// -// PeerConnectionClient.signalingQueue.async { -// guard let strongSelf = proxyCopy.get() else { return } -// guard let peerConnection = strongSelf.peerConnection else { -// Logger.debug("Ignoring obsolete event in terminated client") -// return -// } -// guard peerConnection == peerConnectionParam else { -// owsFailDebug("mismatched peerConnection callback.") -// return -// } -// guard stream.videoTracks.count > 0 else { -// owsFailDebug("didAdd stream missing stream.") -// return -// } -// let remoteVideoTrack = stream.videoTracks[0] -// Logger.debug("didAdd stream:\(stream) video tracks: \(stream.videoTracks.count) audio tracks: \(stream.audioTracks.count)") -// -// strongSelf.remoteVideoTrack = remoteVideoTrack -// -// DispatchQueue.main.async { -// completion(remoteVideoTrack) -// } -// } -// } -// -// /** Called when a remote peer closes a stream. */ -// internal func peerConnection(_ peerConnectionParam: RTCPeerConnection, didRemove stream: RTCMediaStream) { -// Logger.debug("didRemove Stream:\(stream)") -// } -// -// /** Called when negotiation is needed, for example ICE has restarted. */ -// internal func peerConnectionShouldNegotiate(_ peerConnectionParam: RTCPeerConnection) { -// Logger.debug("shouldNegotiate") -// } -// -// /** Called any time the IceConnectionState changes. */ -// internal func peerConnection(_ peerConnectionParam: RTCPeerConnection, didChange newState: RTCIceConnectionState) { -// let proxyCopy = self.proxy -// let connectedCompletion : () -> Void = { -// AssertIsOnMainThread() -// guard let strongSelf = proxyCopy.get() else { return } -// guard let strongDelegate = strongSelf.delegate else { return } -// strongDelegate.peerConnectionClientIceConnected(strongSelf) -// } -// let failedCompletion : () -> Void = { -// AssertIsOnMainThread() -// guard let strongSelf = proxyCopy.get() else { return } -// guard let strongDelegate = strongSelf.delegate else { return } -// strongDelegate.peerConnectionClientIceFailed(strongSelf) -// } -// let disconnectedCompletion : () -> Void = { -// AssertIsOnMainThread() -// guard let strongSelf = proxyCopy.get() else { return } -// guard let strongDelegate = strongSelf.delegate else { return } -// strongDelegate.peerConnectionClientIceDisconnected(strongSelf) -// } -// -// PeerConnectionClient.signalingQueue.async { -// guard let strongSelf = proxyCopy.get() else { return } -// guard let peerConnection = strongSelf.peerConnection else { -// Logger.debug("Ignoring obsolete event in terminated client") -// return -// } -// guard peerConnection == peerConnectionParam else { -// owsFailDebug("mismatched peerConnection callback.") -// return -// } -// -// Logger.info("didChange IceConnectionState:\(newState.debugDescription)") -// switch newState { -// case .connected, .completed: -// DispatchQueue.main.async(execute: connectedCompletion) -// case .failed: -// Logger.warn("RTCIceConnection failed.") -// DispatchQueue.main.async(execute: failedCompletion) -// case .disconnected: -// Logger.warn("RTCIceConnection disconnected.") -// DispatchQueue.main.async(execute: disconnectedCompletion) -// default: -// Logger.debug("ignoring change IceConnectionState:\(newState.debugDescription)") -// } -// } -// } -// -// /** Called any time the IceGatheringState changes. */ -// internal func peerConnection(_ peerConnectionParam: RTCPeerConnection, didChange newState: RTCIceGatheringState) { -// Logger.info("didChange IceGatheringState:\(newState.debugDescription)") -// } -// -// /** New ice candidate has been found. */ -// internal func peerConnection(_ peerConnectionParam: RTCPeerConnection, didGenerate candidate: RTCIceCandidate) { -// let proxyCopy = self.proxy -// let completion: (RTCIceCandidate) -> Void = { (candidate) in -// AssertIsOnMainThread() -// guard let strongSelf = proxyCopy.get() else { return } -// guard let strongDelegate = strongSelf.delegate else { return } -// strongDelegate.peerConnectionClient(strongSelf, addedLocalIceCandidate: candidate) -// } -// -// PeerConnectionClient.signalingQueue.async { -// guard let strongSelf = proxyCopy.get() else { return } -// guard let peerConnection = strongSelf.peerConnection else { -// Logger.debug("Ignoring obsolete event in terminated client") -// return -// } -// guard peerConnection == peerConnectionParam else { -// owsFailDebug("mismatched peerConnection callback.") -// return -// } -// Logger.info("adding local ICE candidate:\(candidate.sdp)") -// DispatchQueue.main.async { -// completion(candidate) -// } -// } -// } -// -// /** Called when a group of local Ice candidates have been removed. */ -// internal func peerConnection(_ peerConnectionParam: RTCPeerConnection, didRemove candidates: [RTCIceCandidate]) { -// Logger.debug("didRemove IceCandidates:\(candidates)") -// } -// -// /** New data channel has been opened. */ -// internal func peerConnection(_ peerConnectionParam: RTCPeerConnection, didOpen dataChannel: RTCDataChannel) { -// let proxyCopy = self.proxy -// let completion: ([PendingDataChannelMessage]) -> Void = { (pendingMessages) in -// AssertIsOnMainThread() -// guard let strongSelf = proxyCopy.get() else { return } -// pendingMessages.forEach { message in -// strongSelf.sendDataChannelMessage(data: message.data, description: message.description, isCritical: message.isCritical) -// } -// } -// -// PeerConnectionClient.signalingQueue.async { -// guard let strongSelf = proxyCopy.get() else { return } -// guard let peerConnection = strongSelf.peerConnection else { -// Logger.debug("Ignoring obsolete event in terminated client") -// return -// } -// guard peerConnection == peerConnectionParam else { -// owsFailDebug("mismatched peerConnection callback.") -// return -// } -// Logger.info("didOpen dataChannel:\(dataChannel)") -// if strongSelf.dataChannel != nil { -// owsFailDebug("dataChannel unexpectedly set twice.") -// } -// strongSelf.dataChannel = dataChannel -// dataChannel.delegate = strongSelf.proxy -// -// let pendingMessages = strongSelf.pendingDataChannelMessages -// strongSelf.pendingDataChannelMessages = [] -// DispatchQueue.main.async { -// completion(pendingMessages) -// } -// } -// } -// -// internal func peerConnection(_ peerConnectionParam: RTCPeerConnection, didChange connectionState: RTCPeerConnectionState) { -// Logger.info("didChange PeerConnectionState:\(connectionState.debugDescription)") -// } -// -// // MARK: Helpers -// -// /** -// * We synchronize access to state in this class using this queue. -// */ -// private func assertOnSignalingQueue() { -// assertOnQueue(type(of: self).signalingQueue) -// } -// -// // MARK: Test-only accessors -// -// internal func peerConnectionForTests() -> RTCPeerConnection { -// AssertIsOnMainThread() -// -// var result: RTCPeerConnection? -// PeerConnectionClient.signalingQueue.sync { -// result = peerConnection -// Logger.info("") -// } -// return result! -// } -// -// internal func dataChannelForTests() -> RTCDataChannel { -// AssertIsOnMainThread() -// -// var result: RTCDataChannel? -// PeerConnectionClient.signalingQueue.sync { -// result = dataChannel -// Logger.info("") -// } -// return result! -// } -// -// internal func flushSignalingQueueForTests() { -// AssertIsOnMainThread() -// -// PeerConnectionClient.signalingQueue.sync { -// // Noop. -// } -// } -//} -// -///** -// * Restrict an RTCSessionDescription to more secure parameters -// */ -//class HardenedRTCSessionDescription { -// let rtcSessionDescription: RTCSessionDescription -// var sdp: String { return rtcSessionDescription.sdp } -// -// init(rtcSessionDescription: RTCSessionDescription) { -// self.rtcSessionDescription = HardenedRTCSessionDescription.harden(rtcSessionDescription: rtcSessionDescription) -// } -// -// /** -// * Set some more secure parameters for the session description -// */ -// class func harden(rtcSessionDescription: RTCSessionDescription) -> RTCSessionDescription { -// var description = rtcSessionDescription.sdp -// -// // Enforce Constant bit rate. -// let cbrRegex = try! NSRegularExpression(pattern: "(a=fmtp:111 ((?!cbr=).)*)\r?\n", options: .caseInsensitive) -// description = cbrRegex.stringByReplacingMatches(in: description, options: [], range: NSRange(location: 0, length: description.utf16.count), withTemplate: "$1;cbr=1\r\n") -// -// // Strip plaintext audio-level details -// // https://tools.ietf.org/html/rfc6464 -// let audioLevelRegex = try! NSRegularExpression(pattern: ".+urn:ietf:params:rtp-hdrext:ssrc-audio-level.*\r?\n", options: .caseInsensitive) -// description = audioLevelRegex.stringByReplacingMatches(in: description, options: [], range: NSRange(location: 0, length: description.utf16.count), withTemplate: "") -// -// return RTCSessionDescription.init(type: rtcSessionDescription.type, sdp: description) -// } -// -// var logSafeDescription: String { -// #if DEBUG -// return sdp -// #else -// return redactIPV6(sdp: redactIcePwd(sdp: sdp)) -// #endif -// } -// -// private func redactIcePwd(sdp: String) -> String { -// #if DEBUG -// return sdp -// #else -// var text = sdp -// text = text.replacingOccurrences(of: "\r", with: "\n") -// text = text.replacingOccurrences(of: "\n\n", with: "\n") -// let lines = text.components(separatedBy: "\n") -// let filteredLines: [String] = lines.map { line in -// guard !line.contains("ice-pwd") else { -// return "[ REDACTED ice-pwd ]" -// } -// return line -// } -// let filteredText = filteredLines.joined(separator: "\n") -// return filteredText -// #endif -// } -// -// private func redactIPV6(sdp: String) -> String { -// #if DEBUG -// return sdp -// #else -// -// // Example values to match: -// // -// // * 2001:0db8:85a3:0000:0000:8a2e:0370:7334 -// // * 2001:db8:85a3::8a2e:370:7334 -// // * ::1 -// // * :: -// // * ::ffff:192.0.2.128 -// // -// // See: https://en.wikipedia.org/wiki/IPv6_addresshttps://en.wikipedia.org/wiki/IPv6_address -// do { -// let regex = try NSRegularExpression(pattern: "[\\da-f]*:[\\da-f]*:[\\da-f:\\.]*", -// options: .caseInsensitive) -// return regex.stringByReplacingMatches(in: sdp, options: [], range: NSRange(location: 0, length: sdp.utf16.count), withTemplate: "[ REDACTED_IPV6_ADDRESS ]") -// } catch { -// owsFailDebug("Could not redact IPv6 addresses.") -// return "[Could not redact IPv6 addresses.]" -// } -// #endif -// } -//} -// -//protocol VideoCaptureSettingsDelegate: class { -// var videoWidth: Int32 { get } -// var videoHeight: Int32 { get } -//} -// -//class VideoCaptureController { -// -// private let capturer: RTCCameraVideoCapturer -// private weak var settingsDelegate: VideoCaptureSettingsDelegate? -// private let serialQueue = DispatchQueue(label: "org.signal.videoCaptureController") -// private var isUsingFrontCamera: Bool = true -// -// public var captureSession: AVCaptureSession { -// return capturer.captureSession -// } -// -// public init(capturer: RTCCameraVideoCapturer, settingsDelegate: VideoCaptureSettingsDelegate) { -// self.capturer = capturer -// self.settingsDelegate = settingsDelegate -// } -// -// public func startCapture() { -// serialQueue.sync { [weak self] in -// guard let strongSelf = self else { -// return -// } -// -// strongSelf.startCaptureSync() -// } -// } -// -// public func stopCapture() { -// serialQueue.sync { [weak self] in -// guard let strongSelf = self else { -// return -// } -// -// strongSelf.capturer.stopCapture() -// } -// } -// -// public func switchCamera(isUsingFrontCamera: Bool) { -// serialQueue.sync { [weak self] in -// guard let strongSelf = self else { -// return -// } -// -// strongSelf.isUsingFrontCamera = isUsingFrontCamera -// strongSelf.startCaptureSync() -// } -// } -// -// private func assertIsOnSerialQueue() { -// if _isDebugAssertConfiguration(), #available(iOS 10.0, *) { -// assertOnQueue(serialQueue) -// } -// } -// -// private func startCaptureSync() { -// assertIsOnSerialQueue() -// -// let position: AVCaptureDevice.Position = isUsingFrontCamera ? .front : .back -// guard let device: AVCaptureDevice = self.device(position: position) else { -// owsFailDebug("unable to find captureDevice") -// return -// } -// -// guard let format: AVCaptureDevice.Format = self.format(device: device) else { -// owsFailDebug("unable to find captureDevice") -// return -// } -// -// let fps = self.framesPerSecond(format: format) -// capturer.startCapture(with: device, format: format, fps: fps) -// } -// -// private func device(position: AVCaptureDevice.Position) -> AVCaptureDevice? { -// let captureDevices = RTCCameraVideoCapturer.captureDevices() -// guard let device = (captureDevices.first { $0.position == position }) else { -// Logger.debug("unable to find desired position: \(position)") -// return captureDevices.first -// } -// -// return device -// } -// -// private func format(device: AVCaptureDevice) -> AVCaptureDevice.Format? { -// let formats = RTCCameraVideoCapturer.supportedFormats(for: device) -// let targetWidth = settingsDelegate?.videoWidth ?? 0 -// let targetHeight = settingsDelegate?.videoHeight ?? 0 -// -// var selectedFormat: AVCaptureDevice.Format? -// var currentDiff: Int32 = Int32.max -// -// for format in formats { -// let dimension = CMVideoFormatDescriptionGetDimensions(format.formatDescription) -// let diff = abs(targetWidth - dimension.width) + abs(targetHeight - dimension.height) -// if diff < currentDiff { -// selectedFormat = format -// currentDiff = diff -// } -// } -// -// if _isDebugAssertConfiguration(), let selectedFormat = selectedFormat { -// let dimension = CMVideoFormatDescriptionGetDimensions(selectedFormat.formatDescription) -// Logger.debug("selected format width: \(dimension.width) height: \(dimension.height)") -// } -// -// assert(selectedFormat != nil) -// -// return selectedFormat -// } -// -// private func framesPerSecond(format: AVCaptureDevice.Format) -> Int { -// var maxFrameRate: Float64 = 0 -// for range in format.videoSupportedFrameRateRanges { -// maxFrameRate = max(maxFrameRate, range.maxFrameRate) -// } -// -// return Int(maxFrameRate) -// } -//} -// -//// MARK: Pretty Print Objc enums. -// -//fileprivate extension RTCSignalingState { -// var debugDescription: String { -// switch self { -// case .stable: -// return "stable" -// case .haveLocalOffer: -// return "haveLocalOffer" -// case .haveLocalPrAnswer: -// return "haveLocalPrAnswer" -// case .haveRemoteOffer: -// return "haveRemoteOffer" -// case .haveRemotePrAnswer: -// return "haveRemotePrAnswer" -// case .closed: -// return "closed" -// } -// } -//} -// -//fileprivate extension RTCIceGatheringState { -// var debugDescription: String { -// switch self { -// case .new: -// return "new" -// case .gathering: -// return "gathering" -// case .complete: -// return "complete" -// } -// } -//} -// -//fileprivate extension RTCIceConnectionState { -// var debugDescription: String { -// switch self { -// case .new: -// return "new" -// case .checking: -// return "checking" -// case .connected: -// return "connected" -// case .completed: -// return "completed" -// case .failed: -// return "failed" -// case .disconnected: -// return "disconnected" -// case .closed: -// return "closed" -// case .count: -// return "count" -// } -// } -//} -// -//fileprivate extension RTCPeerConnectionState { -// var debugDescription: String { -// switch self { -// case .new: -// return "new" -// case .connecting: -// return "connecting" -// case .connected: -// return "connected" -// case .disconnected: -// return "disconnected" -// case .failed: -// return "failed" -// case .closed: -// return "closed" -// } -// } -//} diff --git a/Session/Signal/PrivacySettingsTableViewController.m b/Session/Signal/PrivacySettingsTableViewController.m index 038ff6c60..f3ad86240 100644 --- a/Session/Signal/PrivacySettingsTableViewController.m +++ b/Session/Signal/PrivacySettingsTableViewController.m @@ -269,9 +269,6 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s { OWSLogInfo(@"user toggled call kit preference: %@", (sender.isOn ? @"ON" : @"OFF")); [self.preferences setIsSystemCallLogEnabled:sender.isOn]; - - // rebuild callUIAdapter since CallKit configuration changed. -// [AppEnvironment.shared.callService createCallUIAdapter]; } - (void)didToggleEnableCallKitSwitch:(UISwitch *)sender @@ -279,9 +276,6 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s OWSLogInfo(@"user toggled call kit preference: %@", (sender.isOn ? @"ON" : @"OFF")); [self.preferences setIsCallKitEnabled:sender.isOn]; - // rebuild callUIAdapter since CallKit vs not changed. -// [AppEnvironment.shared.callService createCallUIAdapter]; - // Show/Hide dependent switch: CallKit privacy [self updateTableContents]; } diff --git a/Session/Signal/UserNotificationsAdaptee.swift b/Session/Signal/UserNotificationsAdaptee.swift index e5b9b7409..df1d622a1 100644 --- a/Session/Signal/UserNotificationsAdaptee.swift +++ b/Session/Signal/UserNotificationsAdaptee.swift @@ -27,18 +27,6 @@ class UserNotificationConfig { class func notificationAction(_ action: AppNotificationAction) -> UNNotificationAction { switch action { -// case .answerCall: -// return UNNotificationAction(identifier: action.identifier, -// title: CallStrings.answerCallButtonTitle, -// options: [.foreground]) -// case .callBack: -// return UNNotificationAction(identifier: action.identifier, -// title: CallStrings.callBackButtonTitle, -// options: [.foreground]) -// case .declineCall: -// return UNNotificationAction(identifier: action.identifier, -// title: CallStrings.declineCallButtonTitle, -// options: []) case .markAsRead: return UNNotificationAction(identifier: action.identifier, title: MessageStrings.markAsReadNotificationAction, @@ -255,12 +243,6 @@ public class UserNotificationActionHandler: NSObject { } switch action { -// case .answerCall: -// return try actionHandler.answerCall(userInfo: userInfo) -// case .callBack: -// return try actionHandler.callBack(userInfo: userInfo) -// case .declineCall: -// return try actionHandler.declineCall(userInfo: userInfo) case .markAsRead: return try actionHandler.markAsRead(userInfo: userInfo) case .reply: diff --git a/Signal.xcodeproj/project.pbxproj b/Signal.xcodeproj/project.pbxproj index f23f06892..b52c4960e 100644 --- a/Signal.xcodeproj/project.pbxproj +++ b/Signal.xcodeproj/project.pbxproj @@ -18,7 +18,6 @@ 340FC8B5204DAC8D007AEB0F /* AboutTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 340FC893204DAC8C007AEB0F /* AboutTableViewController.m */; }; 340FC8B6204DAC8D007AEB0F /* OWSQRCodeScanningViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 340FC896204DAC8C007AEB0F /* OWSQRCodeScanningViewController.m */; }; 340FC8B7204DAC8D007AEB0F /* OWSConversationSettingsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 340FC89A204DAC8D007AEB0F /* OWSConversationSettingsViewController.m */; }; - 340FC8B8204DAC8D007AEB0F /* AddToGroupViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 340FC89B204DAC8D007AEB0F /* AddToGroupViewController.m */; }; 34129B8621EF877A005457A8 /* LinkPreviewView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34129B8521EF8779005457A8 /* LinkPreviewView.swift */; }; 341341EF2187467A00192D59 /* ConversationViewModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 341341EE2187467900192D59 /* ConversationViewModel.m */; }; 34277A5E20751BDC006049F2 /* OWSQuotedMessageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 34277A5C20751BDC006049F2 /* OWSQuotedMessageView.m */; }; @@ -33,7 +32,6 @@ 3441FD9F21A3604F00BB9542 /* BackupRestoreViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3441FD9E21A3604F00BB9542 /* BackupRestoreViewController.swift */; }; 34480B361FD0929200BC14EF /* ShareAppExtensionContext.m in Sources */ = {isa = PBXBuildFile; fileRef = 34480B351FD0929200BC14EF /* ShareAppExtensionContext.m */; }; 344825C6211390C800DB4BD8 /* OWSOrphanDataCleaner.m in Sources */ = {isa = PBXBuildFile; fileRef = 344825C5211390C800DB4BD8 /* OWSOrphanDataCleaner.m */; }; - 3448E1662215B313004B052E /* OnboardingCaptchaViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3448E1652215B313004B052E /* OnboardingCaptchaViewController.swift */; }; 3461284B1FD0B94000532771 /* SAELoadViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3461284A1FD0B93F00532771 /* SAELoadViewController.swift */; }; 3461293E1FD1D72B00532771 /* ExperienceUpgradeFinder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3461293D1FD1D72B00532771 /* ExperienceUpgradeFinder.swift */; }; 346129991FD1E4DA00532771 /* SignalApp.m in Sources */ = {isa = PBXBuildFile; fileRef = 346129971FD1E4D900532771 /* SignalApp.m */; }; @@ -66,7 +64,6 @@ 34ABC0E421DD20C500ED9469 /* ConversationMessageMapping.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34ABC0E321DD20C500ED9469 /* ConversationMessageMapping.swift */; }; 34AC0A23211C829F00997B47 /* OWSLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 34AC0A21211C829E00997B47 /* OWSLabel.m */; }; 34B0796D1FCF46B100E248C2 /* MainAppContext.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B0796B1FCF46B000E248C2 /* MainAppContext.m */; }; - 34B3F8751E8DF1700035BE1A /* CallViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F83B1E8DF1700035BE1A /* CallViewController.swift */; }; 34B6A903218B3F63007C4606 /* TypingIndicatorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34B6A902218B3F62007C4606 /* TypingIndicatorView.swift */; }; 34B6A905218B4C91007C4606 /* TypingIndicatorInteraction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34B6A904218B4C90007C4606 /* TypingIndicatorInteraction.swift */; }; 34B6A907218B5241007C4606 /* TypingIndicatorCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34B6A906218B5240007C4606 /* TypingIndicatorCell.swift */; }; @@ -128,7 +125,6 @@ 455A16DE1F1FEA0000F86704 /* MetalKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 455A16DC1F1FEA0000F86704 /* MetalKit.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 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 */; }; 458E38371D668EBF0094BD24 /* OWSDeviceProvisioningURLParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 458E38361D668EBF0094BD24 /* OWSDeviceProvisioningURLParser.m */; }; 45A2F005204473A3002E978A /* NewMessage.aifc in Resources */ = {isa = PBXBuildFile; fileRef = 45A2F004204473A3002E978A /* NewMessage.aifc */; }; 45A663C51F92EC760027B59E /* GroupTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45A663C41F92EC760027B59E /* GroupTableViewCell.swift */; }; @@ -165,7 +161,6 @@ 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 */; }; 45F32C222057297A00A300D5 /* MediaDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 45B9EE9B200E91FB005D2F2D /* MediaDetailViewController.m */; }; 45F32C232057297A00A300D5 /* MediaPageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45F32C1D205718B000A300D5 /* MediaPageViewController.swift */; }; @@ -191,7 +186,6 @@ 4CC1ECFB211A553000CC13BE /* AppUpdateNag.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CC1ECFA211A553000CC13BE /* AppUpdateNag.swift */; }; 4CC613362227A00400E21A3A /* ConversationSearch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CC613352227A00400E21A3A /* ConversationSearch.swift */; }; 4CEB78C92178EBAB00F315D2 /* OWSSessionResetJobRecord.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CEB78C82178EBAB00F315D2 /* OWSSessionResetJobRecord.m */; }; - 4CFD151D22415AA400F2450F /* CallVideoHintView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CFD151C22415AA400F2450F /* CallVideoHintView.swift */; }; 4CFE6B6C21F92BA700006701 /* LegacyNotificationsAdaptee.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CFE6B6B21F92BA700006701 /* LegacyNotificationsAdaptee.swift */; }; 5DF9AB212C6DB1E8BE70EFF6 /* Pods_SessionMessagingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FB523C549815DE935E98151E /* Pods_SessionMessagingKit.framework */; }; 70377AAB1918450100CAF501 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 70377AAA1918450100CAF501 /* MobileCoreServices.framework */; }; @@ -347,7 +341,6 @@ C33FDC46255A581F00E217F9 /* PublicChatPoller.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDA8C255A57FD00E217F9 /* PublicChatPoller.swift */; }; C33FDC48255A581F00E217F9 /* OWSFileSystem.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDA8E255A57FD00E217F9 /* OWSFileSystem.m */; }; C33FDC4A255A582000E217F9 /* TSYapDatabaseObject.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDA90255A57FD00E217F9 /* TSYapDatabaseObject.m */; }; - C33FDC4E255A582000E217F9 /* Data+Streaming.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDA94255A57FE00E217F9 /* Data+Streaming.swift */; }; C33FDC4F255A582000E217F9 /* OWSChunkedOutputStream.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDA95255A57FE00E217F9 /* OWSChunkedOutputStream.h */; settings = {ATTRIBUTES = (Public, ); }; }; C33FDC50255A582000E217F9 /* OWSDispatch.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDA96255A57FE00E217F9 /* OWSDispatch.h */; settings = {ATTRIBUTES = (Public, ); }; }; C33FDC51255A582000E217F9 /* TSIncomingMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDA97255A57FE00E217F9 /* TSIncomingMessage.m */; }; @@ -361,7 +354,6 @@ C33FDC62255A582000E217F9 /* BuildConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDAA8255A57FF00E217F9 /* BuildConfiguration.swift */; }; C33FDC64255A582000E217F9 /* NSObject+Casting.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDAAA255A580000E217F9 /* NSObject+Casting.m */; }; C33FDC69255A582000E217F9 /* String+Trimming.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDAAF255A580000E217F9 /* String+Trimming.swift */; }; - C33FDC6A255A582000E217F9 /* ProvisioningProto.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDAB0255A580000E217F9 /* ProvisioningProto.swift */; }; C33FDC6B255A582000E217F9 /* OWSStorage.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDAB1255A580000E217F9 /* OWSStorage.m */; }; C33FDC6D255A582000E217F9 /* TSContactThread.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDAB3255A580000E217F9 /* TSContactThread.h */; settings = {ATTRIBUTES = (Public, ); }; }; C33FDC71255A582000E217F9 /* OWSFailedMessagesJob.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDAB7255A580100E217F9 /* OWSFailedMessagesJob.m */; }; @@ -427,12 +419,9 @@ 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, ); }; }; C33FDCE3255A582000E217F9 /* NSData+Image.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDB29255A580A00E217F9 /* NSData+Image.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, ); }; }; C33FDCEB255A582000E217F9 /* SSKEnvironment.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDB31255A580A00E217F9 /* SSKEnvironment.h */; settings = {ATTRIBUTES = (Public, ); }; }; C33FDCEC255A582000E217F9 /* SSKIncrementingIdFinder.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDB32255A580A00E217F9 /* SSKIncrementingIdFinder.swift */; }; - C33FDCED255A582000E217F9 /* Provisioning.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDB33255A580B00E217F9 /* Provisioning.pb.swift */; }; C33FDCEE255A582000E217F9 /* ClosedGroupPoller.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDB34255A580B00E217F9 /* ClosedGroupPoller.swift */; }; C33FDCF0255A582000E217F9 /* Storage.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDB36255A580B00E217F9 /* Storage.swift */; }; C33FDCF1255A582000E217F9 /* Storage+SnodeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDB37255A580B00E217F9 /* Storage+SnodeAPI.swift */; }; @@ -467,17 +456,14 @@ C33FDD17255A582000E217F9 /* TSErrorMessage_privateConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDB5D255A580E00E217F9 /* TSErrorMessage_privateConstructor.h */; settings = {ATTRIBUTES = (Public, ); }; }; C33FDD19255A582000E217F9 /* YapDatabaseConnection+OWS.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDB5F255A580E00E217F9 /* YapDatabaseConnection+OWS.h */; settings = {ATTRIBUTES = (Public, ); }; }; C33FDD1A255A582000E217F9 /* TSMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDB60255A580E00E217F9 /* TSMessage.m */; }; - C33FDD1C255A582000E217F9 /* OWSProvisioningCipher.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDB62255A580E00E217F9 /* OWSProvisioningCipher.h */; settings = {ATTRIBUTES = (Public, ); }; }; C33FDD1E255A582000E217F9 /* PreKeyRefreshOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDB64255A580E00E217F9 /* PreKeyRefreshOperation.swift */; }; C33FDD21255A582000E217F9 /* OWSMediaGalleryFinder.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDB67255A580F00E217F9 /* OWSMediaGalleryFinder.h */; settings = {ATTRIBUTES = (Public, ); }; }; C33FDD22255A582000E217F9 /* ContentProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDB68255A580F00E217F9 /* ContentProxy.swift */; }; C33FDD23255A582000E217F9 /* FeatureFlags.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDB69255A580F00E217F9 /* FeatureFlags.swift */; }; - C33FDD24255A582000E217F9 /* SignalMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDB6A255A580F00E217F9 /* SignalMessage.swift */; }; C33FDD25255A582000E217F9 /* LKUserDefaults.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDB6B255A580F00E217F9 /* LKUserDefaults.swift */; }; C33FDD26255A582000E217F9 /* NSNotificationCenter+OWS.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDB6C255A580F00E217F9 /* NSNotificationCenter+OWS.m */; }; C33FDD27255A582000E217F9 /* TSPreKeyManager.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDB6D255A580F00E217F9 /* TSPreKeyManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; C33FDD29255A582000E217F9 /* OWSOutgoingReceiptManager.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDB6F255A580F00E217F9 /* OWSOutgoingReceiptManager.m */; }; - C33FDD2A255A582000E217F9 /* OWSMessageServiceParams.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDB70255A580F00E217F9 /* OWSMessageServiceParams.m */; }; C33FDD2B255A582000E217F9 /* OWSMediaGalleryFinder.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDB71255A581000E217F9 /* OWSMediaGalleryFinder.m */; }; C33FDD2D255A582000E217F9 /* TSGroupModel.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDB73255A581000E217F9 /* TSGroupModel.m */; }; C33FDD2E255A582000E217F9 /* TSInvalidIdentityKeyErrorMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDB74255A581000E217F9 /* TSInvalidIdentityKeyErrorMessage.m */; }; @@ -508,7 +494,6 @@ C33FDD5B255A582000E217F9 /* OWSOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDBA1255A581400E217F9 /* OWSOperation.h */; settings = {ATTRIBUTES = (Public, ); }; }; C33FDD5D255A582000E217F9 /* SessionManagementProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDBA3255A581400E217F9 /* SessionManagementProtocol.swift */; }; C33FDD5E255A582000E217F9 /* OWSDisappearingMessagesConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDBA4255A581400E217F9 /* OWSDisappearingMessagesConfiguration.m */; }; - C33FDD5F255A582000E217F9 /* SignalServiceProfile.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDBA5255A581400E217F9 /* SignalServiceProfile.swift */; }; C33FDD60255A582000E217F9 /* TSInvalidIdentityKeySendingErrorMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDBA6255A581400E217F9 /* TSInvalidIdentityKeySendingErrorMessage.h */; settings = {ATTRIBUTES = (Public, ); }; }; C33FDD62255A582000E217F9 /* OWSLinkPreview.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDBA8255A581500E217F9 /* OWSLinkPreview.swift */; }; C33FDD63255A582000E217F9 /* OWSIdentityManager.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDBA9255A581500E217F9 /* OWSIdentityManager.m */; }; @@ -530,7 +515,6 @@ C33FDD83255A582000E217F9 /* CreatePreKeysOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDBC9255A581700E217F9 /* CreatePreKeysOperation.swift */; }; C33FDD84255A582000E217F9 /* LKGroupUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDBCA255A581700E217F9 /* LKGroupUtilities.h */; settings = {ATTRIBUTES = (Public, ); }; }; C33FDD85255A582000E217F9 /* TSInvalidIdentityKeyReceivingErrorMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDBCB255A581800E217F9 /* TSInvalidIdentityKeyReceivingErrorMessage.m */; }; - C33FDD88255A582000E217F9 /* OWSMessageServiceParams.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDBCE255A581800E217F9 /* OWSMessageServiceParams.h */; settings = {ATTRIBUTES = (Public, ); }; }; C33FDD8D255A582000E217F9 /* OWSSignalAddress.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDBD3255A581800E217F9 /* OWSSignalAddress.swift */; }; 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 */; }; @@ -556,7 +540,6 @@ C33FDDBF255A582000E217F9 /* OWSDisappearingMessagesFinder.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDC05255A581D00E217F9 /* OWSDisappearingMessagesFinder.h */; settings = {ATTRIBUTES = (Public, ); }; }; C33FDDC0255A582000E217F9 /* SignalAccount.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDC06255A581D00E217F9 /* SignalAccount.m */; }; C33FDDC1255A582000E217F9 /* Storage+ClosedGroups.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDC07255A581D00E217F9 /* Storage+ClosedGroups.swift */; }; - C33FDDC2255A582000E217F9 /* SignalService.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDC08255A581D00E217F9 /* SignalService.pb.swift */; }; C33FDDC5255A582000E217F9 /* OWSError.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDC0B255A581D00E217F9 /* OWSError.m */; }; C33FDDC6255A582000E217F9 /* TSInfoMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDC0C255A581E00E217F9 /* TSInfoMessage.m */; }; C33FDDCC255A582000E217F9 /* TSConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDC12255A581E00E217F9 /* TSConstants.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -923,7 +906,7 @@ C3CA3B2F255CF84E00F4C6D4 /* NullMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3CA3B2E255CF84E00F4C6D4 /* NullMessage.swift */; }; C3D0972B2510499C00F6E3E4 /* BackgroundPoller.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3D0972A2510499C00F6E3E4 /* BackgroundPoller.swift */; }; C3D697382564DCE6004AF766 /* MessageHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3D697372564DCE6004AF766 /* MessageHandler.swift */; }; - C3D6974A2564DEDC004AF766 /* MessageHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3D697492564DEDC004AF766 /* MessageHandler.swift */; }; + C3D6974A2564DEDC004AF766 /* MessageReceiverDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3D697492564DEDC004AF766 /* MessageReceiverDelegate.swift */; }; C3DAB3242480CB2B00725F25 /* SRCopyableLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3DAB3232480CB2A00725F25 /* SRCopyableLabel.swift */; }; C3DFFAC623E96F0D0058DAF8 /* Sheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3DFFAC523E96F0D0058DAF8 /* Sheet.swift */; }; C3E5C2FA251DBABB0040DFFC /* EditClosedGroupVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3E5C2F9251DBABB0040DFFC /* EditClosedGroupVC.swift */; }; @@ -1071,9 +1054,7 @@ 340FC896204DAC8C007AEB0F /* OWSQRCodeScanningViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSQRCodeScanningViewController.m; sourceTree = ""; }; 340FC899204DAC8D007AEB0F /* OWSConversationSettingsViewDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSConversationSettingsViewDelegate.h; sourceTree = ""; }; 340FC89A204DAC8D007AEB0F /* OWSConversationSettingsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSConversationSettingsViewController.m; sourceTree = ""; }; - 340FC89B204DAC8D007AEB0F /* AddToGroupViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AddToGroupViewController.m; sourceTree = ""; }; 340FC8A0204DAC8D007AEB0F /* OWSConversationSettingsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSConversationSettingsViewController.h; sourceTree = ""; }; - 340FC8A4204DAC8D007AEB0F /* AddToGroupViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddToGroupViewController.h; sourceTree = ""; }; 34129B8521EF8779005457A8 /* LinkPreviewView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LinkPreviewView.swift; sourceTree = ""; }; 341341ED2187467900192D59 /* ConversationViewModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConversationViewModel.h; sourceTree = ""; }; 341341EE2187467900192D59 /* ConversationViewModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ConversationViewModel.m; sourceTree = ""; }; @@ -1097,7 +1078,6 @@ 34480B381FD092E300BC14EF /* SignalShareExtension-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "SignalShareExtension-Prefix.pch"; sourceTree = ""; }; 344825C4211390C700DB4BD8 /* OWSOrphanDataCleaner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSOrphanDataCleaner.h; sourceTree = ""; }; 344825C5211390C800DB4BD8 /* OWSOrphanDataCleaner.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSOrphanDataCleaner.m; sourceTree = ""; }; - 3448E1652215B313004B052E /* OnboardingCaptchaViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OnboardingCaptchaViewController.swift; sourceTree = ""; }; 3461284A1FD0B93F00532771 /* SAELoadViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SAELoadViewController.swift; sourceTree = ""; }; 3461293D1FD1D72B00532771 /* ExperienceUpgradeFinder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ExperienceUpgradeFinder.swift; sourceTree = ""; }; 346129971FD1E4D900532771 /* SignalApp.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SignalApp.m; sourceTree = ""; }; @@ -1137,7 +1117,6 @@ 34B0796B1FCF46B000E248C2 /* MainAppContext.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainAppContext.m; sourceTree = ""; }; 34B0796C1FCF46B000E248C2 /* MainAppContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainAppContext.h; sourceTree = ""; }; 34B0796E1FD07B1E00E248C2 /* SignalShareExtension.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = SignalShareExtension.entitlements; sourceTree = ""; }; - 34B3F83B1E8DF1700035BE1A /* CallViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CallViewController.swift; sourceTree = ""; }; 34B6A902218B3F62007C4606 /* TypingIndicatorView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TypingIndicatorView.swift; sourceTree = ""; }; 34B6A904218B4C90007C4606 /* TypingIndicatorInteraction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TypingIndicatorInteraction.swift; sourceTree = ""; }; 34B6A906218B5240007C4606 /* TypingIndicatorCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TypingIndicatorCell.swift; sourceTree = ""; }; @@ -1222,7 +1201,6 @@ 455A16DC1F1FEA0000F86704 /* MetalKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MetalKit.framework; path = System/Library/Frameworks/MetalKit.framework; sourceTree = SDKROOT; }; 457F671A20746193000EABCD /* QuotedReplyPreview.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuotedReplyPreview.swift; sourceTree = ""; }; 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 = ""; }; 458E38351D668EBF0094BD24 /* OWSDeviceProvisioningURLParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSDeviceProvisioningURLParser.h; sourceTree = ""; }; 458E38361D668EBF0094BD24 /* OWSDeviceProvisioningURLParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSDeviceProvisioningURLParser.m; sourceTree = ""; }; 45A2F004204473A3002E978A /* NewMessage.aifc */ = {isa = PBXFileReference; lastKnownFileType = file; name = NewMessage.aifc; path = Session/Meta/AudioFiles/NewMessage.aifc; sourceTree = SOURCE_ROOT; }; @@ -1263,7 +1241,6 @@ 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 = ""; }; 45D231761DC7E8F10034FA89 /* SessionResetJob.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SessionResetJob.swift; sourceTree = ""; }; - 45DF5DF11DDB843F00C936C7 /* CompareSafetyNumbersActivity.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CompareSafetyNumbersActivity.swift; sourceTree = ""; }; 45E5A6981F61E6DD001E4A8A /* MarqueeLabel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MarqueeLabel.swift; sourceTree = ""; }; 45F32C1D205718B000A300D5 /* MediaPageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = MediaPageViewController.swift; path = Session/Signal/MediaPageViewController.swift; sourceTree = SOURCE_ROOT; }; 4C043929220A9EC800BAEA63 /* VoiceNoteLock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VoiceNoteLock.swift; sourceTree = ""; }; @@ -1289,7 +1266,6 @@ 4CC613352227A00400E21A3A /* ConversationSearch.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConversationSearch.swift; sourceTree = ""; }; 4CEB78C72178EBAB00F315D2 /* OWSSessionResetJobRecord.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OWSSessionResetJobRecord.h; sourceTree = ""; }; 4CEB78C82178EBAB00F315D2 /* OWSSessionResetJobRecord.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OWSSessionResetJobRecord.m; sourceTree = ""; }; - 4CFD151C22415AA400F2450F /* CallVideoHintView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CallVideoHintView.swift; sourceTree = ""; }; 4CFE6B6B21F92BA700006701 /* LegacyNotificationsAdaptee.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LegacyNotificationsAdaptee.swift; sourceTree = ""; }; 4CFF4C0920F55BBA005DA313 /* MenuActionsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MenuActionsViewController.swift; sourceTree = ""; }; 53D547348A367C8A14D37FC0 /* Pods_SignalUtilitiesKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SignalUtilitiesKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -1466,7 +1442,6 @@ C33FDA8C255A57FD00E217F9 /* PublicChatPoller.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PublicChatPoller.swift; sourceTree = ""; }; C33FDA8E255A57FD00E217F9 /* OWSFileSystem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSFileSystem.m; sourceTree = ""; }; C33FDA90255A57FD00E217F9 /* TSYapDatabaseObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSYapDatabaseObject.m; sourceTree = ""; }; - C33FDA94255A57FE00E217F9 /* Data+Streaming.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Data+Streaming.swift"; sourceTree = ""; }; C33FDA95255A57FE00E217F9 /* OWSChunkedOutputStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSChunkedOutputStream.h; sourceTree = ""; }; C33FDA96255A57FE00E217F9 /* OWSDispatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSDispatch.h; sourceTree = ""; }; C33FDA97255A57FE00E217F9 /* TSIncomingMessage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSIncomingMessage.m; sourceTree = ""; }; @@ -1480,7 +1455,6 @@ C33FDAA8255A57FF00E217F9 /* BuildConfiguration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BuildConfiguration.swift; sourceTree = ""; }; C33FDAAA255A580000E217F9 /* NSObject+Casting.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+Casting.m"; sourceTree = ""; }; C33FDAAF255A580000E217F9 /* String+Trimming.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+Trimming.swift"; sourceTree = ""; }; - C33FDAB0255A580000E217F9 /* ProvisioningProto.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProvisioningProto.swift; sourceTree = ""; }; C33FDAB1255A580000E217F9 /* OWSStorage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSStorage.m; sourceTree = ""; }; C33FDAB3255A580000E217F9 /* TSContactThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSContactThread.h; sourceTree = ""; }; C33FDAB7255A580100E217F9 /* OWSFailedMessagesJob.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSFailedMessagesJob.m; sourceTree = ""; }; @@ -1546,12 +1520,9 @@ C33FDB22255A580900E217F9 /* OWSMediaUtils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OWSMediaUtils.swift; sourceTree = ""; }; C33FDB25255A580900E217F9 /* TSDatabaseSecondaryIndexes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSDatabaseSecondaryIndexes.h; sourceTree = ""; }; C33FDB29255A580A00E217F9 /* NSData+Image.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData+Image.h"; sourceTree = ""; }; - C33FDB2B255A580A00E217F9 /* OWSProvisioningCipher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSProvisioningCipher.m; sourceTree = ""; }; C33FDB2C255A580A00E217F9 /* TSDatabaseView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSDatabaseView.h; sourceTree = ""; }; - C33FDB2F255A580A00E217F9 /* ContactsManagerProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContactsManagerProtocol.h; sourceTree = ""; }; C33FDB31255A580A00E217F9 /* SSKEnvironment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSKEnvironment.h; sourceTree = ""; }; C33FDB32255A580A00E217F9 /* SSKIncrementingIdFinder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SSKIncrementingIdFinder.swift; sourceTree = ""; }; - C33FDB33255A580B00E217F9 /* Provisioning.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Provisioning.pb.swift; sourceTree = ""; }; C33FDB34255A580B00E217F9 /* ClosedGroupPoller.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ClosedGroupPoller.swift; sourceTree = ""; }; C33FDB36255A580B00E217F9 /* Storage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Storage.swift; sourceTree = ""; }; C33FDB37255A580B00E217F9 /* Storage+SnodeAPI.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Storage+SnodeAPI.swift"; sourceTree = ""; }; @@ -1586,17 +1557,14 @@ C33FDB5D255A580E00E217F9 /* TSErrorMessage_privateConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSErrorMessage_privateConstructor.h; sourceTree = ""; }; C33FDB5F255A580E00E217F9 /* YapDatabaseConnection+OWS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "YapDatabaseConnection+OWS.h"; sourceTree = ""; }; C33FDB60255A580E00E217F9 /* TSMessage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSMessage.m; sourceTree = ""; }; - C33FDB62255A580E00E217F9 /* OWSProvisioningCipher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSProvisioningCipher.h; sourceTree = ""; }; C33FDB64255A580E00E217F9 /* PreKeyRefreshOperation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PreKeyRefreshOperation.swift; sourceTree = ""; }; C33FDB67255A580F00E217F9 /* OWSMediaGalleryFinder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSMediaGalleryFinder.h; sourceTree = ""; }; C33FDB68255A580F00E217F9 /* ContentProxy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContentProxy.swift; sourceTree = ""; }; C33FDB69255A580F00E217F9 /* FeatureFlags.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FeatureFlags.swift; sourceTree = ""; }; - C33FDB6A255A580F00E217F9 /* SignalMessage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SignalMessage.swift; sourceTree = ""; }; C33FDB6B255A580F00E217F9 /* LKUserDefaults.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LKUserDefaults.swift; sourceTree = ""; }; C33FDB6C255A580F00E217F9 /* NSNotificationCenter+OWS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSNotificationCenter+OWS.m"; sourceTree = ""; }; C33FDB6D255A580F00E217F9 /* TSPreKeyManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSPreKeyManager.h; sourceTree = ""; }; C33FDB6F255A580F00E217F9 /* OWSOutgoingReceiptManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSOutgoingReceiptManager.m; sourceTree = ""; }; - C33FDB70255A580F00E217F9 /* OWSMessageServiceParams.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSMessageServiceParams.m; sourceTree = ""; }; C33FDB71255A581000E217F9 /* OWSMediaGalleryFinder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSMediaGalleryFinder.m; sourceTree = ""; }; C33FDB73255A581000E217F9 /* TSGroupModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSGroupModel.m; sourceTree = ""; }; C33FDB74255A581000E217F9 /* TSInvalidIdentityKeyErrorMessage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSInvalidIdentityKeyErrorMessage.m; sourceTree = ""; }; @@ -1627,7 +1595,6 @@ C33FDBA1255A581400E217F9 /* OWSOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSOperation.h; sourceTree = ""; }; C33FDBA3255A581400E217F9 /* SessionManagementProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SessionManagementProtocol.swift; sourceTree = ""; }; C33FDBA4255A581400E217F9 /* OWSDisappearingMessagesConfiguration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSDisappearingMessagesConfiguration.m; sourceTree = ""; }; - C33FDBA5255A581400E217F9 /* SignalServiceProfile.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SignalServiceProfile.swift; sourceTree = ""; }; C33FDBA6255A581400E217F9 /* TSInvalidIdentityKeySendingErrorMessage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSInvalidIdentityKeySendingErrorMessage.h; sourceTree = ""; }; C33FDBA8255A581500E217F9 /* OWSLinkPreview.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OWSLinkPreview.swift; sourceTree = ""; }; C33FDBA9255A581500E217F9 /* OWSIdentityManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSIdentityManager.m; sourceTree = ""; }; @@ -1649,7 +1616,6 @@ C33FDBC9255A581700E217F9 /* CreatePreKeysOperation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CreatePreKeysOperation.swift; sourceTree = ""; }; C33FDBCA255A581700E217F9 /* LKGroupUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LKGroupUtilities.h; sourceTree = ""; }; C33FDBCB255A581800E217F9 /* TSInvalidIdentityKeyReceivingErrorMessage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSInvalidIdentityKeyReceivingErrorMessage.m; sourceTree = ""; }; - C33FDBCE255A581800E217F9 /* OWSMessageServiceParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSMessageServiceParams.h; sourceTree = ""; }; C33FDBD3255A581800E217F9 /* OWSSignalAddress.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OWSSignalAddress.swift; sourceTree = ""; }; C33FDBD6255A581900E217F9 /* OWSUploadOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSUploadOperation.h; sourceTree = ""; }; C33FDBD7255A581900E217F9 /* OWSMessageUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSMessageUtils.m; sourceTree = ""; }; @@ -1675,7 +1641,6 @@ C33FDC05255A581D00E217F9 /* OWSDisappearingMessagesFinder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSDisappearingMessagesFinder.h; sourceTree = ""; }; C33FDC06255A581D00E217F9 /* SignalAccount.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SignalAccount.m; sourceTree = ""; }; C33FDC07255A581D00E217F9 /* Storage+ClosedGroups.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Storage+ClosedGroups.swift"; sourceTree = ""; }; - C33FDC08255A581D00E217F9 /* SignalService.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SignalService.pb.swift; sourceTree = ""; }; C33FDC0B255A581D00E217F9 /* OWSError.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSError.m; sourceTree = ""; }; C33FDC0C255A581E00E217F9 /* TSInfoMessage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSInfoMessage.m; sourceTree = ""; }; C33FDC12255A581E00E217F9 /* TSConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSConstants.h; sourceTree = ""; }; @@ -1747,10 +1712,10 @@ C38EF270255B6D79007E1867 /* OWSDatabaseMigration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OWSDatabaseMigration.m; path = SignalUtilitiesKit/Database/OWSDatabaseMigration.m; sourceTree = SOURCE_ROOT; }; C38EF271255B6D79007E1867 /* OWSDatabaseMigration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OWSDatabaseMigration.h; path = SignalUtilitiesKit/Database/OWSDatabaseMigration.h; sourceTree = SOURCE_ROOT; }; C38EF281255B6D84007E1867 /* OWSAudioSession.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = OWSAudioSession.swift; path = SignalUtilitiesKit/Utilities/OWSAudioSession.swift; sourceTree = SOURCE_ROOT; }; - C38EF282255B6D84007E1867 /* SignalKeyingStorage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SignalKeyingStorage.m; path = SignalUtilitiesKit/SignalKeyingStorage.m; sourceTree = SOURCE_ROOT; }; + C38EF282255B6D84007E1867 /* SignalKeyingStorage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SignalKeyingStorage.m; path = SignalUtilitiesKit/Database/SignalKeyingStorage.m; sourceTree = SOURCE_ROOT; }; C38EF283255B6D84007E1867 /* VersionMigrations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VersionMigrations.h; path = SignalUtilitiesKit/VersionMigrations.h; sourceTree = SOURCE_ROOT; }; C38EF284255B6D84007E1867 /* AppSetup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppSetup.h; path = SignalUtilitiesKit/AppSetup.h; sourceTree = SOURCE_ROOT; }; - C38EF285255B6D84007E1867 /* SignalKeyingStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SignalKeyingStorage.h; path = SignalUtilitiesKit/SignalKeyingStorage.h; sourceTree = SOURCE_ROOT; }; + C38EF285255B6D84007E1867 /* SignalKeyingStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SignalKeyingStorage.h; path = SignalUtilitiesKit/Database/SignalKeyingStorage.h; sourceTree = SOURCE_ROOT; }; 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; }; @@ -1760,12 +1725,12 @@ C38EF2A4255B6D93007E1867 /* ProfilePictureView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ProfilePictureView.swift; path = SignalUtilitiesKit/UI/ProfilePictureView.swift; sourceTree = SOURCE_ROOT; }; 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; }; - 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; }; - C38EF2D2255B6DAF007E1867 /* OWSProfileManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OWSProfileManager.h; path = "SignalUtilitiesKit/Remove Later/OWSProfileManager.h"; sourceTree = SOURCE_ROOT; }; - C38EF2D3255B6DAF007E1867 /* OWSUserProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OWSUserProfile.h; path = "SignalUtilitiesKit/Remove Later/OWSUserProfile.h"; sourceTree = SOURCE_ROOT; }; + C38EF2BE255B6DA6007E1867 /* TSUnreadIndicatorInteraction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TSUnreadIndicatorInteraction.h; path = SignalUtilitiesKit/Messaging/TSUnreadIndicatorInteraction.h; sourceTree = SOURCE_ROOT; }; + C38EF2C1255B6DA6007E1867 /* TSUnreadIndicatorInteraction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TSUnreadIndicatorInteraction.m; path = SignalUtilitiesKit/Messaging/TSUnreadIndicatorInteraction.m; sourceTree = SOURCE_ROOT; }; + C38EF2CF255B6DAE007E1867 /* OWSProfileManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OWSProfileManager.m; path = SignalUtilitiesKit/Remove/OWSProfileManager.m; sourceTree = SOURCE_ROOT; }; + C38EF2D1255B6DAF007E1867 /* OWSUserProfile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OWSUserProfile.m; path = SignalUtilitiesKit/Remove/OWSUserProfile.m; sourceTree = SOURCE_ROOT; }; + C38EF2D2255B6DAF007E1867 /* OWSProfileManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OWSProfileManager.h; path = SignalUtilitiesKit/Remove/OWSProfileManager.h; sourceTree = SOURCE_ROOT; }; + C38EF2D3255B6DAF007E1867 /* OWSUserProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OWSUserProfile.h; path = SignalUtilitiesKit/Remove/OWSUserProfile.h; sourceTree = SOURCE_ROOT; }; C38EF2E2255B6DB9007E1867 /* OWSScreenLock.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = OWSScreenLock.swift; path = SignalUtilitiesKit/OWSScreenLock.swift; sourceTree = SOURCE_ROOT; }; C38EF2E3255B6DB9007E1867 /* OWSUnreadIndicator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OWSUnreadIndicator.m; path = SignalUtilitiesKit/OWSUnreadIndicator.m; sourceTree = SOURCE_ROOT; }; C38EF2E4255B6DB9007E1867 /* FullTextSearcher.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = FullTextSearcher.swift; path = SignalUtilitiesKit/FullTextSearcher.swift; sourceTree = SOURCE_ROOT; }; @@ -1828,8 +1793,8 @@ C38EF383255B6DD1007E1867 /* ApprovalRailCellView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ApprovalRailCellView.swift; path = SignalUtilitiesKit/UI/ApprovalRailCellView.swift; sourceTree = SOURCE_ROOT; }; C38EF384255B6DD2007E1867 /* AttachmentCaptionViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AttachmentCaptionViewController.swift; path = SignalUtilitiesKit/UI/AttachmentCaptionViewController.swift; sourceTree = SOURCE_ROOT; }; C38EF397255B6DD9007E1867 /* ThreadViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ThreadViewModel.swift; path = SignalUtilitiesKit/ThreadViewModel.swift; sourceTree = SOURCE_ROOT; }; - C38EF398255B6DD9007E1867 /* OWSQuotedReplyModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OWSQuotedReplyModel.h; path = SignalUtilitiesKit/OWSQuotedReplyModel.h; sourceTree = SOURCE_ROOT; }; - C38EF39A255B6DD9007E1867 /* OWSQuotedReplyModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OWSQuotedReplyModel.m; path = SignalUtilitiesKit/OWSQuotedReplyModel.m; sourceTree = SOURCE_ROOT; }; + C38EF398255B6DD9007E1867 /* OWSQuotedReplyModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OWSQuotedReplyModel.h; path = SignalUtilitiesKit/Messaging/OWSQuotedReplyModel.h; sourceTree = SOURCE_ROOT; }; + C38EF39A255B6DD9007E1867 /* OWSQuotedReplyModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OWSQuotedReplyModel.m; path = SignalUtilitiesKit/Messaging/OWSQuotedReplyModel.m; sourceTree = SOURCE_ROOT; }; C38EF3A8255B6DE4007E1867 /* ImageEditorTextViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ImageEditorTextViewController.swift; path = SignalUtilitiesKit/UI/ImageEditorTextViewController.swift; sourceTree = SOURCE_ROOT; }; C38EF3A9255B6DE4007E1867 /* ImageEditorPinchGestureRecognizer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ImageEditorPinchGestureRecognizer.swift; path = SignalUtilitiesKit/UI/ImageEditorPinchGestureRecognizer.swift; sourceTree = SOURCE_ROOT; }; C38EF3AA255B6DE4007E1867 /* ImageEditorItem.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ImageEditorItem.swift; path = SignalUtilitiesKit/UI/ImageEditorItem.swift; sourceTree = SOURCE_ROOT; }; @@ -1846,11 +1811,11 @@ C38EF3B5255B6DE6007E1867 /* OWSViewController+ImageEditor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "OWSViewController+ImageEditor.swift"; path = "SignalUtilitiesKit/UI/OWSViewController+ImageEditor.swift"; sourceTree = SOURCE_ROOT; }; C38EF3B6255B6DE6007E1867 /* ImageEditorModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ImageEditorModel.swift; path = SignalUtilitiesKit/UI/ImageEditorModel.swift; sourceTree = SOURCE_ROOT; }; C38EF3B7255B6DE6007E1867 /* ImageEditorCanvasView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ImageEditorCanvasView.swift; path = SignalUtilitiesKit/UI/ImageEditorCanvasView.swift; sourceTree = SOURCE_ROOT; }; - C38EF3D1255B6DEE007E1867 /* ThreadViewHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ThreadViewHelper.m; path = SignalUtilitiesKit/ThreadViewHelper.m; sourceTree = SOURCE_ROOT; }; - C38EF3D2255B6DEE007E1867 /* ThreadViewHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadViewHelper.h; path = SignalUtilitiesKit/ThreadViewHelper.h; sourceTree = SOURCE_ROOT; }; + C38EF3D1255B6DEE007E1867 /* ThreadViewHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ThreadViewHelper.m; path = SignalUtilitiesKit/Database/ThreadViewHelper.m; sourceTree = SOURCE_ROOT; }; + C38EF3D2255B6DEE007E1867 /* ThreadViewHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadViewHelper.h; path = SignalUtilitiesKit/Database/ThreadViewHelper.h; sourceTree = SOURCE_ROOT; }; C38EF3D3255B6DEE007E1867 /* OWSSearchBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OWSSearchBar.h; path = SignalUtilitiesKit/UI/OWSSearchBar.h; sourceTree = SOURCE_ROOT; }; C38EF3D4255B6DEE007E1867 /* DisappearingTimerConfigurationView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = DisappearingTimerConfigurationView.swift; path = SignalUtilitiesKit/UI/DisappearingTimerConfigurationView.swift; sourceTree = SOURCE_ROOT; }; - C38EF3D6255B6DEF007E1867 /* ContactCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ContactCellView.m; path = "SignalUtilitiesKit/Remove Later/ContactCellView.m"; sourceTree = SOURCE_ROOT; }; + C38EF3D6255B6DEF007E1867 /* ContactCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ContactCellView.m; path = SignalUtilitiesKit/Remove/ContactCellView.m; sourceTree = SOURCE_ROOT; }; C38EF3D7255B6DF0007E1867 /* OWSTextField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OWSTextField.h; path = SignalUtilitiesKit/UI/OWSTextField.h; sourceTree = SOURCE_ROOT; }; C38EF3D8255B6DF0007E1867 /* OWSTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OWSTextView.h; path = SignalUtilitiesKit/UI/OWSTextView.h; sourceTree = SOURCE_ROOT; }; C38EF3D9255B6DF1007E1867 /* OWSNavigationBar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = OWSNavigationBar.swift; path = SignalUtilitiesKit/UI/OWSNavigationBar.swift; sourceTree = SOURCE_ROOT; }; @@ -1863,13 +1828,13 @@ C38EF3E2255B6DF3007E1867 /* GalleryRailView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = GalleryRailView.swift; path = SignalUtilitiesKit/UI/GalleryRailView.swift; sourceTree = SOURCE_ROOT; }; C38EF3E3255B6DF4007E1867 /* VideoPlayerView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = VideoPlayerView.swift; path = SignalUtilitiesKit/UI/VideoPlayerView.swift; sourceTree = SOURCE_ROOT; }; C38EF3E4255B6DF4007E1867 /* CommonStrings.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CommonStrings.swift; path = SignalUtilitiesKit/CommonStrings.swift; sourceTree = SOURCE_ROOT; }; - C38EF3E5255B6DF4007E1867 /* ContactCellView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ContactCellView.h; path = "SignalUtilitiesKit/Remove Later/ContactCellView.h"; sourceTree = SOURCE_ROOT; }; - C38EF3E6255B6DF4007E1867 /* ContactTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ContactTableViewCell.h; path = "SignalUtilitiesKit/Remove Later/ContactTableViewCell.h"; sourceTree = SOURCE_ROOT; }; + C38EF3E5255B6DF4007E1867 /* ContactCellView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ContactCellView.h; path = SignalUtilitiesKit/Remove/ContactCellView.h; sourceTree = SOURCE_ROOT; }; + C38EF3E6255B6DF4007E1867 /* ContactTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ContactTableViewCell.h; path = SignalUtilitiesKit/Remove/ContactTableViewCell.h; sourceTree = SOURCE_ROOT; }; C38EF3E7255B6DF5007E1867 /* OWSButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = OWSButton.swift; path = SignalUtilitiesKit/UI/OWSButton.swift; sourceTree = SOURCE_ROOT; }; C38EF3E8255B6DF6007E1867 /* OWSAlerts.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = OWSAlerts.swift; path = SignalUtilitiesKit/UI/OWSAlerts.swift; sourceTree = SOURCE_ROOT; }; C38EF3E9255B6DF6007E1867 /* Toast.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Toast.swift; path = SignalUtilitiesKit/UI/Toast.swift; sourceTree = SOURCE_ROOT; }; C38EF3EA255B6DF6007E1867 /* OWSSearchBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OWSSearchBar.m; path = SignalUtilitiesKit/UI/OWSSearchBar.m; sourceTree = SOURCE_ROOT; }; - C38EF3EB255B6DF6007E1867 /* ContactTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ContactTableViewCell.m; path = "SignalUtilitiesKit/Remove Later/ContactTableViewCell.m"; sourceTree = SOURCE_ROOT; }; + C38EF3EB255B6DF6007E1867 /* ContactTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ContactTableViewCell.m; path = SignalUtilitiesKit/Remove/ContactTableViewCell.m; sourceTree = SOURCE_ROOT; }; C38EF3EC255B6DF6007E1867 /* OWSFlatButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = OWSFlatButton.swift; path = SignalUtilitiesKit/UI/OWSFlatButton.swift; sourceTree = SOURCE_ROOT; }; C38EF3ED255B6DF6007E1867 /* TappableStackView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TappableStackView.swift; path = SignalUtilitiesKit/UI/TappableStackView.swift; sourceTree = SOURCE_ROOT; }; C38EF3EE255B6DF6007E1867 /* GradientView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = GradientView.swift; path = SignalUtilitiesKit/UI/GradientView.swift; sourceTree = SOURCE_ROOT; }; @@ -2045,7 +2010,7 @@ C3CA3B2E255CF84E00F4C6D4 /* NullMessage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NullMessage.swift; sourceTree = ""; }; C3D0972A2510499C00F6E3E4 /* BackgroundPoller.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BackgroundPoller.swift; sourceTree = ""; }; C3D697372564DCE6004AF766 /* MessageHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageHandler.swift; sourceTree = ""; }; - C3D697492564DEDC004AF766 /* MessageHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageHandler.swift; sourceTree = ""; }; + C3D697492564DEDC004AF766 /* MessageReceiverDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageReceiverDelegate.swift; sourceTree = ""; }; C3DAB3232480CB2A00725F25 /* SRCopyableLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SRCopyableLabel.swift; sourceTree = ""; }; C3DFFAC523E96F0D0058DAF8 /* Sheet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Sheet.swift; sourceTree = ""; }; C3E5C2F9251DBABB0040DFFC /* EditClosedGroupVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditClosedGroupVC.swift; sourceTree = ""; }; @@ -2297,7 +2262,6 @@ 34D1F0721F8678AA0066283D /* ConversationViewLayout.m */, 341341ED2187467900192D59 /* ConversationViewModel.h */, 341341EE2187467900192D59 /* ConversationViewModel.m */, - 34B6A904218B4C90007C4606 /* TypingIndicatorInteraction.swift */, ); path = ConversationView; sourceTree = ""; @@ -2314,6 +2278,7 @@ 34D1F0951F867BFC0066283D /* Cells */ = { isa = PBXGroup; children = ( + 34B6A904218B4C90007C4606 /* TypingIndicatorInteraction.swift */, 34D1F0BB1F8D108C0066283D /* AttachmentUploadView.h */, 34D1F0BC1F8D108C0066283D /* AttachmentUploadView.m */, 3488F9352191CC4000E524CC /* ConversationMediaView.swift */, @@ -2370,10 +2335,10 @@ 76EB03C118170B33006006FC /* Signal */ = { isa = PBXGroup; children = ( + 3448BFC01EDF0EA7005B2D69 /* ConversationView */, 76EB03C218170B33006006FC /* AppDelegate.h */, 76EB03C318170B33006006FC /* AppDelegate.m */, 45AE48501E0732D6004D96C2 /* TurnServerInfo.swift */, - 458DE9D51DEE3FD00071BB03 /* PeerConnectionClient.swift */, 34D99CE3217509C1000AFB39 /* AppEnvironment.swift */, 4505C2BE1E648EA300CEBF41 /* ExperienceUpgrade.swift */, 3461293D1FD1D72B00532771 /* ExperienceUpgradeFinder.swift */, @@ -2391,7 +2356,6 @@ 4CEB78C72178EBAB00F315D2 /* OWSSessionResetJobRecord.h */, 4CEB78C82178EBAB00F315D2 /* OWSSessionResetJobRecord.m */, 451166BF1FD86B98000739BA /* AccountManager.swift */, - 45DF5DF11DDB843F00C936C7 /* CompareSafetyNumbersActivity.swift */, 458E38351D668EBF0094BD24 /* OWSDeviceProvisioningURLParser.h */, 458E38361D668EBF0094BD24 /* OWSDeviceProvisioningURLParser.m */, 4CB5F26820F7D060004D1B42 /* MessageActions.swift */, @@ -2399,8 +2363,6 @@ 450DF2081E0DD2C6003D14BE /* UserNotificationsAdaptee.swift */, 4CFE6B6B21F92BA700006701 /* LegacyNotificationsAdaptee.swift */, 4C090A1A210FD9C7001FD7F9 /* HapticFeedback.swift */, - 34B3F83B1E8DF1700035BE1A /* CallViewController.swift */, - 4CFD151C22415AA400F2450F /* CallVideoHintView.swift */, 340FC884204DAC8C007AEB0F /* AboutTableViewController.h */, 340FC893204DAC8C007AEB0F /* AboutTableViewController.m */, 340FC892204DAC8C007AEB0F /* AddToBlockListViewController.h */, @@ -2439,10 +2401,8 @@ 4CA485BA2232339F004B9E7D /* PhotoCaptureViewController.swift */, 4C21D5D7223AC60F00EF8A77 /* PhotoCapture.swift */, 3441FD9E21A3604F00BB9542 /* BackupRestoreViewController.swift */, - 3448E1652215B313004B052E /* OnboardingCaptchaViewController.swift */, - 340FC8A4204DAC8D007AEB0F /* AddToGroupViewController.h */, - 340FC89B204DAC8D007AEB0F /* AddToGroupViewController.m */, 340FC8A0204DAC8D007AEB0F /* OWSConversationSettingsViewController.h */, + 340FC89A204DAC8D007AEB0F /* OWSConversationSettingsViewController.m */, 34E3E5671EC4B19400495BAC /* AudioProgressView.swift */, 4C2F454E214C00E1004871FF /* AvatarTableViewCell.swift */, 4CA46F4B219CCC630038ABDE /* CaptionView.swift */, @@ -2494,11 +2454,9 @@ 450DF2041E0D74AC003D14BE /* Platform.swift */, 4521C3BF1F59F3BA00B4C582 /* TextFieldHelper.swift */, 4CC613352227A00400E21A3A /* ConversationSearch.swift */, - 340FC89A204DAC8D007AEB0F /* OWSConversationSettingsViewController.m */, 340FC899204DAC8D007AEB0F /* OWSConversationSettingsViewDelegate.h */, - 34D1F0BF1F8EC1760066283D /* MessageRecipientStatusUtils.swift */, - 3448BFC01EDF0EA7005B2D69 /* ConversationView */, 34A6C27F21E503E600B5B12E /* OWSImagePickerController.swift */, + 34D1F0BF1F8EC1760066283D /* MessageRecipientStatusUtils.swift */, ); path = Signal; sourceTree = ""; @@ -2817,13 +2775,13 @@ isa = PBXGroup; children = ( C33FD9B7255A54A300E217F9 /* Meta */, + C3851CE3256250FA0061EEB0 /* Remove */, + C38BBA17255E327A0041B9A3 /* Move to Session */, C3CA3B11255CF17200F4C6D4 /* Utilities */, C3851CD225624B060061EEB0 /* UI */, - C3851CE3256250FA0061EEB0 /* Remove Later */, - C38BBA17255E327A0041B9A3 /* Move to main app */, C38BBA0B255E31EC0041B9A3 /* Attachments */, C38BBA0C255E32020041B9A3 /* Threads */, - C38BBA0D255E321C0041B9A3 /* Messages */, + C38BBA0D255E321C0041B9A3 /* Messaging */, C38BBA0E255E32440041B9A3 /* Database */, C33FDB8A255A581200E217F9 /* AppContext.h */, C33FDB85255A581100E217F9 /* AppContext.m */, @@ -2831,10 +2789,6 @@ C33FDB75255A581000E217F9 /* AppReadiness.m */, C33FDB4C255A580D00E217F9 /* AppVersion.h */, C38EF3E4255B6DF4007E1867 /* CommonStrings.swift */, - C38EF3D2255B6DEE007E1867 /* ThreadViewHelper.h */, - C38EF3D1255B6DEE007E1867 /* ThreadViewHelper.m */, - C38EF398255B6DD9007E1867 /* OWSQuotedReplyModel.h */, - C38EF39A255B6DD9007E1867 /* OWSQuotedReplyModel.m */, C38EF397255B6DD9007E1867 /* ThreadViewModel.swift */, C38EF2E5255B6DB9007E1867 /* AppPreferences.swift */, C38EF30B255B6DBE007E1867 /* BlockListCache.swift */, @@ -2848,36 +2802,22 @@ C38EF2E3255B6DB9007E1867 /* OWSUnreadIndicator.m */, C38EF2EC255B6DBA007E1867 /* ProximityMonitoringManager.swift */, C38EF2F2255B6DBC007E1867 /* Searcher.swift */, - C38EF2BE255B6DA6007E1867 /* TSUnreadIndicatorInteraction.h */, - C38EF2C1255B6DA6007E1867 /* TSUnreadIndicatorInteraction.m */, C38EF284255B6D84007E1867 /* AppSetup.h */, C38EF287255B6D85007E1867 /* AppSetup.m */, C3F0A52F255C80BC007BE2A3 /* NoopNotificationsManager.swift */, C38EF288255B6D85007E1867 /* OWSSounds.h */, C38EF28B255B6D86007E1867 /* OWSSounds.m */, - C38EF285255B6D84007E1867 /* SignalKeyingStorage.h */, - C38EF282255B6D84007E1867 /* SignalKeyingStorage.m */, + C33FDC1F255A581F00E217F9 /* LokiSessionRestorationImplementation.swift */, C38EF283255B6D84007E1867 /* VersionMigrations.h */, C38EF286255B6D85007E1867 /* VersionMigrations.m */, C33FDA8B255A57FD00E217F9 /* AppVersion.m */, - C33FDB34255A580B00E217F9 /* ClosedGroupPoller.swift */, - C33FDA74255A57FB00E217F9 /* ClosedGroupsProtocol.swift */, - C33FDB2F255A580A00E217F9 /* ContactsManagerProtocol.h */, C33FDB68255A580F00E217F9 /* ContentProxy.swift */, C33FDBC9255A581700E217F9 /* CreatePreKeysOperation.swift */, - C33FDA94255A57FE00E217F9 /* Data+Streaming.swift */, C33FDB54255A580D00E217F9 /* DataSource.h */, C33FDBB6255A581600E217F9 /* DataSource.m */, C33FDB69255A580F00E217F9 /* FeatureFlags.swift */, C33FDB7F255A581100E217F9 /* FullTextSearchFinder.swift */, - C33FDC16255A581E00E217F9 /* FunctionalUtil.h */, - C33FDB17255A580800E217F9 /* FunctionalUtil.m */, C33FDB87255A581100E217F9 /* JobQueue.swift */, - C33FDBDE255A581900E217F9 /* LokiPushNotificationManager.swift */, - C33FDC1F255A581F00E217F9 /* LokiSessionRestorationImplementation.swift */, - C33FDA7E255A57FB00E217F9 /* Mention.swift */, - C33FDA81255A57FC00E217F9 /* MentionsManager.swift */, - C33FDB80255A581100E217F9 /* Notification+Loki.swift */, C33FDB7A255A581000E217F9 /* NotificationsProtocol.h */, C33FDB0E255A580800E217F9 /* NSError+MessageSending.h */, C33FDB09255A580700E217F9 /* NSError+MessageSending.m */, @@ -2890,18 +2830,10 @@ C33FDC1B255A581F00E217F9 /* OWSBackgroundTask.m */, C33FDAEA255A580500E217F9 /* OWSBackupFragment.h */, C33FDB07255A580700E217F9 /* OWSBackupFragment.m */, - C33FDBEB255A581B00E217F9 /* OWSBlockingManager.h */, - C33FDA68255A57F900E217F9 /* OWSBlockingManager.m */, C33FDA95255A57FE00E217F9 /* OWSChunkedOutputStream.h */, C33FDB4B255A580C00E217F9 /* OWSChunkedOutputStream.m */, C33FDA9D255A57FF00E217F9 /* OWSContactsOutputStream.h */, C33FDB44255A580C00E217F9 /* OWSContactsOutputStream.m */, - C33FDAD9255A580300E217F9 /* OWSDisappearingMessagesConfiguration.h */, - C33FDBA4255A581400E217F9 /* OWSDisappearingMessagesConfiguration.m */, - C33FDC05255A581D00E217F9 /* OWSDisappearingMessagesFinder.h */, - C33FDA86255A57FC00E217F9 /* OWSDisappearingMessagesFinder.m */, - C33FDA80255A57FC00E217F9 /* OWSDisappearingMessagesJob.h */, - C33FDBDD255A581900E217F9 /* OWSDisappearingMessagesJob.m */, C33FDA96255A57FE00E217F9 /* OWSDispatch.h */, C33FDAC3255A580200E217F9 /* OWSDispatch.m */, C33FDBF9255A581C00E217F9 /* OWSError.h */, @@ -2918,83 +2850,47 @@ C33FDBBF255A581700E217F9 /* OWSHTTPSecurityPolicy.m */, C33FDBF1255A581B00E217F9 /* OWSIdentityManager.h */, C33FDBA9255A581500E217F9 /* OWSIdentityManager.m */, - C33FDAC0255A580100E217F9 /* OWSIncomingMessageFinder.h */, - C33FDB1E255A580900E217F9 /* OWSIncomingMessageFinder.m */, - C33FDBA8255A581500E217F9 /* OWSLinkPreview.swift */, C33FDB67255A580F00E217F9 /* OWSMediaGalleryFinder.h */, C33FDB71255A581000E217F9 /* OWSMediaGalleryFinder.m */, - C33FDBCE255A581800E217F9 /* OWSMessageServiceParams.h */, - C33FDB70255A580F00E217F9 /* OWSMessageServiceParams.m */, - C33FDAE8255A580500E217F9 /* OWSMessageUtils.h */, - C33FDBD7255A581900E217F9 /* OWSMessageUtils.m */, C33FDBA1255A581400E217F9 /* OWSOperation.h */, C33FDB78255A581000E217F9 /* OWSOperation.m */, - C33FDABD255A580100E217F9 /* OWSOutgoingReceiptManager.h */, - C33FDB6F255A580F00E217F9 /* OWSOutgoingReceiptManager.m */, - C33FDB62255A580E00E217F9 /* OWSProvisioningCipher.h */, - C33FDB2B255A580A00E217F9 /* OWSProvisioningCipher.m */, C33FDC19255A581F00E217F9 /* OWSQueues.h */, - C33FDB1D255A580900E217F9 /* OWSReadReceiptManager.h */, - C33FDA71255A57FA00E217F9 /* OWSReadReceiptManager.m */, - C33FDAE1255A580400E217F9 /* OWSReadTracking.h */, C33FDAA0255A57FF00E217F9 /* OWSRecipientIdentity.h */, C33FDBEC255A581B00E217F9 /* OWSRecipientIdentity.m */, C33FDBAD255A581500E217F9 /* OWSRecordTranscriptJob.h */, C33FDA7F255A57FC00E217F9 /* OWSRecordTranscriptJob.m */, C33FDBD3255A581800E217F9 /* OWSSignalAddress.swift */, - C33FDAB9255A580100E217F9 /* OWSStorage+Subclass.h */, C33FDA75255A57FB00E217F9 /* OWSSyncManagerProtocol.h */, C33FDAF1255A580500E217F9 /* OWSThumbnailService.swift */, C33FDB5A255A580E00E217F9 /* OWSUDManager.swift */, C33FDBD6255A581900E217F9 /* OWSUploadOperation.h */, C33FDC1E255A581F00E217F9 /* OWSUploadOperation.m */, - C33FDB8F255A581200E217F9 /* ParamParser.swift */, - C33FDB3A255A580B00E217F9 /* Poller.swift */, C33FDB53255A580D00E217F9 /* PreKeyBundle+jsonDict.h */, C33FDB93255A581200E217F9 /* PreKeyBundle+jsonDict.m */, C33FDB64255A580E00E217F9 /* PreKeyRefreshOperation.swift */, - C33FDB33255A580B00E217F9 /* Provisioning.pb.swift */, - C33FDAB0255A580000E217F9 /* ProvisioningProto.swift */, C33FDAF2255A580500E217F9 /* ProxiedContentDownloader.swift */, - C33FDADF255A580400E217F9 /* PublicChatManager.swift */, - C33FDA8C255A57FD00E217F9 /* PublicChatPoller.swift */, C33FDA6F255A57FA00E217F9 /* ReachabilityManager.swift */, C33FDA98255A57FE00E217F9 /* RotateSignedKeyOperation.swift */, C33FDBAE255A581500E217F9 /* SignalAccount.h */, C33FDC06255A581D00E217F9 /* SignalAccount.m */, C33FDBD8255A581900E217F9 /* SignalIOS.pb.swift */, C33FDB40255A580C00E217F9 /* SignalIOSProto.swift */, - C33FDB6A255A580F00E217F9 /* SignalMessage.swift */, C33FDAEC255A580500E217F9 /* SignalRecipient.h */, C33FDBB7255A581600E217F9 /* SignalRecipient.m */, - C33FDC08255A581D00E217F9 /* SignalService.pb.swift */, - C33FDBA5255A581400E217F9 /* SignalServiceProfile.swift */, C33FDB31255A580A00E217F9 /* SSKEnvironment.h */, C33FDAF4255A580600E217F9 /* SSKEnvironment.m */, - C33FDB32255A580A00E217F9 /* SSKIncrementingIdFinder.swift */, C33FDB4F255A580D00E217F9 /* SSKJobRecord.h */, C33FDACD255A580200E217F9 /* SSKJobRecord.m */, C33FDAED255A580500E217F9 /* SSKMessageSenderJobRecord.h */, C33FDAE9255A580500E217F9 /* SSKMessageSenderJobRecord.m */, - C33FDA69255A57F900E217F9 /* SSKPreferences.swift */, - C33FDADE255A580400E217F9 /* SwiftSingletons.swift */, C33FDB94255A581300E217F9 /* TSAccountManager.h */, C33FDB88255A581200E217F9 /* TSAccountManager.m */, C33FDC12255A581E00E217F9 /* TSConstants.h */, C33FDABE255A580100E217F9 /* TSConstants.m */, - C33FDB25255A580900E217F9 /* TSDatabaseSecondaryIndexes.h */, - C33FDB20255A580900E217F9 /* TSDatabaseSecondaryIndexes.m */, - C33FDB2C255A580A00E217F9 /* TSDatabaseView.h */, - C33FDB46255A580C00E217F9 /* TSDatabaseView.m */, C33FDB6D255A580F00E217F9 /* TSPreKeyManager.h */, C33FDB7E255A581100E217F9 /* TSPreKeyManager.m */, - C33FDBA0255A581400E217F9 /* TSStorageHeaders.h */, - C33FDBEF255A581B00E217F9 /* TSStorageKeys.h */, - C33FDA87255A57FC00E217F9 /* TypingIndicators.swift */, C37F53E8255BA9BB002AEA92 /* Environment.h */, C37F5402255BA9ED002AEA92 /* Environment.m */, - B8C2B33B2563770800551B4D /* ThreadUtil.h */, - B8C2B331256376F000551B4D /* ThreadUtil.m */, ); path = SignalUtilitiesKit; sourceTree = ""; @@ -3130,9 +3026,11 @@ path = UI; sourceTree = ""; }; - C3851CE3256250FA0061EEB0 /* Remove Later */ = { + C3851CE3256250FA0061EEB0 /* Remove */ = { isa = PBXGroup; children = ( + C33FDB19255A580900E217F9 /* GroupUtilities.swift */, + C33FDA74255A57FB00E217F9 /* ClosedGroupsProtocol.swift */, C33FDAFF255A580600E217F9 /* DisplayNameUtilities.swift */, C33FDBF4255A581B00E217F9 /* DisplayNameUtilities2.swift */, C33FDBB9255A581600E217F9 /* ProfileManagerProtocol.h */, @@ -3147,7 +3045,7 @@ C38EF2D3255B6DAF007E1867 /* OWSUserProfile.h */, C38EF2D1255B6DAF007E1867 /* OWSUserProfile.m */, ); - path = "Remove Later"; + path = Remove; sourceTree = ""; }; C38BBA0B255E31EC0041B9A3 /* Attachments */ = { @@ -3167,6 +3065,8 @@ C38BBA0C255E32020041B9A3 /* Threads */ = { isa = PBXGroup; children = ( + B8C2B33B2563770800551B4D /* ThreadUtil.h */, + B8C2B331256376F000551B4D /* ThreadUtil.m */, C33FDAB3255A580000E217F9 /* TSContactThread.h */, C33FDAF9255A580600E217F9 /* TSContactThread.m */, C33FDB0A255A580700E217F9 /* TSGroupModel.h */, @@ -3179,9 +3079,34 @@ path = Threads; sourceTree = ""; }; - C38BBA0D255E321C0041B9A3 /* Messages */ = { + C38BBA0D255E321C0041B9A3 /* Messaging */ = { isa = PBXGroup; children = ( + C38EF398255B6DD9007E1867 /* OWSQuotedReplyModel.h */, + C38EF39A255B6DD9007E1867 /* OWSQuotedReplyModel.m */, + C38EF2BE255B6DA6007E1867 /* TSUnreadIndicatorInteraction.h */, + C38EF2C1255B6DA6007E1867 /* TSUnreadIndicatorInteraction.m */, + C33FDA7E255A57FB00E217F9 /* Mention.swift */, + C33FDA81255A57FC00E217F9 /* MentionsManager.swift */, + C33FDAD9255A580300E217F9 /* OWSDisappearingMessagesConfiguration.h */, + C33FDBA4255A581400E217F9 /* OWSDisappearingMessagesConfiguration.m */, + C33FDC05255A581D00E217F9 /* OWSDisappearingMessagesFinder.h */, + C33FDA86255A57FC00E217F9 /* OWSDisappearingMessagesFinder.m */, + C33FDA80255A57FC00E217F9 /* OWSDisappearingMessagesJob.h */, + C33FDBDD255A581900E217F9 /* OWSDisappearingMessagesJob.m */, + C33FDBEB255A581B00E217F9 /* OWSBlockingManager.h */, + C33FDA68255A57F900E217F9 /* OWSBlockingManager.m */, + C33FDAC0255A580100E217F9 /* OWSIncomingMessageFinder.h */, + C33FDB1E255A580900E217F9 /* OWSIncomingMessageFinder.m */, + C33FDBA8255A581500E217F9 /* OWSLinkPreview.swift */, + C33FDAE8255A580500E217F9 /* OWSMessageUtils.h */, + C33FDBD7255A581900E217F9 /* OWSMessageUtils.m */, + C33FDABD255A580100E217F9 /* OWSOutgoingReceiptManager.h */, + C33FDB6F255A580F00E217F9 /* OWSOutgoingReceiptManager.m */, + C33FDAE1255A580400E217F9 /* OWSReadTracking.h */, + C33FDB1D255A580900E217F9 /* OWSReadReceiptManager.h */, + C33FDA71255A57FA00E217F9 /* OWSReadReceiptManager.m */, + C33FDA87255A57FC00E217F9 /* TypingIndicators.swift */, C33FDADA255A580400E217F9 /* OWSDisappearingConfigurationUpdateInfoMessage.h */, C33FDA6B255A57FA00E217F9 /* OWSDisappearingConfigurationUpdateInfoMessage.m */, C33FDB5D255A580E00E217F9 /* TSErrorMessage_privateConstructor.h */, @@ -3206,12 +3131,24 @@ C33FDAD5255A580300E217F9 /* TSQuotedMessage.h */, C33FDB83255A581100E217F9 /* TSQuotedMessage.m */, ); - path = Messages; + path = Messaging; sourceTree = ""; }; C38BBA0E255E32440041B9A3 /* Database */ = { isa = PBXGroup; children = ( + C38EF3D2255B6DEE007E1867 /* ThreadViewHelper.h */, + C38EF3D1255B6DEE007E1867 /* ThreadViewHelper.m */, + C38EF285255B6D84007E1867 /* SignalKeyingStorage.h */, + C38EF282255B6D84007E1867 /* SignalKeyingStorage.m */, + C33FDAB9255A580100E217F9 /* OWSStorage+Subclass.h */, + C33FDA69255A57F900E217F9 /* SSKPreferences.swift */, + C33FDB25255A580900E217F9 /* TSDatabaseSecondaryIndexes.h */, + C33FDB20255A580900E217F9 /* TSDatabaseSecondaryIndexes.m */, + C33FDB2C255A580A00E217F9 /* TSDatabaseView.h */, + C33FDB46255A580C00E217F9 /* TSDatabaseView.m */, + C33FDBA0255A581400E217F9 /* TSStorageHeaders.h */, + C33FDBEF255A581B00E217F9 /* TSStorageKeys.h */, C33FDBBC255A581600E217F9 /* SSKKeychainStorage.swift */, C38EF271255B6D79007E1867 /* OWSDatabaseMigration.h */, C38EF270255B6D79007E1867 /* OWSDatabaseMigration.m */, @@ -3242,9 +3179,15 @@ path = Database; sourceTree = ""; }; - C38BBA17255E327A0041B9A3 /* Move to main app */ = { + C38BBA17255E327A0041B9A3 /* Move to Session */ = { isa = PBXGroup; children = ( + C33FDB6B255A580F00E217F9 /* LKUserDefaults.swift */, + C33FDB34255A580B00E217F9 /* ClosedGroupPoller.swift */, + C33FDBDE255A581900E217F9 /* LokiPushNotificationManager.swift */, + C33FDB3A255A580B00E217F9 /* Poller.swift */, + C33FDADF255A580400E217F9 /* PublicChatManager.swift */, + C33FDA8C255A57FD00E217F9 /* PublicChatPoller.swift */, C3EEA016256487B300C338BC /* LokiDatabaseUtilities.swift */, C33FDBBB255A581600E217F9 /* OWSPrimaryStorage+Loki.h */, C33FDB58255A580E00E217F9 /* OWSPrimaryStorage+Loki.m */, @@ -3257,7 +3200,7 @@ C33FDB8B255A581200E217F9 /* Storage+SessionManagement.swift */, C33FDB37255A580B00E217F9 /* Storage+SnodeAPI.swift */, ); - path = "Move to main app"; + path = "Move to Session"; sourceTree = ""; }; C396DAE72518407300FF6DC5 /* SwiftCSV */ = { @@ -3630,12 +3573,16 @@ C3CA3B11255CF17200F4C6D4 /* Utilities */ = { isa = PBXGroup; children = ( + C33FDC16255A581E00E217F9 /* FunctionalUtil.h */, + C33FDB17255A580800E217F9 /* FunctionalUtil.m */, + C33FDB80255A581100E217F9 /* Notification+Loki.swift */, + C33FDB8F255A581200E217F9 /* ParamParser.swift */, + C33FDB32255A580A00E217F9 /* SSKIncrementingIdFinder.swift */, + C33FDADE255A580400E217F9 /* SwiftSingletons.swift */, 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 */, @@ -3816,7 +3763,7 @@ C3550A02255DD6D900194B6A /* AppDelegate+OpenGroupAPI.swift */, C3F0A62B255C9937007BE2A3 /* AppDelegate+SharedSenderKeys.swift */, C3F0A5EB255C970D007BE2A3 /* Configuration.swift */, - C3D697492564DEDC004AF766 /* MessageHandler.swift */, + C3D697492564DEDC004AF766 /* MessageReceiverDelegate.swift */, B8CCF63B239757C10091D419 /* Components */, C31F812425258F9C00DD9FD9 /* Database */, C32B405424A961E1001117B5 /* Dependencies */, @@ -3895,7 +3842,6 @@ C38EF36D255B6DCC007E1867 /* SharingThreadPickerViewController.h in Headers */, C33FDC5B255A582000E217F9 /* TSYapDatabaseObject.h in Headers */, C38EF35D255B6DCC007E1867 /* OWSNavigationController.h in Headers */, - C33FDD88255A582000E217F9 /* OWSMessageServiceParams.h in Headers */, C33FDDBF255A582000E217F9 /* OWSDisappearingMessagesFinder.h in Headers */, C33FDCC4255A582000E217F9 /* TSGroupModel.h in Headers */, C38EF249255B6D67007E1867 /* UIColor+OWS.h in Headers */, @@ -3916,7 +3862,6 @@ C38EF3F1255B6DF7007E1867 /* OWSSearchBar.h in Headers */, C33FDD75255A582000E217F9 /* OWSPrimaryStorage+Loki.h in Headers */, C33FDC5A255A582000E217F9 /* OWSRecipientIdentity.h in Headers */, - C33FDD1C255A582000E217F9 /* OWSProvisioningCipher.h in Headers */, C33FDC42255A581F00E217F9 /* YapDatabaseTransaction+OWS.h in Headers */, C33FDCA6255A582000E217F9 /* SignalRecipient.h in Headers */, C38EF277255B6D7A007E1867 /* OWSDatabaseMigration.h in Headers */, @@ -3931,7 +3876,6 @@ C38EF366255B6DCC007E1867 /* ScreenLockViewController.h in Headers */, C33FDD16255A582000E217F9 /* NSArray+Functional.h in Headers */, C38EF35B255B6DCC007E1867 /* SelectThreadViewController.h in Headers */, - C33FDCE9255A582000E217F9 /* ContactsManagerProtocol.h in Headers */, C33FDDD3255A582000E217F9 /* OWSQueues.h in Headers */, C33FDC96255A582000E217F9 /* NSObject+Casting.h in Headers */, C33FDC75255A582000E217F9 /* OWSGroupsOutputStream.h in Headers */, @@ -4898,8 +4842,6 @@ C38EF389255B6DD2007E1867 /* AttachmentTextView.swift in Sources */, C38EF321255B6DBF007E1867 /* OWSAudioPlayer.m in Sources */, C33FDD0A255A582000E217F9 /* OWSPrimaryStorage+PreKeyStore.m in Sources */, - C33FDC4E255A582000E217F9 /* Data+Streaming.swift in Sources */, - C33FDCE5255A582000E217F9 /* OWSProvisioningCipher.m in Sources */, C33FDD1A255A582000E217F9 /* TSMessage.m in Sources */, C38EF3FF255B6DF7007E1867 /* TappableView.swift in Sources */, C38EF3C2255B6DE7007E1867 /* ImageEditorPaletteView.swift in Sources */, @@ -4915,7 +4857,6 @@ 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 */, C33FDDD5255A582000E217F9 /* OWSBackgroundTask.m in Sources */, C33FDC7E255A582000E217F9 /* TSAttachmentStream.m in Sources */, @@ -4964,7 +4905,6 @@ C33FDD92255A582000E217F9 /* SignalIOS.pb.swift in Sources */, C33FDCB3255A582000E217F9 /* TSContactThread.m in Sources */, C33FDC45255A581F00E217F9 /* AppVersion.m in Sources */, - C33FDD2A255A582000E217F9 /* OWSMessageServiceParams.m in Sources */, C33FDC7C255A582000E217F9 /* TSAttachment.m in Sources */, C38EF3C7255B6DE7007E1867 /* ImageEditorCanvasView.swift in Sources */, C33FDC46255A581F00E217F9 /* PublicChatPoller.swift in Sources */, @@ -4990,17 +4930,14 @@ C33FDD10255A582000E217F9 /* TSOutgoingMessage.m in Sources */, C33FDCFA255A582000E217F9 /* SignalIOSProto.swift in Sources */, C33FDCC3255A582000E217F9 /* NSError+MessageSending.m in Sources */, - C33FDCED255A582000E217F9 /* Provisioning.pb.swift in Sources */, C33FDCF0255A582000E217F9 /* Storage.swift in Sources */, C33FDD2D255A582000E217F9 /* TSGroupModel.m in Sources */, C33FDD9B255A582000E217F9 /* LKGroupUtilities.m in Sources */, C38EF229255B6D5D007E1867 /* SignalAttachment.swift in Sources */, - C33FDDC2255A582000E217F9 /* SignalService.pb.swift in Sources */, C33FDD13255A582000E217F9 /* OWSFailedAttachmentDownloadsJob.m in Sources */, C38EF24D255B6D67007E1867 /* UIView+OWS.swift in Sources */, C3CA3B13255CF18200F4C6D4 /* Destination+Conversion.swift in Sources */, C33FDCB5255A582000E217F9 /* SessionMetaProtocol.swift in Sources */, - C33FDC6A255A582000E217F9 /* ProvisioningProto.swift in Sources */, C33FDD4D255A582000E217F9 /* PreKeyBundle+jsonDict.m in Sources */, C38EF24B255B6D67007E1867 /* UIView+OWS.m in Sources */, C33FDC51255A582000E217F9 /* TSIncomingMessage.m in Sources */, @@ -5068,7 +5005,6 @@ C33FDC22255A581F00E217F9 /* OWSBlockingManager.m in Sources */, C38EF3FE255B6DF7007E1867 /* OWSTextField.m in Sources */, C33FDC40255A581F00E217F9 /* OWSDisappearingMessagesFinder.m in Sources */, - C33FDD24255A582000E217F9 /* SignalMessage.swift in Sources */, C33FDCEE255A582000E217F9 /* ClosedGroupPoller.swift in Sources */, C38EF3BD255B6DE7007E1867 /* ImageEditorTransform.swift in Sources */, C38EF24F255B6D67007E1867 /* UIColor+OWS.m in Sources */, @@ -5302,7 +5238,6 @@ C3E5C2FA251DBABB0040DFFC /* EditClosedGroupVC.swift in Sources */, B8783E9E23EB948D00404FB8 /* UILabel+Interaction.swift in Sources */, C3550A03255DD6D900194B6A /* AppDelegate+OpenGroupAPI.swift in Sources */, - 340FC8B8204DAC8D007AEB0F /* AddToGroupViewController.m in Sources */, B893063F2383961A005EAA8E /* ScanQRCodeWrapperVC.swift in Sources */, B879D449247E1BE300DB3608 /* PathVC.swift in Sources */, 454A84042059C787008B8C75 /* MediaTileViewController.swift in Sources */, @@ -5314,7 +5249,6 @@ 348570A820F67575004FF32B /* OWSMessageHeaderView.m in Sources */, 450DF2091E0DD2C6003D14BE /* UserNotificationsAdaptee.swift in Sources */, 34B6A907218B5241007C4606 /* TypingIndicatorCell.swift in Sources */, - 4CFD151D22415AA400F2450F /* CallVideoHintView.swift in Sources */, C3548F0824456AB6009433A8 /* UIView+Wrapping.swift in Sources */, B82B408A2399EC0600A248E7 /* FakeChatView.swift in Sources */, 343A65981FC4CFE7000477A1 /* ConversationScrollButton.m in Sources */, @@ -5328,7 +5262,6 @@ 450D19131F85236600970622 /* RemoteVideoView.m in Sources */, 34129B8621EF877A005457A8 /* LinkPreviewView.swift in Sources */, 34386A54207D271D009F5D9C /* NeverClearView.swift in Sources */, - 45DF5DF21DDB843F00C936C7 /* CompareSafetyNumbersActivity.swift in Sources */, 451166C01FD86B98000739BA /* AccountManager.swift in Sources */, B83F2B88240CB75A000A54AB /* UIImage+Scaling.swift in Sources */, 3430FE181F7751D4000EC51B /* GiphyAPI.swift in Sources */, @@ -5387,7 +5320,7 @@ 458E38371D668EBF0094BD24 /* OWSDeviceProvisioningURLParser.m in Sources */, 34B6A905218B4C91007C4606 /* TypingIndicatorInteraction.swift in Sources */, 2400888E239F30A600305217 /* SessionRestorationView.swift in Sources */, - C3D6974A2564DEDC004AF766 /* MessageHandler.swift in Sources */, + C3D6974A2564DEDC004AF766 /* MessageReceiverDelegate.swift in Sources */, B886B4A72398B23E00211ABE /* QRCodeVC.swift in Sources */, 34EA69402194933900702471 /* MediaDownloadView.swift in Sources */, B8544E3323D50E4900299F14 /* AppearanceUtilities.swift in Sources */, @@ -5395,7 +5328,6 @@ 3496744D2076768700080B5F /* OWSMessageBubbleView.m in Sources */, C3550A1D255DD73500194B6A /* Storage+SessionMessagingKit.swift in Sources */, C331FFF42558FF0300070591 /* PNOptionView.swift in Sources */, - 34B3F8751E8DF1700035BE1A /* CallViewController.swift in Sources */, 4C4AE6A1224AF35700D4AF6F /* SendMediaNavigationController.swift in Sources */, 45F32C222057297A00A300D5 /* MediaDetailViewController.m in Sources */, C3DAB3242480CB2B00725F25 /* SRCopyableLabel.swift in Sources */, @@ -5424,7 +5356,6 @@ B84664F5235022F30083A1CD /* MentionUtilities.swift in Sources */, 34D1F0C01F8EC1760066283D /* MessageRecipientStatusUtils.swift in Sources */, 34277A5E20751BDC006049F2 /* OWSQuotedMessageView.m in Sources */, - 458DE9D61DEE3FD00071BB03 /* PeerConnectionClient.swift in Sources */, C3F0A5FE255C988A007BE2A3 /* Storage+Shared.swift in Sources */, B82B4090239DD75000A248E7 /* RestoreVC.swift in Sources */, 3488F9362191CC4000E524CC /* ConversationMediaView.swift in Sources */, @@ -5452,7 +5383,6 @@ B8BB82A5238F627000BA5194 /* HomeVC.swift in Sources */, C31A6C5A247F214E001123EF /* UIView+Glow.swift in Sources */, C31D1DE9252172D4005D4DA8 /* ContactUtilities.swift in Sources */, - 3448E1662215B313004B052E /* OnboardingCaptchaViewController.swift in Sources */, 4521C3C01F59F3BA00B4C582 /* TextFieldHelper.swift in Sources */, 340FC8AC204DAC8D007AEB0F /* PrivacySettingsTableViewController.m in Sources */, B88847BC23E10BC6009836D2 /* GroupMembersVC.swift in Sources */, diff --git a/SignalUtilitiesKit/ContactsManagerProtocol.h b/SignalUtilitiesKit/ContactsManagerProtocol.h deleted file mode 100644 index 7dff8e6c7..000000000 --- a/SignalUtilitiesKit/ContactsManagerProtocol.h +++ /dev/null @@ -1,37 +0,0 @@ -// -// Copyright (c) 2018 Open Whisper Systems. All rights reserved. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@class CNContact; -@class Contact; -@class PhoneNumber; -@class SignalAccount; -@class UIImage; -@class YapDatabaseReadTransaction; - -@protocol ContactsManagerProtocol - -- (NSString *)displayNameForPhoneIdentifier:(nullable NSString *)recipientId; -- (NSString *)displayNameForPhoneIdentifier:(NSString *_Nullable)recipientId - transaction:(YapDatabaseReadTransaction *)transaction; -- (NSArray *)signalAccounts; - -- (BOOL)isSystemContact:(NSString *)recipientId; -- (BOOL)isSystemContactWithSignalAccount:(NSString *)recipientId; - -- (NSComparisonResult)compareSignalAccount:(SignalAccount *)left - withSignalAccount:(SignalAccount *)right NS_SWIFT_NAME(compare(signalAccount:with:)); - -#pragma mark - CNContacts - -- (nullable CNContact *)cnContactWithId:(nullable NSString *)contactId; -- (nullable NSData *)avatarDataForCNContactId:(nullable NSString *)contactId; -- (nullable UIImage *)avatarImageForCNContactId:(nullable NSString *)contactId; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SignalUtilitiesKit/CreatePreKeysOperation.swift b/SignalUtilitiesKit/CreatePreKeysOperation.swift index c74f96d13..cda43567c 100644 --- a/SignalUtilitiesKit/CreatePreKeysOperation.swift +++ b/SignalUtilitiesKit/CreatePreKeysOperation.swift @@ -8,7 +8,7 @@ import PromiseKit @objc(SSKCreatePreKeysOperation) public class CreatePreKeysOperation: OWSOperation { - private var primaryStorage: OWSPrimaryStorage { + private var storage: OWSPrimaryStorage { return OWSPrimaryStorage.shared() } @@ -23,7 +23,11 @@ public class CreatePreKeysOperation: OWSOperation { identityKeyManager.generateNewIdentityKeyPair() } - SessionManagementProtocol.createPreKeys() + let signedPreKeyRecord = storage.generateRandomSignedRecord() + signedPreKeyRecord.markAsAcceptedByService() + storage.storeSignedPreKey(signedPreKeyRecord.id, signedPreKeyRecord: signedPreKeyRecord) + storage.setCurrentSignedPrekeyId(signedPreKeyRecord.id) + print("[Loki] Pre keys created successfully.") reportSuccess() } } diff --git a/SignalUtilitiesKit/Data+Streaming.swift b/SignalUtilitiesKit/Data+Streaming.swift deleted file mode 100644 index 745dc3792..000000000 --- a/SignalUtilitiesKit/Data+Streaming.swift +++ /dev/null @@ -1,22 +0,0 @@ - -extension Data { - - init(from inputStream: InputStream) throws { - self.init() - inputStream.open() - defer { inputStream.close() } - let bufferSize = 1024 - let buffer = UnsafeMutablePointer.allocate(capacity: bufferSize) - defer { buffer.deallocate() } - while inputStream.hasBytesAvailable { - let count = inputStream.read(buffer, maxLength: bufferSize) - if count < 0 { - throw inputStream.streamError! - } else if count == 0 { - break - } else { - append(buffer, count: count) - } - } - } -} diff --git a/SignalUtilitiesKit/OWSStorage+Subclass.h b/SignalUtilitiesKit/Database/OWSStorage+Subclass.h similarity index 100% rename from SignalUtilitiesKit/OWSStorage+Subclass.h rename to SignalUtilitiesKit/Database/OWSStorage+Subclass.h diff --git a/SignalUtilitiesKit/SSKPreferences.swift b/SignalUtilitiesKit/Database/SSKPreferences.swift similarity index 100% rename from SignalUtilitiesKit/SSKPreferences.swift rename to SignalUtilitiesKit/Database/SSKPreferences.swift diff --git a/SignalUtilitiesKit/SignalKeyingStorage.h b/SignalUtilitiesKit/Database/SignalKeyingStorage.h similarity index 100% rename from SignalUtilitiesKit/SignalKeyingStorage.h rename to SignalUtilitiesKit/Database/SignalKeyingStorage.h diff --git a/SignalUtilitiesKit/SignalKeyingStorage.m b/SignalUtilitiesKit/Database/SignalKeyingStorage.m similarity index 100% rename from SignalUtilitiesKit/SignalKeyingStorage.m rename to SignalUtilitiesKit/Database/SignalKeyingStorage.m diff --git a/SignalUtilitiesKit/TSDatabaseSecondaryIndexes.h b/SignalUtilitiesKit/Database/TSDatabaseSecondaryIndexes.h similarity index 100% rename from SignalUtilitiesKit/TSDatabaseSecondaryIndexes.h rename to SignalUtilitiesKit/Database/TSDatabaseSecondaryIndexes.h diff --git a/SignalUtilitiesKit/TSDatabaseSecondaryIndexes.m b/SignalUtilitiesKit/Database/TSDatabaseSecondaryIndexes.m similarity index 100% rename from SignalUtilitiesKit/TSDatabaseSecondaryIndexes.m rename to SignalUtilitiesKit/Database/TSDatabaseSecondaryIndexes.m diff --git a/SignalUtilitiesKit/TSDatabaseView.h b/SignalUtilitiesKit/Database/TSDatabaseView.h similarity index 100% rename from SignalUtilitiesKit/TSDatabaseView.h rename to SignalUtilitiesKit/Database/TSDatabaseView.h diff --git a/SignalUtilitiesKit/TSDatabaseView.m b/SignalUtilitiesKit/Database/TSDatabaseView.m similarity index 100% rename from SignalUtilitiesKit/TSDatabaseView.m rename to SignalUtilitiesKit/Database/TSDatabaseView.m diff --git a/SignalUtilitiesKit/TSStorageHeaders.h b/SignalUtilitiesKit/Database/TSStorageHeaders.h similarity index 100% rename from SignalUtilitiesKit/TSStorageHeaders.h rename to SignalUtilitiesKit/Database/TSStorageHeaders.h diff --git a/SignalUtilitiesKit/TSStorageKeys.h b/SignalUtilitiesKit/Database/TSStorageKeys.h similarity index 100% rename from SignalUtilitiesKit/TSStorageKeys.h rename to SignalUtilitiesKit/Database/TSStorageKeys.h diff --git a/SignalUtilitiesKit/ThreadViewHelper.h b/SignalUtilitiesKit/Database/ThreadViewHelper.h similarity index 100% rename from SignalUtilitiesKit/ThreadViewHelper.h rename to SignalUtilitiesKit/Database/ThreadViewHelper.h diff --git a/SignalUtilitiesKit/ThreadViewHelper.m b/SignalUtilitiesKit/Database/ThreadViewHelper.m similarity index 100% rename from SignalUtilitiesKit/ThreadViewHelper.m rename to SignalUtilitiesKit/Database/ThreadViewHelper.m diff --git a/SignalUtilitiesKit/FullTextSearcher.swift b/SignalUtilitiesKit/FullTextSearcher.swift index d711bd614..e0078fe3d 100644 --- a/SignalUtilitiesKit/FullTextSearcher.swift +++ b/SignalUtilitiesKit/FullTextSearcher.swift @@ -51,52 +51,23 @@ public class ConversationSearchResult: Comparable where SortKey: Compar } } -@objc -public class ContactSearchResult: NSObject, Comparable { - public let signalAccount: SignalAccount - public let contactsManager: ContactsManagerProtocol - - public var recipientId: String { - return signalAccount.recipientId - } - - init(signalAccount: SignalAccount, contactsManager: ContactsManagerProtocol) { - self.signalAccount = signalAccount - self.contactsManager = contactsManager - } - - // MARK: Comparable - - public static func < (lhs: ContactSearchResult, rhs: ContactSearchResult) -> Bool { - return lhs.contactsManager.compare(signalAccount: lhs.signalAccount, with: rhs.signalAccount) == .orderedAscending - } - - // MARK: Equatable - - public static func == (lhs: ContactSearchResult, rhs: ContactSearchResult) -> Bool { - return lhs.recipientId == rhs.recipientId - } -} - public class HomeScreenSearchResultSet: NSObject { public let searchText: String public let conversations: [ConversationSearchResult] - public let contacts: [ContactSearchResult] public let messages: [ConversationSearchResult] - public init(searchText: String, conversations: [ConversationSearchResult], contacts: [ContactSearchResult], messages: [ConversationSearchResult]) { + public init(searchText: String, conversations: [ConversationSearchResult], messages: [ConversationSearchResult]) { self.searchText = searchText self.conversations = conversations - self.contacts = contacts self.messages = messages } public class var empty: HomeScreenSearchResultSet { - return HomeScreenSearchResultSet(searchText: "", conversations: [], contacts: [], messages: []) + return HomeScreenSearchResultSet(searchText: "", conversations: [], messages: []) } public var isEmpty: Bool { - return conversations.isEmpty && contacts.isEmpty && messages.isEmpty + return conversations.isEmpty && messages.isEmpty } } @@ -138,26 +109,17 @@ public class ComposeScreenSearchResultSet: NSObject { return groups.compactMap { $0.thread.threadRecord as? TSGroupThread } } - @objc - public let signalContacts: [ContactSearchResult] - - @objc - public var signalAccounts: [SignalAccount] { - return signalContacts.map { $0.signalAccount } - } - - public init(searchText: String, groups: [GroupSearchResult], signalContacts: [ContactSearchResult]) { + public init(searchText: String, groups: [GroupSearchResult]) { self.searchText = searchText self.groups = groups - self.signalContacts = signalContacts } @objc - public static let empty = ComposeScreenSearchResultSet(searchText: "", groups: [], signalContacts: []) + public static let empty = ComposeScreenSearchResultSet(searchText: "", groups: []) @objc public var isEmpty: Bool { - return groups.isEmpty && signalContacts.isEmpty + return groups.isEmpty } } @@ -233,18 +195,13 @@ public class FullTextSearcher: NSObject { @objc public func searchForComposeScreen(searchText: String, - transaction: YapDatabaseReadTransaction, - contactsManager: ContactsManagerProtocol) -> ComposeScreenSearchResultSet { + transaction: YapDatabaseReadTransaction) -> ComposeScreenSearchResultSet { - var signalContacts: [ContactSearchResult] = [] var groups: [GroupSearchResult] = [] self.finder.enumerateObjects(searchText: searchText, transaction: transaction) { (match: Any, snippet: String?) in switch match { - case let signalAccount as SignalAccount: - let searchResult = ContactSearchResult(signalAccount: signalAccount, contactsManager: contactsManager) - signalContacts.append(searchResult) case let groupThread as TSGroupThread: let sortKey = ConversationSortKey(creationDate: groupThread.creationDate, lastMessageReceivedAtDate: groupThread.lastInteractionForInbox(transaction: transaction)?.receivedAtDate()) @@ -262,22 +219,17 @@ public class FullTextSearcher: NSObject { } } - // Order contact results by display name. - signalContacts.sort() - // Order the conversation and message results in reverse chronological order. // The contact results are pre-sorted by display name. groups.sort(by: >) - return ComposeScreenSearchResultSet(searchText: searchText, groups: groups, signalContacts: signalContacts) + return ComposeScreenSearchResultSet(searchText: searchText, groups: groups) } public func searchForHomeScreen(searchText: String, - transaction: YapDatabaseReadTransaction, - contactsManager: ContactsManagerProtocol) -> HomeScreenSearchResultSet { + transaction: YapDatabaseReadTransaction) -> HomeScreenSearchResultSet { var conversations: [ConversationSearchResult] = [] - var contacts: [ContactSearchResult] = [] var messages: [ConversationSearchResult] = [] var existingConversationRecipientIds: Set = Set() @@ -308,25 +260,17 @@ public class FullTextSearcher: NSObject { snippet: snippet) messages.append(searchResult) - } else if let signalAccount = match as? SignalAccount { - let searchResult = ContactSearchResult(signalAccount: signalAccount, contactsManager: contactsManager) - contacts.append(searchResult) } else { owsFailDebug("unhandled item: \(match)") } } - // Only show contacts which were not included in an existing 1:1 conversation. - var otherContacts: [ContactSearchResult] = contacts.filter { !existingConversationRecipientIds.contains($0.recipientId) } - // Order the conversation and message results in reverse chronological order. // The contact results are pre-sorted by display name. conversations.sort(by: >) messages.sort(by: >) - // Order "other" contact results by display name. - otherContacts.sort() - return HomeScreenSearchResultSet(searchText: searchText, conversations: conversations, contacts: otherContacts, messages: messages) + return HomeScreenSearchResultSet(searchText: searchText, conversations: conversations, messages: messages) } public func searchWithinConversation(thread: TSThread, diff --git a/SignalUtilitiesKit/Mention.swift b/SignalUtilitiesKit/Messaging/Mention.swift similarity index 100% rename from SignalUtilitiesKit/Mention.swift rename to SignalUtilitiesKit/Messaging/Mention.swift diff --git a/SignalUtilitiesKit/MentionsManager.swift b/SignalUtilitiesKit/Messaging/MentionsManager.swift similarity index 100% rename from SignalUtilitiesKit/MentionsManager.swift rename to SignalUtilitiesKit/Messaging/MentionsManager.swift diff --git a/SignalUtilitiesKit/OWSBlockingManager.h b/SignalUtilitiesKit/Messaging/OWSBlockingManager.h similarity index 100% rename from SignalUtilitiesKit/OWSBlockingManager.h rename to SignalUtilitiesKit/Messaging/OWSBlockingManager.h diff --git a/SignalUtilitiesKit/OWSBlockingManager.m b/SignalUtilitiesKit/Messaging/OWSBlockingManager.m similarity index 100% rename from SignalUtilitiesKit/OWSBlockingManager.m rename to SignalUtilitiesKit/Messaging/OWSBlockingManager.m diff --git a/SignalUtilitiesKit/Messages/OWSDisappearingConfigurationUpdateInfoMessage.h b/SignalUtilitiesKit/Messaging/OWSDisappearingConfigurationUpdateInfoMessage.h similarity index 100% rename from SignalUtilitiesKit/Messages/OWSDisappearingConfigurationUpdateInfoMessage.h rename to SignalUtilitiesKit/Messaging/OWSDisappearingConfigurationUpdateInfoMessage.h diff --git a/SignalUtilitiesKit/Messages/OWSDisappearingConfigurationUpdateInfoMessage.m b/SignalUtilitiesKit/Messaging/OWSDisappearingConfigurationUpdateInfoMessage.m similarity index 100% rename from SignalUtilitiesKit/Messages/OWSDisappearingConfigurationUpdateInfoMessage.m rename to SignalUtilitiesKit/Messaging/OWSDisappearingConfigurationUpdateInfoMessage.m diff --git a/SignalUtilitiesKit/OWSDisappearingMessagesConfiguration.h b/SignalUtilitiesKit/Messaging/OWSDisappearingMessagesConfiguration.h similarity index 100% rename from SignalUtilitiesKit/OWSDisappearingMessagesConfiguration.h rename to SignalUtilitiesKit/Messaging/OWSDisappearingMessagesConfiguration.h diff --git a/SignalUtilitiesKit/OWSDisappearingMessagesConfiguration.m b/SignalUtilitiesKit/Messaging/OWSDisappearingMessagesConfiguration.m similarity index 100% rename from SignalUtilitiesKit/OWSDisappearingMessagesConfiguration.m rename to SignalUtilitiesKit/Messaging/OWSDisappearingMessagesConfiguration.m diff --git a/SignalUtilitiesKit/OWSDisappearingMessagesFinder.h b/SignalUtilitiesKit/Messaging/OWSDisappearingMessagesFinder.h similarity index 100% rename from SignalUtilitiesKit/OWSDisappearingMessagesFinder.h rename to SignalUtilitiesKit/Messaging/OWSDisappearingMessagesFinder.h diff --git a/SignalUtilitiesKit/OWSDisappearingMessagesFinder.m b/SignalUtilitiesKit/Messaging/OWSDisappearingMessagesFinder.m similarity index 100% rename from SignalUtilitiesKit/OWSDisappearingMessagesFinder.m rename to SignalUtilitiesKit/Messaging/OWSDisappearingMessagesFinder.m diff --git a/SignalUtilitiesKit/OWSDisappearingMessagesJob.h b/SignalUtilitiesKit/Messaging/OWSDisappearingMessagesJob.h similarity index 100% rename from SignalUtilitiesKit/OWSDisappearingMessagesJob.h rename to SignalUtilitiesKit/Messaging/OWSDisappearingMessagesJob.h diff --git a/SignalUtilitiesKit/OWSDisappearingMessagesJob.m b/SignalUtilitiesKit/Messaging/OWSDisappearingMessagesJob.m similarity index 99% rename from SignalUtilitiesKit/OWSDisappearingMessagesJob.m rename to SignalUtilitiesKit/Messaging/OWSDisappearingMessagesJob.m index 7f987a1fc..ee95b421c 100644 --- a/SignalUtilitiesKit/OWSDisappearingMessagesJob.m +++ b/SignalUtilitiesKit/Messaging/OWSDisappearingMessagesJob.m @@ -5,7 +5,6 @@ #import "OWSDisappearingMessagesJob.h" #import "AppContext.h" #import "AppReadiness.h" -#import "ContactsManagerProtocol.h" #import "OWSBackgroundTask.h" #import "OWSDisappearingConfigurationUpdateInfoMessage.h" #import "OWSDisappearingMessagesConfiguration.h" diff --git a/SignalUtilitiesKit/OWSIncomingMessageFinder.h b/SignalUtilitiesKit/Messaging/OWSIncomingMessageFinder.h similarity index 100% rename from SignalUtilitiesKit/OWSIncomingMessageFinder.h rename to SignalUtilitiesKit/Messaging/OWSIncomingMessageFinder.h diff --git a/SignalUtilitiesKit/OWSIncomingMessageFinder.m b/SignalUtilitiesKit/Messaging/OWSIncomingMessageFinder.m similarity index 100% rename from SignalUtilitiesKit/OWSIncomingMessageFinder.m rename to SignalUtilitiesKit/Messaging/OWSIncomingMessageFinder.m diff --git a/SignalUtilitiesKit/OWSLinkPreview.swift b/SignalUtilitiesKit/Messaging/OWSLinkPreview.swift similarity index 100% rename from SignalUtilitiesKit/OWSLinkPreview.swift rename to SignalUtilitiesKit/Messaging/OWSLinkPreview.swift diff --git a/SignalUtilitiesKit/OWSMessageUtils.h b/SignalUtilitiesKit/Messaging/OWSMessageUtils.h similarity index 100% rename from SignalUtilitiesKit/OWSMessageUtils.h rename to SignalUtilitiesKit/Messaging/OWSMessageUtils.h diff --git a/SignalUtilitiesKit/OWSMessageUtils.m b/SignalUtilitiesKit/Messaging/OWSMessageUtils.m similarity index 100% rename from SignalUtilitiesKit/OWSMessageUtils.m rename to SignalUtilitiesKit/Messaging/OWSMessageUtils.m diff --git a/SignalUtilitiesKit/OWSOutgoingReceiptManager.h b/SignalUtilitiesKit/Messaging/OWSOutgoingReceiptManager.h similarity index 100% rename from SignalUtilitiesKit/OWSOutgoingReceiptManager.h rename to SignalUtilitiesKit/Messaging/OWSOutgoingReceiptManager.h diff --git a/SignalUtilitiesKit/OWSOutgoingReceiptManager.m b/SignalUtilitiesKit/Messaging/OWSOutgoingReceiptManager.m similarity index 100% rename from SignalUtilitiesKit/OWSOutgoingReceiptManager.m rename to SignalUtilitiesKit/Messaging/OWSOutgoingReceiptManager.m diff --git a/SignalUtilitiesKit/OWSQuotedReplyModel.h b/SignalUtilitiesKit/Messaging/OWSQuotedReplyModel.h similarity index 100% rename from SignalUtilitiesKit/OWSQuotedReplyModel.h rename to SignalUtilitiesKit/Messaging/OWSQuotedReplyModel.h diff --git a/SignalUtilitiesKit/OWSQuotedReplyModel.m b/SignalUtilitiesKit/Messaging/OWSQuotedReplyModel.m similarity index 100% rename from SignalUtilitiesKit/OWSQuotedReplyModel.m rename to SignalUtilitiesKit/Messaging/OWSQuotedReplyModel.m diff --git a/SignalUtilitiesKit/OWSReadReceiptManager.h b/SignalUtilitiesKit/Messaging/OWSReadReceiptManager.h similarity index 100% rename from SignalUtilitiesKit/OWSReadReceiptManager.h rename to SignalUtilitiesKit/Messaging/OWSReadReceiptManager.h diff --git a/SignalUtilitiesKit/OWSReadReceiptManager.m b/SignalUtilitiesKit/Messaging/OWSReadReceiptManager.m similarity index 100% rename from SignalUtilitiesKit/OWSReadReceiptManager.m rename to SignalUtilitiesKit/Messaging/OWSReadReceiptManager.m diff --git a/SignalUtilitiesKit/OWSReadTracking.h b/SignalUtilitiesKit/Messaging/OWSReadTracking.h similarity index 100% rename from SignalUtilitiesKit/OWSReadTracking.h rename to SignalUtilitiesKit/Messaging/OWSReadTracking.h diff --git a/SignalUtilitiesKit/Messages/TSErrorMessage.h b/SignalUtilitiesKit/Messaging/TSErrorMessage.h similarity index 100% rename from SignalUtilitiesKit/Messages/TSErrorMessage.h rename to SignalUtilitiesKit/Messaging/TSErrorMessage.h diff --git a/SignalUtilitiesKit/Messages/TSErrorMessage.m b/SignalUtilitiesKit/Messaging/TSErrorMessage.m similarity index 99% rename from SignalUtilitiesKit/Messages/TSErrorMessage.m rename to SignalUtilitiesKit/Messaging/TSErrorMessage.m index 62464701d..09944f332 100644 --- a/SignalUtilitiesKit/Messages/TSErrorMessage.m +++ b/SignalUtilitiesKit/Messaging/TSErrorMessage.m @@ -3,7 +3,6 @@ // #import "TSErrorMessage.h" -#import "ContactsManagerProtocol.h" #import "SSKEnvironment.h" #import "TSContactThread.h" #import "TSErrorMessage_privateConstructor.h" diff --git a/SignalUtilitiesKit/Messages/TSErrorMessage_privateConstructor.h b/SignalUtilitiesKit/Messaging/TSErrorMessage_privateConstructor.h similarity index 100% rename from SignalUtilitiesKit/Messages/TSErrorMessage_privateConstructor.h rename to SignalUtilitiesKit/Messaging/TSErrorMessage_privateConstructor.h diff --git a/SignalUtilitiesKit/Messages/TSIncomingMessage.h b/SignalUtilitiesKit/Messaging/TSIncomingMessage.h similarity index 100% rename from SignalUtilitiesKit/Messages/TSIncomingMessage.h rename to SignalUtilitiesKit/Messaging/TSIncomingMessage.h diff --git a/SignalUtilitiesKit/Messages/TSIncomingMessage.m b/SignalUtilitiesKit/Messaging/TSIncomingMessage.m similarity index 100% rename from SignalUtilitiesKit/Messages/TSIncomingMessage.m rename to SignalUtilitiesKit/Messaging/TSIncomingMessage.m diff --git a/SignalUtilitiesKit/Messages/TSInfoMessage.h b/SignalUtilitiesKit/Messaging/TSInfoMessage.h similarity index 100% rename from SignalUtilitiesKit/Messages/TSInfoMessage.h rename to SignalUtilitiesKit/Messaging/TSInfoMessage.h diff --git a/SignalUtilitiesKit/Messages/TSInfoMessage.m b/SignalUtilitiesKit/Messaging/TSInfoMessage.m similarity index 99% rename from SignalUtilitiesKit/Messages/TSInfoMessage.m rename to SignalUtilitiesKit/Messaging/TSInfoMessage.m index d47a01044..1db237167 100644 --- a/SignalUtilitiesKit/Messages/TSInfoMessage.m +++ b/SignalUtilitiesKit/Messaging/TSInfoMessage.m @@ -3,7 +3,6 @@ // #import "TSInfoMessage.h" -#import "ContactsManagerProtocol.h" #import "SSKEnvironment.h" #import #import diff --git a/SignalUtilitiesKit/Messages/TSInteraction.h b/SignalUtilitiesKit/Messaging/TSInteraction.h similarity index 100% rename from SignalUtilitiesKit/Messages/TSInteraction.h rename to SignalUtilitiesKit/Messaging/TSInteraction.h diff --git a/SignalUtilitiesKit/Messages/TSInteraction.m b/SignalUtilitiesKit/Messaging/TSInteraction.m similarity index 100% rename from SignalUtilitiesKit/Messages/TSInteraction.m rename to SignalUtilitiesKit/Messaging/TSInteraction.m diff --git a/SignalUtilitiesKit/Messages/TSInvalidIdentityKeyErrorMessage.h b/SignalUtilitiesKit/Messaging/TSInvalidIdentityKeyErrorMessage.h similarity index 100% rename from SignalUtilitiesKit/Messages/TSInvalidIdentityKeyErrorMessage.h rename to SignalUtilitiesKit/Messaging/TSInvalidIdentityKeyErrorMessage.h diff --git a/SignalUtilitiesKit/Messages/TSInvalidIdentityKeyErrorMessage.m b/SignalUtilitiesKit/Messaging/TSInvalidIdentityKeyErrorMessage.m similarity index 100% rename from SignalUtilitiesKit/Messages/TSInvalidIdentityKeyErrorMessage.m rename to SignalUtilitiesKit/Messaging/TSInvalidIdentityKeyErrorMessage.m diff --git a/SignalUtilitiesKit/Messages/TSInvalidIdentityKeyReceivingErrorMessage.h b/SignalUtilitiesKit/Messaging/TSInvalidIdentityKeyReceivingErrorMessage.h similarity index 100% rename from SignalUtilitiesKit/Messages/TSInvalidIdentityKeyReceivingErrorMessage.h rename to SignalUtilitiesKit/Messaging/TSInvalidIdentityKeyReceivingErrorMessage.h diff --git a/SignalUtilitiesKit/Messages/TSInvalidIdentityKeyReceivingErrorMessage.m b/SignalUtilitiesKit/Messaging/TSInvalidIdentityKeyReceivingErrorMessage.m similarity index 100% rename from SignalUtilitiesKit/Messages/TSInvalidIdentityKeyReceivingErrorMessage.m rename to SignalUtilitiesKit/Messaging/TSInvalidIdentityKeyReceivingErrorMessage.m diff --git a/SignalUtilitiesKit/Messages/TSInvalidIdentityKeySendingErrorMessage.h b/SignalUtilitiesKit/Messaging/TSInvalidIdentityKeySendingErrorMessage.h similarity index 100% rename from SignalUtilitiesKit/Messages/TSInvalidIdentityKeySendingErrorMessage.h rename to SignalUtilitiesKit/Messaging/TSInvalidIdentityKeySendingErrorMessage.h diff --git a/SignalUtilitiesKit/Messages/TSInvalidIdentityKeySendingErrorMessage.m b/SignalUtilitiesKit/Messaging/TSInvalidIdentityKeySendingErrorMessage.m similarity index 100% rename from SignalUtilitiesKit/Messages/TSInvalidIdentityKeySendingErrorMessage.m rename to SignalUtilitiesKit/Messaging/TSInvalidIdentityKeySendingErrorMessage.m diff --git a/SignalUtilitiesKit/Messages/TSMessage.h b/SignalUtilitiesKit/Messaging/TSMessage.h similarity index 99% rename from SignalUtilitiesKit/Messages/TSMessage.h rename to SignalUtilitiesKit/Messaging/TSMessage.h index ecf440bb1..6b5a1d660 100644 --- a/SignalUtilitiesKit/Messages/TSMessage.h +++ b/SignalUtilitiesKit/Messaging/TSMessage.h @@ -27,7 +27,6 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, readonly) BOOL isExpiringMessage; @property (nonatomic, readonly, nullable) TSQuotedMessage *quotedMessage; @property (nonatomic, nullable) OWSLinkPreview *linkPreview; -@property BOOL skipSave; // Open groups @property (nonatomic) uint64_t openGroupServerMessageID; @property (nonatomic, readonly) BOOL isOpenGroupMessage; diff --git a/SignalUtilitiesKit/Messages/TSMessage.m b/SignalUtilitiesKit/Messaging/TSMessage.m similarity index 100% rename from SignalUtilitiesKit/Messages/TSMessage.m rename to SignalUtilitiesKit/Messaging/TSMessage.m diff --git a/SignalUtilitiesKit/Messages/TSOutgoingMessage.h b/SignalUtilitiesKit/Messaging/TSOutgoingMessage.h similarity index 100% rename from SignalUtilitiesKit/Messages/TSOutgoingMessage.h rename to SignalUtilitiesKit/Messaging/TSOutgoingMessage.h diff --git a/SignalUtilitiesKit/Messages/TSOutgoingMessage.m b/SignalUtilitiesKit/Messaging/TSOutgoingMessage.m similarity index 100% rename from SignalUtilitiesKit/Messages/TSOutgoingMessage.m rename to SignalUtilitiesKit/Messaging/TSOutgoingMessage.m diff --git a/SignalUtilitiesKit/Messages/TSQuotedMessage.h b/SignalUtilitiesKit/Messaging/TSQuotedMessage.h similarity index 100% rename from SignalUtilitiesKit/Messages/TSQuotedMessage.h rename to SignalUtilitiesKit/Messaging/TSQuotedMessage.h diff --git a/SignalUtilitiesKit/Messages/TSQuotedMessage.m b/SignalUtilitiesKit/Messaging/TSQuotedMessage.m similarity index 100% rename from SignalUtilitiesKit/Messages/TSQuotedMessage.m rename to SignalUtilitiesKit/Messaging/TSQuotedMessage.m diff --git a/SignalUtilitiesKit/TSUnreadIndicatorInteraction.h b/SignalUtilitiesKit/Messaging/TSUnreadIndicatorInteraction.h similarity index 100% rename from SignalUtilitiesKit/TSUnreadIndicatorInteraction.h rename to SignalUtilitiesKit/Messaging/TSUnreadIndicatorInteraction.h diff --git a/SignalUtilitiesKit/TSUnreadIndicatorInteraction.m b/SignalUtilitiesKit/Messaging/TSUnreadIndicatorInteraction.m similarity index 100% rename from SignalUtilitiesKit/TSUnreadIndicatorInteraction.m rename to SignalUtilitiesKit/Messaging/TSUnreadIndicatorInteraction.m diff --git a/SignalUtilitiesKit/TypingIndicators.swift b/SignalUtilitiesKit/Messaging/TypingIndicators.swift similarity index 100% rename from SignalUtilitiesKit/TypingIndicators.swift rename to SignalUtilitiesKit/Messaging/TypingIndicators.swift diff --git a/SignalUtilitiesKit/ClosedGroupPoller.swift b/SignalUtilitiesKit/Move to Session/ClosedGroupPoller.swift similarity index 100% rename from SignalUtilitiesKit/ClosedGroupPoller.swift rename to SignalUtilitiesKit/Move to Session/ClosedGroupPoller.swift diff --git a/SignalUtilitiesKit/Utilities/LKUserDefaults.swift b/SignalUtilitiesKit/Move to Session/LKUserDefaults.swift similarity index 100% rename from SignalUtilitiesKit/Utilities/LKUserDefaults.swift rename to SignalUtilitiesKit/Move to Session/LKUserDefaults.swift diff --git a/SignalUtilitiesKit/Move to main app/LokiDatabaseUtilities.swift b/SignalUtilitiesKit/Move to Session/LokiDatabaseUtilities.swift similarity index 100% rename from SignalUtilitiesKit/Move to main app/LokiDatabaseUtilities.swift rename to SignalUtilitiesKit/Move to Session/LokiDatabaseUtilities.swift diff --git a/SignalUtilitiesKit/LokiPushNotificationManager.swift b/SignalUtilitiesKit/Move to Session/LokiPushNotificationManager.swift similarity index 100% rename from SignalUtilitiesKit/LokiPushNotificationManager.swift rename to SignalUtilitiesKit/Move to Session/LokiPushNotificationManager.swift diff --git a/SignalUtilitiesKit/Move to main app/OWSPrimaryStorage+Loki.h b/SignalUtilitiesKit/Move to Session/OWSPrimaryStorage+Loki.h similarity index 100% rename from SignalUtilitiesKit/Move to main app/OWSPrimaryStorage+Loki.h rename to SignalUtilitiesKit/Move to Session/OWSPrimaryStorage+Loki.h diff --git a/SignalUtilitiesKit/Move to main app/OWSPrimaryStorage+Loki.m b/SignalUtilitiesKit/Move to Session/OWSPrimaryStorage+Loki.m similarity index 100% rename from SignalUtilitiesKit/Move to main app/OWSPrimaryStorage+Loki.m rename to SignalUtilitiesKit/Move to Session/OWSPrimaryStorage+Loki.m diff --git a/SignalUtilitiesKit/Move to main app/OWSPrimaryStorage+Loki.swift b/SignalUtilitiesKit/Move to Session/OWSPrimaryStorage+Loki.swift similarity index 100% rename from SignalUtilitiesKit/Move to main app/OWSPrimaryStorage+Loki.swift rename to SignalUtilitiesKit/Move to Session/OWSPrimaryStorage+Loki.swift diff --git a/SignalUtilitiesKit/Poller.swift b/SignalUtilitiesKit/Move to Session/Poller.swift similarity index 100% rename from SignalUtilitiesKit/Poller.swift rename to SignalUtilitiesKit/Move to Session/Poller.swift diff --git a/SignalUtilitiesKit/PublicChatManager.swift b/SignalUtilitiesKit/Move to Session/PublicChatManager.swift similarity index 100% rename from SignalUtilitiesKit/PublicChatManager.swift rename to SignalUtilitiesKit/Move to Session/PublicChatManager.swift diff --git a/SignalUtilitiesKit/PublicChatPoller.swift b/SignalUtilitiesKit/Move to Session/PublicChatPoller.swift similarity index 100% rename from SignalUtilitiesKit/PublicChatPoller.swift rename to SignalUtilitiesKit/Move to Session/PublicChatPoller.swift diff --git a/SignalUtilitiesKit/Move to main app/Storage+ClosedGroups.swift b/SignalUtilitiesKit/Move to Session/Storage+ClosedGroups.swift similarity index 100% rename from SignalUtilitiesKit/Move to main app/Storage+ClosedGroups.swift rename to SignalUtilitiesKit/Move to Session/Storage+ClosedGroups.swift diff --git a/SignalUtilitiesKit/Move to main app/Storage+Collections.swift b/SignalUtilitiesKit/Move to Session/Storage+Collections.swift similarity index 100% rename from SignalUtilitiesKit/Move to main app/Storage+Collections.swift rename to SignalUtilitiesKit/Move to Session/Storage+Collections.swift diff --git a/SignalUtilitiesKit/Move to main app/Storage+OnionRequests.swift b/SignalUtilitiesKit/Move to Session/Storage+OnionRequests.swift similarity index 100% rename from SignalUtilitiesKit/Move to main app/Storage+OnionRequests.swift rename to SignalUtilitiesKit/Move to Session/Storage+OnionRequests.swift diff --git a/SignalUtilitiesKit/Move to main app/Storage+PublicChats.swift b/SignalUtilitiesKit/Move to Session/Storage+PublicChats.swift similarity index 100% rename from SignalUtilitiesKit/Move to main app/Storage+PublicChats.swift rename to SignalUtilitiesKit/Move to Session/Storage+PublicChats.swift diff --git a/SignalUtilitiesKit/Move to main app/Storage+SessionManagement.swift b/SignalUtilitiesKit/Move to Session/Storage+SessionManagement.swift similarity index 100% rename from SignalUtilitiesKit/Move to main app/Storage+SessionManagement.swift rename to SignalUtilitiesKit/Move to Session/Storage+SessionManagement.swift diff --git a/SignalUtilitiesKit/Move to main app/Storage+SnodeAPI.swift b/SignalUtilitiesKit/Move to Session/Storage+SnodeAPI.swift similarity index 100% rename from SignalUtilitiesKit/Move to main app/Storage+SnodeAPI.swift rename to SignalUtilitiesKit/Move to Session/Storage+SnodeAPI.swift diff --git a/SignalUtilitiesKit/Move to main app/Storage.swift b/SignalUtilitiesKit/Move to Session/Storage.swift similarity index 100% rename from SignalUtilitiesKit/Move to main app/Storage.swift rename to SignalUtilitiesKit/Move to Session/Storage.swift diff --git a/SignalUtilitiesKit/OWSContactsOutputStream.m b/SignalUtilitiesKit/OWSContactsOutputStream.m index cd0a85223..30eea5a3b 100644 --- a/SignalUtilitiesKit/OWSContactsOutputStream.m +++ b/SignalUtilitiesKit/OWSContactsOutputStream.m @@ -3,8 +3,6 @@ // #import "OWSContactsOutputStream.h" - -#import "ContactsManagerProtocol.h" #import "MIMETypeUtil.h" #import "NSData+keyVersionByte.h" #import "OWSBlockingManager.h" diff --git a/SignalUtilitiesKit/OWSMessageServiceParams.h b/SignalUtilitiesKit/OWSMessageServiceParams.h deleted file mode 100644 index 42872d680..000000000 --- a/SignalUtilitiesKit/OWSMessageServiceParams.h +++ /dev/null @@ -1,37 +0,0 @@ -// -// Copyright (c) 2019 Open Whisper Systems. All rights reserved. -// - -#import -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - * Contstructs the per-device-message parameters used when submitting a message to - * the Signal Web Service. - * - * See: - * https://github.com/signalapp/libsignal-service-java/blob/master/java/src/main/java/org/whispersystems/signalservice/internal/push/OutgoingPushMessage.java - */ -@interface OWSMessageServiceParams : MTLModel - -@property (nonatomic, readonly) int type; -@property (nonatomic, readonly) NSString *destination; -@property (nonatomic, readonly) int destinationDeviceId; -@property (nonatomic, readonly) int destinationRegistrationId; -@property (nonatomic, readonly) NSString *content; -@property (nonatomic, readonly) BOOL silent; -@property (nonatomic, readonly) BOOL online; - -- (instancetype)initWithType:(TSWhisperMessageType)type - recipientId:(NSString *)destination - device:(int)deviceId - content:(NSData *)content - isSilent:(BOOL)isSilent - isOnline:(BOOL)isOnline - registrationId:(int)registrationId; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SignalUtilitiesKit/OWSMessageServiceParams.m b/SignalUtilitiesKit/OWSMessageServiceParams.m deleted file mode 100644 index a2a66121c..000000000 --- a/SignalUtilitiesKit/OWSMessageServiceParams.m +++ /dev/null @@ -1,45 +0,0 @@ -// -// Copyright (c) 2019 Open Whisper Systems. All rights reserved. -// - -#import "OWSMessageServiceParams.h" -#import "TSConstants.h" -#import - -NS_ASSUME_NONNULL_BEGIN - -@implementation OWSMessageServiceParams - -+ (NSDictionary *)JSONKeyPathsByPropertyKey -{ - return [NSDictionary mtl_identityPropertyMapWithModel:[self class]]; -} - -- (instancetype)initWithType:(TSWhisperMessageType)type - recipientId:(NSString *)destination - device:(int)deviceId - content:(NSData *)content - isSilent:(BOOL)isSilent - isOnline:(BOOL)isOnline - registrationId:(int)registrationId -{ - self = [super init]; - - if (!self) { - return self; - } - - _type = type; - _destination = destination; - _destinationDeviceId = deviceId; - _destinationRegistrationId = registrationId; - _content = [content base64EncodedString]; - _silent = isSilent; - _online = isOnline; - - return self; -} - -@end - -NS_ASSUME_NONNULL_END diff --git a/SignalUtilitiesKit/OWSProvisioningCipher.h b/SignalUtilitiesKit/OWSProvisioningCipher.h deleted file mode 100644 index ede2142af..000000000 --- a/SignalUtilitiesKit/OWSProvisioningCipher.h +++ /dev/null @@ -1,18 +0,0 @@ -// -// Copyright (c) 2017 Open Whisper Systems. All rights reserved. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface OWSProvisioningCipher : NSObject - -@property (nonatomic, readonly) NSData *ourPublicKey; - -- (instancetype)initWithTheirPublicKey:(NSData *)theirPublicKey; -- (nullable NSData *)encrypt:(NSData *)plainText; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SignalUtilitiesKit/OWSProvisioningCipher.m b/SignalUtilitiesKit/OWSProvisioningCipher.m deleted file mode 100644 index e5d85bfcb..000000000 --- a/SignalUtilitiesKit/OWSProvisioningCipher.m +++ /dev/null @@ -1,157 +0,0 @@ -// -// Copyright (c) 2018 Open Whisper Systems. All rights reserved. -// - -#import "OWSProvisioningCipher.h" -#import -#import -#import -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface OWSProvisioningCipher () - -@property (nonatomic, readonly) NSData *theirPublicKey; -@property (nonatomic, readonly) ECKeyPair *ourKeyPair; -@property (nonatomic, readonly) NSData *initializationVector; - -@end - -#pragma mark - - -@implementation OWSProvisioningCipher - -- (instancetype)initWithTheirPublicKey:(NSData *)theirPublicKey -{ - return [self initWithTheirPublicKey:theirPublicKey - ourKeyPair:[Curve25519 generateKeyPair] - initializationVector:[Cryptography generateRandomBytes:kCCBlockSizeAES128]]; -} - -// Private method which exposes dependencies for testing -- (instancetype)initWithTheirPublicKey:(NSData *)theirPublicKey - ourKeyPair:(ECKeyPair *)ourKeyPair - initializationVector:(NSData *)initializationVector -{ - self = [super init]; - if (!self) { - return self; - } - - _theirPublicKey = theirPublicKey; - _ourKeyPair = ourKeyPair; - _initializationVector = initializationVector; - - return self; -} - -- (NSData *)ourPublicKey -{ - return self.ourKeyPair.publicKey; -} - -- (nullable NSData *)encrypt:(NSData *)dataToEncrypt -{ - @try { - return [self throws_encryptWithData:dataToEncrypt]; - } @catch (NSException *exception) { - OWSFailDebug(@"exception: %@ of type: %@ with reason: %@, user info: %@.", - exception.description, - exception.name, - exception.reason, - exception.userInfo); - return nil; - } -} - -- (nullable NSData *)throws_encryptWithData:(NSData *)dataToEncrypt -{ - NSData *sharedSecret = - [Curve25519 throws_generateSharedSecretFromPublicKey:self.theirPublicKey privateKey:self.ourKeyPair.privateKey]; - - NSData *infoData = [@"TextSecure Provisioning Message" dataUsingEncoding:NSASCIIStringEncoding]; - NSData *nullSalt = [[NSMutableData dataWithLength:32] copy]; - NSData *derivedSecret = [HKDFKit deriveKey:sharedSecret info:infoData salt:nullSalt outputSize:64]; - NSData *cipherKey = [derivedSecret subdataWithRange:NSMakeRange(0, 32)]; - NSData *macKey = [derivedSecret subdataWithRange:NSMakeRange(32, 32)]; - if (cipherKey.length != 32) { - OWSFailDebug(@"Cipher Key must be 32 bytes"); - return nil; - } - if (macKey.length != 32) { - OWSFailDebug(@"Mac Key must be 32 bytes"); - return nil; - } - - u_int8_t versionByte[] = { 0x01 }; - NSMutableData *message = [NSMutableData dataWithBytes:&versionByte length:1]; - - NSData *_Nullable cipherText = [self encrypt:dataToEncrypt withKey:cipherKey]; - if (cipherText == nil) { - OWSFailDebug(@"Provisioning cipher failed."); - return nil; - } - - [message appendData:cipherText]; - - NSData *_Nullable mac = [self macForMessage:message withKey:macKey]; - if (mac == nil) { - OWSFailDebug(@"mac failed."); - return nil; - } - [message appendData:mac]; - - return [message copy]; -} - -- (nullable NSData *)encrypt:(NSData *)dataToEncrypt withKey:(NSData *)cipherKey -{ - NSData *iv = self.initializationVector; - if (iv.length != kCCBlockSizeAES128) { - OWSFailDebug(@"Unexpected length for iv"); - return nil; - } - if (dataToEncrypt.length >= SIZE_MAX - (kCCBlockSizeAES128 + iv.length)) { - OWSFailDebug(@"data is too long to encrypt."); - return nil; - } - - // allow space for message + padding any incomplete block. PKCS7 padding will always add at least one byte. - size_t ciphertextBufferSize = dataToEncrypt.length + kCCBlockSizeAES128; - - NSMutableData *ciphertextData = [[NSMutableData alloc] initWithLength:ciphertextBufferSize]; - - size_t bytesEncrypted = 0; - CCCryptorStatus cryptStatus = CCCrypt(kCCEncrypt, - kCCAlgorithmAES, - kCCOptionPKCS7Padding, - cipherKey.bytes, - cipherKey.length, - iv.bytes, - dataToEncrypt.bytes, - dataToEncrypt.length, - ciphertextData.mutableBytes, - ciphertextBufferSize, - &bytesEncrypted); - - if (cryptStatus != kCCSuccess) { - OWSFailDebug(@"Encryption failed with status: %d", cryptStatus); - return nil; - } - - // message format is (iv || ciphertext) - NSMutableData *encryptedMessage = [NSMutableData new]; - [encryptedMessage appendData:iv]; - [encryptedMessage appendData:[ciphertextData subdataWithRange:NSMakeRange(0, bytesEncrypted)]]; - return [encryptedMessage copy]; -} - -- (nullable NSData *)macForMessage:(NSData *)message withKey:(NSData *)macKey -{ - return [Cryptography computeSHA256HMAC:message withHMACKey:macKey]; -} - -@end - -NS_ASSUME_NONNULL_END diff --git a/SignalUtilitiesKit/PreKeyRefreshOperation.swift b/SignalUtilitiesKit/PreKeyRefreshOperation.swift index ed440fabe..077dd841b 100644 --- a/SignalUtilitiesKit/PreKeyRefreshOperation.swift +++ b/SignalUtilitiesKit/PreKeyRefreshOperation.swift @@ -16,10 +16,6 @@ public class RefreshPreKeysOperation: OWSOperation { return TSAccountManager.sharedInstance() } - private var primaryStorage: OWSPrimaryStorage { - return OWSPrimaryStorage.shared() - } - private var identityKeyManager: OWSIdentityManager { return OWSIdentityManager.shared() } @@ -33,7 +29,15 @@ public class RefreshPreKeysOperation: OWSOperation { } DispatchQueue.global().async { - SessionManagementProtocol.refreshSignedPreKey() + let storage = OWSPrimaryStorage.shared() + guard storage.currentSignedPrekeyId() == nil else { return } + let signedPreKeyRecord = storage.generateRandomSignedRecord() + signedPreKeyRecord.markAsAcceptedByService() + storage.storeSignedPreKey(signedPreKeyRecord.id, signedPreKeyRecord: signedPreKeyRecord) + storage.setCurrentSignedPrekeyId(signedPreKeyRecord.id) + TSPreKeyManager.clearPreKeyUpdateFailureCount() + TSPreKeyManager.clearSignedPreKeyRecords() + print("[Loki] Signed pre key refreshed successfully.") self.reportSuccess() } } diff --git a/SignalUtilitiesKit/Provisioning.pb.swift b/SignalUtilitiesKit/Provisioning.pb.swift deleted file mode 100644 index 713fb00c9..000000000 --- a/SignalUtilitiesKit/Provisioning.pb.swift +++ /dev/null @@ -1,254 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: Provisioning.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -//* -// Copyright (C) 2014-2016 Open Whisper Systems -// -// Licensed according to the LICENSE file in this repository. - -/// 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 ProvisioningProtos_ProvisionEnvelope { - // 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 publicKey: Data { - get {return _publicKey ?? SwiftProtobuf.Internal.emptyData} - set {_publicKey = newValue} - } - /// Returns true if `publicKey` has been explicitly set. - var hasPublicKey: Bool {return self._publicKey != nil} - /// Clears the value of `publicKey`. Subsequent reads from it will return its default value. - mutating func clearPublicKey() {self._publicKey = nil} - - /// @required - var body: Data { - get {return _body ?? SwiftProtobuf.Internal.emptyData} - set {_body = newValue} - } - /// Returns true if `body` has been explicitly set. - var hasBody: Bool {return self._body != nil} - /// Clears the value of `body`. Subsequent reads from it will return its default value. - mutating func clearBody() {self._body = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _publicKey: Data? = nil - fileprivate var _body: Data? = nil -} - -struct ProvisioningProtos_ProvisionMessage { - // 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 identityKeyPublic: Data { - get {return _identityKeyPublic ?? SwiftProtobuf.Internal.emptyData} - set {_identityKeyPublic = newValue} - } - /// Returns true if `identityKeyPublic` has been explicitly set. - var hasIdentityKeyPublic: Bool {return self._identityKeyPublic != nil} - /// Clears the value of `identityKeyPublic`. Subsequent reads from it will return its default value. - mutating func clearIdentityKeyPublic() {self._identityKeyPublic = nil} - - /// @required - var identityKeyPrivate: Data { - get {return _identityKeyPrivate ?? SwiftProtobuf.Internal.emptyData} - set {_identityKeyPrivate = newValue} - } - /// Returns true if `identityKeyPrivate` has been explicitly set. - var hasIdentityKeyPrivate: Bool {return self._identityKeyPrivate != nil} - /// Clears the value of `identityKeyPrivate`. Subsequent reads from it will return its default value. - mutating func clearIdentityKeyPrivate() {self._identityKeyPrivate = nil} - - /// @required - var number: String { - get {return _number ?? String()} - set {_number = newValue} - } - /// Returns true if `number` has been explicitly set. - var hasNumber: Bool {return self._number != nil} - /// Clears the value of `number`. Subsequent reads from it will return its default value. - mutating func clearNumber() {self._number = nil} - - /// @required - var provisioningCode: String { - get {return _provisioningCode ?? String()} - set {_provisioningCode = newValue} - } - /// Returns true if `provisioningCode` has been explicitly set. - var hasProvisioningCode: Bool {return self._provisioningCode != nil} - /// Clears the value of `provisioningCode`. Subsequent reads from it will return its default value. - mutating func clearProvisioningCode() {self._provisioningCode = nil} - - /// @required - var userAgent: String { - get {return _userAgent ?? String()} - set {_userAgent = newValue} - } - /// Returns true if `userAgent` has been explicitly set. - var hasUserAgent: Bool {return self._userAgent != nil} - /// Clears the value of `userAgent`. Subsequent reads from it will return its default value. - mutating func clearUserAgent() {self._userAgent = nil} - - /// @required - var profileKey: Data { - get {return _profileKey ?? SwiftProtobuf.Internal.emptyData} - set {_profileKey = newValue} - } - /// Returns true if `profileKey` has been explicitly set. - var hasProfileKey: Bool {return self._profileKey != nil} - /// Clears the value of `profileKey`. Subsequent reads from it will return its default value. - mutating func clearProfileKey() {self._profileKey = nil} - - /// @required - var readReceipts: Bool { - get {return _readReceipts ?? false} - set {_readReceipts = newValue} - } - /// Returns true if `readReceipts` has been explicitly set. - var hasReadReceipts: Bool {return self._readReceipts != nil} - /// Clears the value of `readReceipts`. Subsequent reads from it will return its default value. - mutating func clearReadReceipts() {self._readReceipts = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _identityKeyPublic: Data? = nil - fileprivate var _identityKeyPrivate: Data? = nil - fileprivate var _number: String? = nil - fileprivate var _provisioningCode: String? = nil - fileprivate var _userAgent: String? = nil - fileprivate var _profileKey: Data? = nil - fileprivate var _readReceipts: Bool? = nil -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "ProvisioningProtos" - -extension ProvisioningProtos_ProvisionEnvelope: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".ProvisionEnvelope" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "publicKey"), - 2: .same(proto: "body"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularBytesField(value: &self._publicKey) - case 2: try decoder.decodeSingularBytesField(value: &self._body) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._publicKey { - try visitor.visitSingularBytesField(value: v, fieldNumber: 1) - } - if let v = self._body { - try visitor.visitSingularBytesField(value: v, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: ProvisioningProtos_ProvisionEnvelope, rhs: ProvisioningProtos_ProvisionEnvelope) -> Bool { - if lhs._publicKey != rhs._publicKey {return false} - if lhs._body != rhs._body {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension ProvisioningProtos_ProvisionMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".ProvisionMessage" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "identityKeyPublic"), - 2: .same(proto: "identityKeyPrivate"), - 3: .same(proto: "number"), - 4: .same(proto: "provisioningCode"), - 5: .same(proto: "userAgent"), - 6: .same(proto: "profileKey"), - 7: .same(proto: "readReceipts"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularBytesField(value: &self._identityKeyPublic) - case 2: try decoder.decodeSingularBytesField(value: &self._identityKeyPrivate) - case 3: try decoder.decodeSingularStringField(value: &self._number) - case 4: try decoder.decodeSingularStringField(value: &self._provisioningCode) - case 5: try decoder.decodeSingularStringField(value: &self._userAgent) - case 6: try decoder.decodeSingularBytesField(value: &self._profileKey) - case 7: try decoder.decodeSingularBoolField(value: &self._readReceipts) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._identityKeyPublic { - try visitor.visitSingularBytesField(value: v, fieldNumber: 1) - } - if let v = self._identityKeyPrivate { - try visitor.visitSingularBytesField(value: v, fieldNumber: 2) - } - if let v = self._number { - try visitor.visitSingularStringField(value: v, fieldNumber: 3) - } - if let v = self._provisioningCode { - try visitor.visitSingularStringField(value: v, fieldNumber: 4) - } - if let v = self._userAgent { - try visitor.visitSingularStringField(value: v, fieldNumber: 5) - } - if let v = self._profileKey { - try visitor.visitSingularBytesField(value: v, fieldNumber: 6) - } - if let v = self._readReceipts { - try visitor.visitSingularBoolField(value: v, fieldNumber: 7) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: ProvisioningProtos_ProvisionMessage, rhs: ProvisioningProtos_ProvisionMessage) -> Bool { - if lhs._identityKeyPublic != rhs._identityKeyPublic {return false} - if lhs._identityKeyPrivate != rhs._identityKeyPrivate {return false} - if lhs._number != rhs._number {return false} - if lhs._provisioningCode != rhs._provisioningCode {return false} - if lhs._userAgent != rhs._userAgent {return false} - if lhs._profileKey != rhs._profileKey {return false} - if lhs._readReceipts != rhs._readReceipts {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} diff --git a/SignalUtilitiesKit/ProvisioningProto.swift b/SignalUtilitiesKit/ProvisioningProto.swift deleted file mode 100644 index 4b1f7c948..000000000 --- a/SignalUtilitiesKit/ProvisioningProto.swift +++ /dev/null @@ -1,310 +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 ProvisioningProtoError: Error { - case invalidProtobuf(description: String) -} - -// MARK: - ProvisioningProtoProvisionEnvelope - -@objc public class ProvisioningProtoProvisionEnvelope: NSObject { - - // MARK: - ProvisioningProtoProvisionEnvelopeBuilder - - @objc public class func builder(publicKey: Data, body: Data) -> ProvisioningProtoProvisionEnvelopeBuilder { - return ProvisioningProtoProvisionEnvelopeBuilder(publicKey: publicKey, body: body) - } - - // asBuilder() constructs a builder that reflects the proto's contents. - @objc public func asBuilder() -> ProvisioningProtoProvisionEnvelopeBuilder { - let builder = ProvisioningProtoProvisionEnvelopeBuilder(publicKey: publicKey, body: body) - return builder - } - - @objc public class ProvisioningProtoProvisionEnvelopeBuilder: NSObject { - - private var proto = ProvisioningProtos_ProvisionEnvelope() - - @objc fileprivate override init() {} - - @objc fileprivate init(publicKey: Data, body: Data) { - super.init() - - setPublicKey(publicKey) - setBody(body) - } - - @objc public func setPublicKey(_ valueParam: Data) { - proto.publicKey = valueParam - } - - @objc public func setBody(_ valueParam: Data) { - proto.body = valueParam - } - - @objc public func build() throws -> ProvisioningProtoProvisionEnvelope { - return try ProvisioningProtoProvisionEnvelope.parseProto(proto) - } - - @objc public func buildSerializedData() throws -> Data { - return try ProvisioningProtoProvisionEnvelope.parseProto(proto).serializedData() - } - } - - fileprivate let proto: ProvisioningProtos_ProvisionEnvelope - - @objc public let publicKey: Data - - @objc public let body: Data - - private init(proto: ProvisioningProtos_ProvisionEnvelope, - publicKey: Data, - body: Data) { - self.proto = proto - self.publicKey = publicKey - self.body = body - } - - @objc - public func serializedData() throws -> Data { - return try self.proto.serializedData() - } - - @objc public class func parseData(_ serializedData: Data) throws -> ProvisioningProtoProvisionEnvelope { - let proto = try ProvisioningProtos_ProvisionEnvelope(serializedData: serializedData) - return try parseProto(proto) - } - - fileprivate class func parseProto(_ proto: ProvisioningProtos_ProvisionEnvelope) throws -> ProvisioningProtoProvisionEnvelope { - guard proto.hasPublicKey else { - throw ProvisioningProtoError.invalidProtobuf(description: "\(logTag) missing required field: publicKey") - } - let publicKey = proto.publicKey - - guard proto.hasBody else { - throw ProvisioningProtoError.invalidProtobuf(description: "\(logTag) missing required field: body") - } - let body = proto.body - - // MARK: - Begin Validation Logic for ProvisioningProtoProvisionEnvelope - - - // MARK: - End Validation Logic for ProvisioningProtoProvisionEnvelope - - - let result = ProvisioningProtoProvisionEnvelope(proto: proto, - publicKey: publicKey, - body: body) - return result - } - - @objc public override var debugDescription: String { - return "\(proto)" - } -} - -#if DEBUG - -extension ProvisioningProtoProvisionEnvelope { - @objc public func serializedDataIgnoringErrors() -> Data? { - return try! self.serializedData() - } -} - -extension ProvisioningProtoProvisionEnvelope.ProvisioningProtoProvisionEnvelopeBuilder { - @objc public func buildIgnoringErrors() -> ProvisioningProtoProvisionEnvelope? { - return try! self.build() - } -} - -#endif - -// MARK: - ProvisioningProtoProvisionMessage - -@objc public class ProvisioningProtoProvisionMessage: NSObject { - - // MARK: - ProvisioningProtoProvisionMessageBuilder - - @objc public class func builder(identityKeyPublic: Data, identityKeyPrivate: Data, number: String, provisioningCode: String, userAgent: String, profileKey: Data, readReceipts: Bool) -> ProvisioningProtoProvisionMessageBuilder { - return ProvisioningProtoProvisionMessageBuilder(identityKeyPublic: identityKeyPublic, identityKeyPrivate: identityKeyPrivate, number: number, provisioningCode: provisioningCode, userAgent: userAgent, profileKey: profileKey, readReceipts: readReceipts) - } - - // asBuilder() constructs a builder that reflects the proto's contents. - @objc public func asBuilder() -> ProvisioningProtoProvisionMessageBuilder { - let builder = ProvisioningProtoProvisionMessageBuilder(identityKeyPublic: identityKeyPublic, identityKeyPrivate: identityKeyPrivate, number: number, provisioningCode: provisioningCode, userAgent: userAgent, profileKey: profileKey, readReceipts: readReceipts) - return builder - } - - @objc public class ProvisioningProtoProvisionMessageBuilder: NSObject { - - private var proto = ProvisioningProtos_ProvisionMessage() - - @objc fileprivate override init() {} - - @objc fileprivate init(identityKeyPublic: Data, identityKeyPrivate: Data, number: String, provisioningCode: String, userAgent: String, profileKey: Data, readReceipts: Bool) { - super.init() - - setIdentityKeyPublic(identityKeyPublic) - setIdentityKeyPrivate(identityKeyPrivate) - setNumber(number) - setProvisioningCode(provisioningCode) - setUserAgent(userAgent) - setProfileKey(profileKey) - setReadReceipts(readReceipts) - } - - @objc public func setIdentityKeyPublic(_ valueParam: Data) { - proto.identityKeyPublic = valueParam - } - - @objc public func setIdentityKeyPrivate(_ valueParam: Data) { - proto.identityKeyPrivate = valueParam - } - - @objc public func setNumber(_ valueParam: String) { - proto.number = valueParam - } - - @objc public func setProvisioningCode(_ valueParam: String) { - proto.provisioningCode = valueParam - } - - @objc public func setUserAgent(_ valueParam: String) { - proto.userAgent = valueParam - } - - @objc public func setProfileKey(_ valueParam: Data) { - proto.profileKey = valueParam - } - - @objc public func setReadReceipts(_ valueParam: Bool) { - proto.readReceipts = valueParam - } - - @objc public func build() throws -> ProvisioningProtoProvisionMessage { - return try ProvisioningProtoProvisionMessage.parseProto(proto) - } - - @objc public func buildSerializedData() throws -> Data { - return try ProvisioningProtoProvisionMessage.parseProto(proto).serializedData() - } - } - - fileprivate let proto: ProvisioningProtos_ProvisionMessage - - @objc public let identityKeyPublic: Data - - @objc public let identityKeyPrivate: Data - - @objc public let number: String - - @objc public let provisioningCode: String - - @objc public let userAgent: String - - @objc public let profileKey: Data - - @objc public let readReceipts: Bool - - private init(proto: ProvisioningProtos_ProvisionMessage, - identityKeyPublic: Data, - identityKeyPrivate: Data, - number: String, - provisioningCode: String, - userAgent: String, - profileKey: Data, - readReceipts: Bool) { - self.proto = proto - self.identityKeyPublic = identityKeyPublic - self.identityKeyPrivate = identityKeyPrivate - self.number = number - self.provisioningCode = provisioningCode - self.userAgent = userAgent - self.profileKey = profileKey - self.readReceipts = readReceipts - } - - @objc - public func serializedData() throws -> Data { - return try self.proto.serializedData() - } - - @objc public class func parseData(_ serializedData: Data) throws -> ProvisioningProtoProvisionMessage { - let proto = try ProvisioningProtos_ProvisionMessage(serializedData: serializedData) - return try parseProto(proto) - } - - fileprivate class func parseProto(_ proto: ProvisioningProtos_ProvisionMessage) throws -> ProvisioningProtoProvisionMessage { - guard proto.hasIdentityKeyPublic else { - throw ProvisioningProtoError.invalidProtobuf(description: "\(logTag) missing required field: identityKeyPublic") - } - let identityKeyPublic = proto.identityKeyPublic - - guard proto.hasIdentityKeyPrivate else { - throw ProvisioningProtoError.invalidProtobuf(description: "\(logTag) missing required field: identityKeyPrivate") - } - let identityKeyPrivate = proto.identityKeyPrivate - - guard proto.hasNumber else { - throw ProvisioningProtoError.invalidProtobuf(description: "\(logTag) missing required field: number") - } - let number = proto.number - - guard proto.hasProvisioningCode else { - throw ProvisioningProtoError.invalidProtobuf(description: "\(logTag) missing required field: provisioningCode") - } - let provisioningCode = proto.provisioningCode - - guard proto.hasUserAgent else { - throw ProvisioningProtoError.invalidProtobuf(description: "\(logTag) missing required field: userAgent") - } - let userAgent = proto.userAgent - - guard proto.hasProfileKey else { - throw ProvisioningProtoError.invalidProtobuf(description: "\(logTag) missing required field: profileKey") - } - let profileKey = proto.profileKey - - guard proto.hasReadReceipts else { - throw ProvisioningProtoError.invalidProtobuf(description: "\(logTag) missing required field: readReceipts") - } - let readReceipts = proto.readReceipts - - // MARK: - Begin Validation Logic for ProvisioningProtoProvisionMessage - - - // MARK: - End Validation Logic for ProvisioningProtoProvisionMessage - - - let result = ProvisioningProtoProvisionMessage(proto: proto, - identityKeyPublic: identityKeyPublic, - identityKeyPrivate: identityKeyPrivate, - number: number, - provisioningCode: provisioningCode, - userAgent: userAgent, - profileKey: profileKey, - readReceipts: readReceipts) - return result - } - - @objc public override var debugDescription: String { - return "\(proto)" - } -} - -#if DEBUG - -extension ProvisioningProtoProvisionMessage { - @objc public func serializedDataIgnoringErrors() -> Data? { - return try! self.serializedData() - } -} - -extension ProvisioningProtoProvisionMessage.ProvisioningProtoProvisionMessageBuilder { - @objc public func buildIgnoringErrors() -> ProvisioningProtoProvisionMessage? { - return try! self.build() - } -} - -#endif diff --git a/SignalUtilitiesKit/ClosedGroupsProtocol.swift b/SignalUtilitiesKit/Remove/ClosedGroupsProtocol.swift similarity index 100% rename from SignalUtilitiesKit/ClosedGroupsProtocol.swift rename to SignalUtilitiesKit/Remove/ClosedGroupsProtocol.swift diff --git a/SignalUtilitiesKit/Remove Later/ContactCellView.h b/SignalUtilitiesKit/Remove/ContactCellView.h similarity index 100% rename from SignalUtilitiesKit/Remove Later/ContactCellView.h rename to SignalUtilitiesKit/Remove/ContactCellView.h diff --git a/SignalUtilitiesKit/Remove Later/ContactCellView.m b/SignalUtilitiesKit/Remove/ContactCellView.m similarity index 100% rename from SignalUtilitiesKit/Remove Later/ContactCellView.m rename to SignalUtilitiesKit/Remove/ContactCellView.m diff --git a/SignalUtilitiesKit/Remove Later/ContactTableViewCell.h b/SignalUtilitiesKit/Remove/ContactTableViewCell.h similarity index 100% rename from SignalUtilitiesKit/Remove Later/ContactTableViewCell.h rename to SignalUtilitiesKit/Remove/ContactTableViewCell.h diff --git a/SignalUtilitiesKit/Remove Later/ContactTableViewCell.m b/SignalUtilitiesKit/Remove/ContactTableViewCell.m similarity index 100% rename from SignalUtilitiesKit/Remove Later/ContactTableViewCell.m rename to SignalUtilitiesKit/Remove/ContactTableViewCell.m diff --git a/SignalUtilitiesKit/Remove Later/DisplayNameUtilities.swift b/SignalUtilitiesKit/Remove/DisplayNameUtilities.swift similarity index 100% rename from SignalUtilitiesKit/Remove Later/DisplayNameUtilities.swift rename to SignalUtilitiesKit/Remove/DisplayNameUtilities.swift diff --git a/SignalUtilitiesKit/Remove Later/DisplayNameUtilities2.swift b/SignalUtilitiesKit/Remove/DisplayNameUtilities2.swift similarity index 100% rename from SignalUtilitiesKit/Remove Later/DisplayNameUtilities2.swift rename to SignalUtilitiesKit/Remove/DisplayNameUtilities2.swift diff --git a/SignalUtilitiesKit/Utilities/GroupUtilities.swift b/SignalUtilitiesKit/Remove/GroupUtilities.swift similarity index 100% rename from SignalUtilitiesKit/Utilities/GroupUtilities.swift rename to SignalUtilitiesKit/Remove/GroupUtilities.swift diff --git a/SignalUtilitiesKit/Remove Later/OWSProfileManager.h b/SignalUtilitiesKit/Remove/OWSProfileManager.h similarity index 100% rename from SignalUtilitiesKit/Remove Later/OWSProfileManager.h rename to SignalUtilitiesKit/Remove/OWSProfileManager.h diff --git a/SignalUtilitiesKit/Remove Later/OWSProfileManager.m b/SignalUtilitiesKit/Remove/OWSProfileManager.m similarity index 100% rename from SignalUtilitiesKit/Remove Later/OWSProfileManager.m rename to SignalUtilitiesKit/Remove/OWSProfileManager.m diff --git a/SignalUtilitiesKit/Remove Later/OWSUserProfile.h b/SignalUtilitiesKit/Remove/OWSUserProfile.h similarity index 100% rename from SignalUtilitiesKit/Remove Later/OWSUserProfile.h rename to SignalUtilitiesKit/Remove/OWSUserProfile.h diff --git a/SignalUtilitiesKit/Remove Later/OWSUserProfile.m b/SignalUtilitiesKit/Remove/OWSUserProfile.m similarity index 100% rename from SignalUtilitiesKit/Remove Later/OWSUserProfile.m rename to SignalUtilitiesKit/Remove/OWSUserProfile.m diff --git a/SignalUtilitiesKit/Remove Later/ProfileManagerProtocol.h b/SignalUtilitiesKit/Remove/ProfileManagerProtocol.h similarity index 100% rename from SignalUtilitiesKit/Remove Later/ProfileManagerProtocol.h rename to SignalUtilitiesKit/Remove/ProfileManagerProtocol.h diff --git a/SignalUtilitiesKit/Remove Later/SessionManagementProtocol.swift b/SignalUtilitiesKit/Remove/SessionManagementProtocol.swift similarity index 100% rename from SignalUtilitiesKit/Remove Later/SessionManagementProtocol.swift rename to SignalUtilitiesKit/Remove/SessionManagementProtocol.swift diff --git a/SignalUtilitiesKit/Remove Later/SessionMetaProtocol.swift b/SignalUtilitiesKit/Remove/SessionMetaProtocol.swift similarity index 100% rename from SignalUtilitiesKit/Remove Later/SessionMetaProtocol.swift rename to SignalUtilitiesKit/Remove/SessionMetaProtocol.swift diff --git a/SignalUtilitiesKit/RotateSignedKeyOperation.swift b/SignalUtilitiesKit/RotateSignedKeyOperation.swift index 578cb77f7..0142e69d7 100644 --- a/SignalUtilitiesKit/RotateSignedKeyOperation.swift +++ b/SignalUtilitiesKit/RotateSignedKeyOperation.swift @@ -11,10 +11,6 @@ public class RotateSignedPreKeyOperation: OWSOperation { return TSAccountManager.sharedInstance() } - private var primaryStorage: OWSPrimaryStorage { - return OWSPrimaryStorage.shared() - } - public override func run() { Logger.debug("") @@ -24,7 +20,14 @@ public class RotateSignedPreKeyOperation: OWSOperation { } DispatchQueue.global().async { - SessionManagementProtocol.rotateSignedPreKey() + let storage = OWSPrimaryStorage.shared() + let signedPreKeyRecord = storage.generateRandomSignedRecord() + signedPreKeyRecord.markAsAcceptedByService() + storage.storeSignedPreKey(signedPreKeyRecord.id, signedPreKeyRecord: signedPreKeyRecord) + storage.setCurrentSignedPrekeyId(signedPreKeyRecord.id) + TSPreKeyManager.clearPreKeyUpdateFailureCount() + TSPreKeyManager.clearSignedPreKeyRecords() + print("[Loki] Signed pre key rotated successfully.") self.reportSuccess() } } diff --git a/SignalUtilitiesKit/SignalMessage.swift b/SignalUtilitiesKit/SignalMessage.swift deleted file mode 100644 index 96920b7b7..000000000 --- a/SignalUtilitiesKit/SignalMessage.swift +++ /dev/null @@ -1,28 +0,0 @@ - -@objc(LKSignalMessage) -public final class SignalMessage : NSObject { - @objc public let type: SNProtoEnvelope.SNProtoEnvelopeType - @objc public let timestamp: UInt64 - @objc public let senderPublicKey: String - @objc public let senderDeviceID: UInt32 - @objc public let content: String - @objc public let recipientPublicKey: String - @objc(ttl) - public let objc_ttl: UInt64 - @objc public let isPing: Bool - - public var ttl: UInt64? { return objc_ttl != 0 ? objc_ttl : nil } - - @objc public init(type: SNProtoEnvelope.SNProtoEnvelopeType, timestamp: UInt64, senderID: String, senderDeviceID: UInt32, - content: String, recipientID: String, ttl: UInt64, isPing: Bool) { - self.type = type - self.timestamp = timestamp - self.senderPublicKey = senderID - self.senderDeviceID = senderDeviceID - self.content = content - self.recipientPublicKey = recipientID - self.objc_ttl = ttl - self.isPing = isPing - super.init() - } -} diff --git a/SignalUtilitiesKit/SignalService.pb.swift b/SignalUtilitiesKit/SignalService.pb.swift deleted file mode 100644 index ac386523f..000000000 --- a/SignalUtilitiesKit/SignalService.pb.swift +++ /dev/null @@ -1,5199 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: SignalService.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -//* -// Copyright (C) 2014-2016 Open Whisper Systems -// -// Licensed according to the LICENSE file in this repository. - -/// 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 SignalServiceProtos_Envelope { - // 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 type: SignalServiceProtos_Envelope.TypeEnum { - get {return _type ?? .unknown} - set {_type = newValue} - } - /// Returns true if `type` has been explicitly set. - var hasType: Bool {return self._type != nil} - /// Clears the value of `type`. Subsequent reads from it will return its default value. - mutating func clearType() {self._type = nil} - - var source: String { - get {return _source ?? String()} - set {_source = newValue} - } - /// Returns true if `source` has been explicitly set. - var hasSource: Bool {return self._source != nil} - /// Clears the value of `source`. Subsequent reads from it will return its default value. - mutating func clearSource() {self._source = nil} - - var sourceDevice: UInt32 { - get {return _sourceDevice ?? 0} - set {_sourceDevice = newValue} - } - /// Returns true if `sourceDevice` has been explicitly set. - var hasSourceDevice: Bool {return self._sourceDevice != nil} - /// Clears the value of `sourceDevice`. Subsequent reads from it will return its default value. - mutating func clearSourceDevice() {self._sourceDevice = nil} - - var relay: String { - get {return _relay ?? String()} - set {_relay = newValue} - } - /// Returns true if `relay` has been explicitly set. - var hasRelay: Bool {return self._relay != nil} - /// Clears the value of `relay`. Subsequent reads from it will return its default value. - mutating func clearRelay() {self._relay = nil} - - /// @required - var timestamp: UInt64 { - get {return _timestamp ?? 0} - set {_timestamp = newValue} - } - /// Returns true if `timestamp` has been explicitly set. - var hasTimestamp: Bool {return self._timestamp != nil} - /// Clears the value of `timestamp`. Subsequent reads from it will return its default value. - mutating func clearTimestamp() {self._timestamp = nil} - - /// Contains an encrypted DataMessage - var legacyMessage: Data { - get {return _legacyMessage ?? SwiftProtobuf.Internal.emptyData} - set {_legacyMessage = newValue} - } - /// Returns true if `legacyMessage` has been explicitly set. - var hasLegacyMessage: Bool {return self._legacyMessage != nil} - /// Clears the value of `legacyMessage`. Subsequent reads from it will return its default value. - mutating func clearLegacyMessage() {self._legacyMessage = nil} - - /// Contains an encrypted Content - var content: Data { - get {return _content ?? SwiftProtobuf.Internal.emptyData} - set {_content = newValue} - } - /// Returns true if `content` has been explicitly set. - var hasContent: Bool {return self._content != nil} - /// Clears the value of `content`. Subsequent reads from it will return its default value. - mutating func clearContent() {self._content = nil} - - /// We may eventually want to make this required. - var serverGuid: String { - get {return _serverGuid ?? String()} - set {_serverGuid = newValue} - } - /// Returns true if `serverGuid` has been explicitly set. - var hasServerGuid: Bool {return self._serverGuid != nil} - /// Clears the value of `serverGuid`. Subsequent reads from it will return its default value. - mutating func clearServerGuid() {self._serverGuid = nil} - - /// We may eventually want to make this required. - var serverTimestamp: UInt64 { - get {return _serverTimestamp ?? 0} - set {_serverTimestamp = newValue} - } - /// Returns true if `serverTimestamp` has been explicitly set. - var hasServerTimestamp: Bool {return self._serverTimestamp != nil} - /// Clears the value of `serverTimestamp`. Subsequent reads from it will return its default value. - mutating func clearServerTimestamp() {self._serverTimestamp = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - enum TypeEnum: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknown // = 0 - case ciphertext // = 1 - case keyExchange // = 2 - case prekeyBundle // = 3 - case receipt // = 5 - case unidentifiedSender // = 6 - - /// Loki - case closedGroupCiphertext // = 7 - - /// Loki: Encrypted using the fallback session cipher. Contains a pre key bundle if it's a session request. - case fallbackMessage // = 101 - - init() { - self = .unknown - } - - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .ciphertext - case 2: self = .keyExchange - case 3: self = .prekeyBundle - case 5: self = .receipt - case 6: self = .unidentifiedSender - case 7: self = .closedGroupCiphertext - case 101: self = .fallbackMessage - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknown: return 0 - case .ciphertext: return 1 - case .keyExchange: return 2 - case .prekeyBundle: return 3 - case .receipt: return 5 - case .unidentifiedSender: return 6 - case .closedGroupCiphertext: return 7 - case .fallbackMessage: return 101 - } - } - - } - - init() {} - - fileprivate var _type: SignalServiceProtos_Envelope.TypeEnum? = nil - fileprivate var _source: String? = nil - fileprivate var _sourceDevice: UInt32? = nil - fileprivate var _relay: String? = nil - fileprivate var _timestamp: UInt64? = nil - fileprivate var _legacyMessage: Data? = nil - fileprivate var _content: Data? = nil - fileprivate var _serverGuid: String? = nil - fileprivate var _serverTimestamp: UInt64? = nil -} - -#if swift(>=4.2) - -extension SignalServiceProtos_Envelope.TypeEnum: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - -struct SignalServiceProtos_TypingMessage { - // 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 timestamp: UInt64 { - get {return _timestamp ?? 0} - set {_timestamp = newValue} - } - /// Returns true if `timestamp` has been explicitly set. - var hasTimestamp: Bool {return self._timestamp != nil} - /// Clears the value of `timestamp`. Subsequent reads from it will return its default value. - mutating func clearTimestamp() {self._timestamp = nil} - - /// @required - var action: SignalServiceProtos_TypingMessage.Action { - get {return _action ?? .started} - set {_action = newValue} - } - /// Returns true if `action` has been explicitly set. - var hasAction: Bool {return self._action != nil} - /// Clears the value of `action`. Subsequent reads from it will return its default value. - mutating func clearAction() {self._action = nil} - - var groupID: Data { - get {return _groupID ?? SwiftProtobuf.Internal.emptyData} - set {_groupID = newValue} - } - /// Returns true if `groupID` has been explicitly set. - var hasGroupID: Bool {return self._groupID != nil} - /// Clears the value of `groupID`. Subsequent reads from it will return its default value. - mutating func clearGroupID() {self._groupID = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - enum Action: SwiftProtobuf.Enum { - typealias RawValue = Int - case started // = 0 - case stopped // = 1 - - init() { - self = .started - } - - init?(rawValue: Int) { - switch rawValue { - case 0: self = .started - case 1: self = .stopped - default: return nil - } - } - - var rawValue: Int { - switch self { - case .started: return 0 - case .stopped: return 1 - } - } - - } - - init() {} - - fileprivate var _timestamp: UInt64? = nil - fileprivate var _action: SignalServiceProtos_TypingMessage.Action? = nil - fileprivate var _groupID: Data? = nil -} - -#if swift(>=4.2) - -extension SignalServiceProtos_TypingMessage.Action: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - -struct SignalServiceProtos_Content { - // 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. - - var dataMessage: SignalServiceProtos_DataMessage { - get {return _dataMessage ?? SignalServiceProtos_DataMessage()} - set {_dataMessage = newValue} - } - /// Returns true if `dataMessage` has been explicitly set. - var hasDataMessage: Bool {return self._dataMessage != nil} - /// Clears the value of `dataMessage`. Subsequent reads from it will return its default value. - mutating func clearDataMessage() {self._dataMessage = nil} - - var syncMessage: SignalServiceProtos_SyncMessage { - get {return _syncMessage ?? SignalServiceProtos_SyncMessage()} - set {_syncMessage = newValue} - } - /// Returns true if `syncMessage` has been explicitly set. - var hasSyncMessage: Bool {return self._syncMessage != nil} - /// Clears the value of `syncMessage`. Subsequent reads from it will return its default value. - mutating func clearSyncMessage() {self._syncMessage = nil} - - var callMessage: SignalServiceProtos_CallMessage { - get {return _callMessage ?? SignalServiceProtos_CallMessage()} - set {_callMessage = newValue} - } - /// Returns true if `callMessage` has been explicitly set. - var hasCallMessage: Bool {return self._callMessage != nil} - /// Clears the value of `callMessage`. Subsequent reads from it will return its default value. - mutating func clearCallMessage() {self._callMessage = nil} - - var nullMessage: SignalServiceProtos_NullMessage { - get {return _nullMessage ?? SignalServiceProtos_NullMessage()} - set {_nullMessage = newValue} - } - /// Returns true if `nullMessage` has been explicitly set. - var hasNullMessage: Bool {return self._nullMessage != nil} - /// Clears the value of `nullMessage`. Subsequent reads from it will return its default value. - mutating func clearNullMessage() {self._nullMessage = nil} - - var receiptMessage: SignalServiceProtos_ReceiptMessage { - get {return _receiptMessage ?? SignalServiceProtos_ReceiptMessage()} - set {_receiptMessage = newValue} - } - /// Returns true if `receiptMessage` has been explicitly set. - var hasReceiptMessage: Bool {return self._receiptMessage != nil} - /// Clears the value of `receiptMessage`. Subsequent reads from it will return its default value. - mutating func clearReceiptMessage() {self._receiptMessage = nil} - - var typingMessage: SignalServiceProtos_TypingMessage { - get {return _typingMessage ?? SignalServiceProtos_TypingMessage()} - set {_typingMessage = newValue} - } - /// Returns true if `typingMessage` has been explicitly set. - var hasTypingMessage: Bool {return self._typingMessage != nil} - /// Clears the value of `typingMessage`. Subsequent reads from it will return its default value. - mutating func clearTypingMessage() {self._typingMessage = nil} - - /// Loki - var prekeyBundleMessage: SignalServiceProtos_PrekeyBundleMessage { - get {return _prekeyBundleMessage ?? SignalServiceProtos_PrekeyBundleMessage()} - set {_prekeyBundleMessage = newValue} - } - /// Returns true if `prekeyBundleMessage` has been explicitly set. - var hasPrekeyBundleMessage: Bool {return self._prekeyBundleMessage != nil} - /// Clears the value of `prekeyBundleMessage`. Subsequent reads from it will return its default value. - mutating func clearPrekeyBundleMessage() {self._prekeyBundleMessage = nil} - - /// Loki - var lokiDeviceLinkMessage: SignalServiceProtos_LokiDeviceLinkMessage { - get {return _lokiDeviceLinkMessage ?? SignalServiceProtos_LokiDeviceLinkMessage()} - set {_lokiDeviceLinkMessage = newValue} - } - /// Returns true if `lokiDeviceLinkMessage` has been explicitly set. - var hasLokiDeviceLinkMessage: Bool {return self._lokiDeviceLinkMessage != nil} - /// Clears the value of `lokiDeviceLinkMessage`. Subsequent reads from it will return its default value. - mutating func clearLokiDeviceLinkMessage() {self._lokiDeviceLinkMessage = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _dataMessage: SignalServiceProtos_DataMessage? = nil - fileprivate var _syncMessage: SignalServiceProtos_SyncMessage? = nil - fileprivate var _callMessage: SignalServiceProtos_CallMessage? = nil - fileprivate var _nullMessage: SignalServiceProtos_NullMessage? = nil - fileprivate var _receiptMessage: SignalServiceProtos_ReceiptMessage? = nil - fileprivate var _typingMessage: SignalServiceProtos_TypingMessage? = nil - fileprivate var _prekeyBundleMessage: SignalServiceProtos_PrekeyBundleMessage? = nil - fileprivate var _lokiDeviceLinkMessage: SignalServiceProtos_LokiDeviceLinkMessage? = nil -} - -/// Loki -struct SignalServiceProtos_PrekeyBundleMessage { - // 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. - - var identityKey: Data { - get {return _identityKey ?? SwiftProtobuf.Internal.emptyData} - set {_identityKey = newValue} - } - /// Returns true if `identityKey` has been explicitly set. - var hasIdentityKey: Bool {return self._identityKey != nil} - /// Clears the value of `identityKey`. Subsequent reads from it will return its default value. - mutating func clearIdentityKey() {self._identityKey = nil} - - var deviceID: UInt32 { - get {return _deviceID ?? 0} - set {_deviceID = newValue} - } - /// Returns true if `deviceID` has been explicitly set. - var hasDeviceID: Bool {return self._deviceID != nil} - /// Clears the value of `deviceID`. Subsequent reads from it will return its default value. - mutating func clearDeviceID() {self._deviceID = nil} - - var prekeyID: UInt32 { - get {return _prekeyID ?? 0} - set {_prekeyID = newValue} - } - /// Returns true if `prekeyID` has been explicitly set. - var hasPrekeyID: Bool {return self._prekeyID != nil} - /// Clears the value of `prekeyID`. Subsequent reads from it will return its default value. - mutating func clearPrekeyID() {self._prekeyID = nil} - - var signedKeyID: UInt32 { - get {return _signedKeyID ?? 0} - set {_signedKeyID = newValue} - } - /// Returns true if `signedKeyID` has been explicitly set. - var hasSignedKeyID: Bool {return self._signedKeyID != nil} - /// Clears the value of `signedKeyID`. Subsequent reads from it will return its default value. - mutating func clearSignedKeyID() {self._signedKeyID = nil} - - var prekey: Data { - get {return _prekey ?? SwiftProtobuf.Internal.emptyData} - set {_prekey = newValue} - } - /// Returns true if `prekey` has been explicitly set. - var hasPrekey: Bool {return self._prekey != nil} - /// Clears the value of `prekey`. Subsequent reads from it will return its default value. - mutating func clearPrekey() {self._prekey = nil} - - var signedKey: Data { - get {return _signedKey ?? SwiftProtobuf.Internal.emptyData} - set {_signedKey = newValue} - } - /// Returns true if `signedKey` has been explicitly set. - var hasSignedKey: Bool {return self._signedKey != nil} - /// Clears the value of `signedKey`. Subsequent reads from it will return its default value. - mutating func clearSignedKey() {self._signedKey = nil} - - var signature: Data { - get {return _signature ?? SwiftProtobuf.Internal.emptyData} - set {_signature = newValue} - } - /// Returns true if `signature` has been explicitly set. - var hasSignature: Bool {return self._signature != nil} - /// Clears the value of `signature`. Subsequent reads from it will return its default value. - mutating func clearSignature() {self._signature = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _identityKey: Data? = nil - fileprivate var _deviceID: UInt32? = nil - fileprivate var _prekeyID: UInt32? = nil - fileprivate var _signedKeyID: UInt32? = nil - fileprivate var _prekey: Data? = nil - fileprivate var _signedKey: Data? = nil - fileprivate var _signature: Data? = nil -} - -/// Loki -struct SignalServiceProtos_LokiDeviceLinkMessage { - // 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. - - var masterPublicKey: String { - get {return _masterPublicKey ?? String()} - set {_masterPublicKey = newValue} - } - /// Returns true if `masterPublicKey` has been explicitly set. - var hasMasterPublicKey: Bool {return self._masterPublicKey != nil} - /// Clears the value of `masterPublicKey`. Subsequent reads from it will return its default value. - mutating func clearMasterPublicKey() {self._masterPublicKey = nil} - - var slavePublicKey: String { - get {return _slavePublicKey ?? String()} - set {_slavePublicKey = newValue} - } - /// Returns true if `slavePublicKey` has been explicitly set. - var hasSlavePublicKey: Bool {return self._slavePublicKey != nil} - /// Clears the value of `slavePublicKey`. Subsequent reads from it will return its default value. - mutating func clearSlavePublicKey() {self._slavePublicKey = nil} - - var slaveSignature: Data { - get {return _slaveSignature ?? SwiftProtobuf.Internal.emptyData} - set {_slaveSignature = newValue} - } - /// Returns true if `slaveSignature` has been explicitly set. - var hasSlaveSignature: Bool {return self._slaveSignature != nil} - /// Clears the value of `slaveSignature`. Subsequent reads from it will return its default value. - mutating func clearSlaveSignature() {self._slaveSignature = nil} - - var masterSignature: Data { - get {return _masterSignature ?? SwiftProtobuf.Internal.emptyData} - set {_masterSignature = newValue} - } - /// Returns true if `masterSignature` has been explicitly set. - var hasMasterSignature: Bool {return self._masterSignature != nil} - /// Clears the value of `masterSignature`. Subsequent reads from it will return its default value. - mutating func clearMasterSignature() {self._masterSignature = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _masterPublicKey: String? = nil - fileprivate var _slavePublicKey: String? = nil - fileprivate var _slaveSignature: Data? = nil - fileprivate var _masterSignature: Data? = nil -} - -struct SignalServiceProtos_CallMessage { - // 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. - - var offer: SignalServiceProtos_CallMessage.Offer { - get {return _offer ?? SignalServiceProtos_CallMessage.Offer()} - set {_offer = newValue} - } - /// Returns true if `offer` has been explicitly set. - var hasOffer: Bool {return self._offer != nil} - /// Clears the value of `offer`. Subsequent reads from it will return its default value. - mutating func clearOffer() {self._offer = nil} - - var answer: SignalServiceProtos_CallMessage.Answer { - get {return _answer ?? SignalServiceProtos_CallMessage.Answer()} - set {_answer = newValue} - } - /// Returns true if `answer` has been explicitly set. - var hasAnswer: Bool {return self._answer != nil} - /// Clears the value of `answer`. Subsequent reads from it will return its default value. - mutating func clearAnswer() {self._answer = nil} - - var iceUpdate: [SignalServiceProtos_CallMessage.IceUpdate] = [] - - var hangup: SignalServiceProtos_CallMessage.Hangup { - get {return _hangup ?? SignalServiceProtos_CallMessage.Hangup()} - set {_hangup = newValue} - } - /// Returns true if `hangup` has been explicitly set. - var hasHangup: Bool {return self._hangup != nil} - /// Clears the value of `hangup`. Subsequent reads from it will return its default value. - mutating func clearHangup() {self._hangup = nil} - - var busy: SignalServiceProtos_CallMessage.Busy { - get {return _busy ?? SignalServiceProtos_CallMessage.Busy()} - set {_busy = newValue} - } - /// Returns true if `busy` has been explicitly set. - var hasBusy: Bool {return self._busy != nil} - /// Clears the value of `busy`. Subsequent reads from it will return its default value. - mutating func clearBusy() {self._busy = nil} - - /// Signal-iOS sends profile key with call messages - /// for earlier discovery - var profileKey: Data { - get {return _profileKey ?? SwiftProtobuf.Internal.emptyData} - set {_profileKey = newValue} - } - /// Returns true if `profileKey` has been explicitly set. - var hasProfileKey: Bool {return self._profileKey != nil} - /// Clears the value of `profileKey`. Subsequent reads from it will return its default value. - mutating func clearProfileKey() {self._profileKey = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - struct Offer { - // 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 id: UInt64 { - get {return _id ?? 0} - set {_id = newValue} - } - /// Returns true if `id` has been explicitly set. - var hasID: Bool {return self._id != nil} - /// Clears the value of `id`. Subsequent reads from it will return its default value. - mutating func clearID() {self._id = nil} - - /// Signal-iOS renamed the description field to avoid - /// conflicts with [NSObject description]. - /// @required - var sessionDescription: String { - get {return _sessionDescription ?? String()} - set {_sessionDescription = newValue} - } - /// Returns true if `sessionDescription` has been explicitly set. - var hasSessionDescription: Bool {return self._sessionDescription != nil} - /// Clears the value of `sessionDescription`. Subsequent reads from it will return its default value. - mutating func clearSessionDescription() {self._sessionDescription = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _id: UInt64? = nil - fileprivate var _sessionDescription: String? = nil - } - - struct Answer { - // 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 id: UInt64 { - get {return _id ?? 0} - set {_id = newValue} - } - /// Returns true if `id` has been explicitly set. - var hasID: Bool {return self._id != nil} - /// Clears the value of `id`. Subsequent reads from it will return its default value. - mutating func clearID() {self._id = nil} - - /// Signal-iOS renamed the description field to avoid - /// conflicts with [NSObject description]. - /// @required - var sessionDescription: String { - get {return _sessionDescription ?? String()} - set {_sessionDescription = newValue} - } - /// Returns true if `sessionDescription` has been explicitly set. - var hasSessionDescription: Bool {return self._sessionDescription != nil} - /// Clears the value of `sessionDescription`. Subsequent reads from it will return its default value. - mutating func clearSessionDescription() {self._sessionDescription = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _id: UInt64? = nil - fileprivate var _sessionDescription: String? = nil - } - - struct IceUpdate { - // 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 id: UInt64 { - get {return _id ?? 0} - set {_id = newValue} - } - /// Returns true if `id` has been explicitly set. - var hasID: Bool {return self._id != nil} - /// Clears the value of `id`. Subsequent reads from it will return its default value. - mutating func clearID() {self._id = nil} - - /// @required - var sdpMid: String { - get {return _sdpMid ?? String()} - set {_sdpMid = newValue} - } - /// Returns true if `sdpMid` has been explicitly set. - var hasSdpMid: Bool {return self._sdpMid != nil} - /// Clears the value of `sdpMid`. Subsequent reads from it will return its default value. - mutating func clearSdpMid() {self._sdpMid = nil} - - /// @required - var sdpMlineIndex: UInt32 { - get {return _sdpMlineIndex ?? 0} - set {_sdpMlineIndex = newValue} - } - /// Returns true if `sdpMlineIndex` has been explicitly set. - var hasSdpMlineIndex: Bool {return self._sdpMlineIndex != nil} - /// Clears the value of `sdpMlineIndex`. Subsequent reads from it will return its default value. - mutating func clearSdpMlineIndex() {self._sdpMlineIndex = nil} - - /// @required - var sdp: String { - get {return _sdp ?? String()} - set {_sdp = newValue} - } - /// Returns true if `sdp` has been explicitly set. - var hasSdp: Bool {return self._sdp != nil} - /// Clears the value of `sdp`. Subsequent reads from it will return its default value. - mutating func clearSdp() {self._sdp = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _id: UInt64? = nil - fileprivate var _sdpMid: String? = nil - fileprivate var _sdpMlineIndex: UInt32? = nil - fileprivate var _sdp: String? = nil - } - - struct Busy { - // 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 id: UInt64 { - get {return _id ?? 0} - set {_id = newValue} - } - /// Returns true if `id` has been explicitly set. - var hasID: Bool {return self._id != nil} - /// Clears the value of `id`. Subsequent reads from it will return its default value. - mutating func clearID() {self._id = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _id: UInt64? = nil - } - - struct Hangup { - // 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 id: UInt64 { - get {return _id ?? 0} - set {_id = newValue} - } - /// Returns true if `id` has been explicitly set. - var hasID: Bool {return self._id != nil} - /// Clears the value of `id`. Subsequent reads from it will return its default value. - mutating func clearID() {self._id = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _id: UInt64? = nil - } - - init() {} - - fileprivate var _offer: SignalServiceProtos_CallMessage.Offer? = nil - fileprivate var _answer: SignalServiceProtos_CallMessage.Answer? = nil - fileprivate var _hangup: SignalServiceProtos_CallMessage.Hangup? = nil - fileprivate var _busy: SignalServiceProtos_CallMessage.Busy? = nil - fileprivate var _profileKey: Data? = nil -} - -struct SignalServiceProtos_ClosedGroupCiphertextMessageWrapper { - // 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 ciphertext: Data { - get {return _ciphertext ?? SwiftProtobuf.Internal.emptyData} - set {_ciphertext = newValue} - } - /// Returns true if `ciphertext` has been explicitly set. - var hasCiphertext: Bool {return self._ciphertext != nil} - /// Clears the value of `ciphertext`. Subsequent reads from it will return its default value. - mutating func clearCiphertext() {self._ciphertext = nil} - - /// @required - var ephemeralPublicKey: Data { - get {return _ephemeralPublicKey ?? SwiftProtobuf.Internal.emptyData} - set {_ephemeralPublicKey = newValue} - } - /// Returns true if `ephemeralPublicKey` has been explicitly set. - var hasEphemeralPublicKey: Bool {return self._ephemeralPublicKey != nil} - /// Clears the value of `ephemeralPublicKey`. Subsequent reads from it will return its default value. - mutating func clearEphemeralPublicKey() {self._ephemeralPublicKey = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _ciphertext: Data? = nil - fileprivate var _ephemeralPublicKey: Data? = nil -} - -struct SignalServiceProtos_DataMessage { - // 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. - - var body: String { - get {return _body ?? String()} - set {_body = newValue} - } - /// Returns true if `body` has been explicitly set. - var hasBody: Bool {return self._body != nil} - /// Clears the value of `body`. Subsequent reads from it will return its default value. - mutating func clearBody() {self._body = nil} - - var attachments: [SignalServiceProtos_AttachmentPointer] = [] - - var group: SignalServiceProtos_GroupContext { - get {return _group ?? SignalServiceProtos_GroupContext()} - set {_group = newValue} - } - /// Returns true if `group` has been explicitly set. - var hasGroup: Bool {return self._group != nil} - /// Clears the value of `group`. Subsequent reads from it will return its default value. - mutating func clearGroup() {self._group = nil} - - var flags: UInt32 { - get {return _flags ?? 0} - set {_flags = newValue} - } - /// Returns true if `flags` has been explicitly set. - var hasFlags: Bool {return self._flags != nil} - /// Clears the value of `flags`. Subsequent reads from it will return its default value. - mutating func clearFlags() {self._flags = nil} - - var expireTimer: UInt32 { - get {return _expireTimer ?? 0} - set {_expireTimer = newValue} - } - /// Returns true if `expireTimer` has been explicitly set. - var hasExpireTimer: Bool {return self._expireTimer != nil} - /// Clears the value of `expireTimer`. Subsequent reads from it will return its default value. - mutating func clearExpireTimer() {self._expireTimer = nil} - - var profileKey: Data { - get {return _profileKey ?? SwiftProtobuf.Internal.emptyData} - set {_profileKey = newValue} - } - /// Returns true if `profileKey` has been explicitly set. - var hasProfileKey: Bool {return self._profileKey != nil} - /// Clears the value of `profileKey`. Subsequent reads from it will return its default value. - mutating func clearProfileKey() {self._profileKey = nil} - - var timestamp: UInt64 { - get {return _timestamp ?? 0} - set {_timestamp = newValue} - } - /// Returns true if `timestamp` has been explicitly set. - var hasTimestamp: Bool {return self._timestamp != nil} - /// Clears the value of `timestamp`. Subsequent reads from it will return its default value. - mutating func clearTimestamp() {self._timestamp = nil} - - var quote: SignalServiceProtos_DataMessage.Quote { - get {return _quote ?? SignalServiceProtos_DataMessage.Quote()} - set {_quote = newValue} - } - /// Returns true if `quote` has been explicitly set. - var hasQuote: Bool {return self._quote != nil} - /// Clears the value of `quote`. Subsequent reads from it will return its default value. - mutating func clearQuote() {self._quote = nil} - - var contact: [SignalServiceProtos_DataMessage.Contact] = [] - - var preview: [SignalServiceProtos_DataMessage.Preview] = [] - - /// Loki: The current user's profile - var profile: SignalServiceProtos_DataMessage.LokiProfile { - get {return _profile ?? SignalServiceProtos_DataMessage.LokiProfile()} - set {_profile = newValue} - } - /// Returns true if `profile` has been explicitly set. - var hasProfile: Bool {return self._profile != nil} - /// Clears the value of `profile`. Subsequent reads from it will return its default value. - mutating func clearProfile() {self._profile = nil} - - /// Loki - var closedGroupUpdate: SignalServiceProtos_DataMessage.ClosedGroupUpdate { - get {return _closedGroupUpdate ?? SignalServiceProtos_DataMessage.ClosedGroupUpdate()} - set {_closedGroupUpdate = newValue} - } - /// Returns true if `closedGroupUpdate` has been explicitly set. - var hasClosedGroupUpdate: Bool {return self._closedGroupUpdate != nil} - /// Clears the value of `closedGroupUpdate`. Subsequent reads from it will return its default value. - mutating func clearClosedGroupUpdate() {self._closedGroupUpdate = nil} - - /// Loki: Internal public chat info - var publicChatInfo: SignalServiceProtos_PublicChatInfo { - get {return _publicChatInfo ?? SignalServiceProtos_PublicChatInfo()} - set {_publicChatInfo = newValue} - } - /// Returns true if `publicChatInfo` has been explicitly set. - var hasPublicChatInfo: Bool {return self._publicChatInfo != nil} - /// Clears the value of `publicChatInfo`. Subsequent reads from it will return its default value. - mutating func clearPublicChatInfo() {self._publicChatInfo = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - enum Flags: SwiftProtobuf.Enum { - typealias RawValue = Int - case endSession // = 1 - case expirationTimerUpdate // = 2 - case profileKeyUpdate // = 4 - case unlinkDevice // = 128 - - init() { - self = .endSession - } - - init?(rawValue: Int) { - switch rawValue { - case 1: self = .endSession - case 2: self = .expirationTimerUpdate - case 4: self = .profileKeyUpdate - case 128: self = .unlinkDevice - default: return nil - } - } - - var rawValue: Int { - switch self { - case .endSession: return 1 - case .expirationTimerUpdate: return 2 - case .profileKeyUpdate: return 4 - case .unlinkDevice: return 128 - } - } - - } - - struct Quote { - // 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 id: UInt64 { - get {return _id ?? 0} - set {_id = newValue} - } - /// Returns true if `id` has been explicitly set. - var hasID: Bool {return self._id != nil} - /// Clears the value of `id`. Subsequent reads from it will return its default value. - mutating func clearID() {self._id = nil} - - /// @required - var author: String { - get {return _author ?? String()} - set {_author = newValue} - } - /// Returns true if `author` has been explicitly set. - var hasAuthor: Bool {return self._author != nil} - /// Clears the value of `author`. Subsequent reads from it will return its default value. - mutating func clearAuthor() {self._author = nil} - - var text: String { - get {return _text ?? String()} - set {_text = newValue} - } - /// Returns true if `text` has been explicitly set. - var hasText: Bool {return self._text != nil} - /// Clears the value of `text`. Subsequent reads from it will return its default value. - mutating func clearText() {self._text = nil} - - var attachments: [SignalServiceProtos_DataMessage.Quote.QuotedAttachment] = [] - - var unknownFields = SwiftProtobuf.UnknownStorage() - - struct QuotedAttachment { - // 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. - - var contentType: String { - get {return _contentType ?? String()} - set {_contentType = newValue} - } - /// Returns true if `contentType` has been explicitly set. - var hasContentType: Bool {return self._contentType != nil} - /// Clears the value of `contentType`. Subsequent reads from it will return its default value. - mutating func clearContentType() {self._contentType = nil} - - var fileName: String { - get {return _fileName ?? String()} - set {_fileName = newValue} - } - /// Returns true if `fileName` has been explicitly set. - var hasFileName: Bool {return self._fileName != nil} - /// Clears the value of `fileName`. Subsequent reads from it will return its default value. - mutating func clearFileName() {self._fileName = nil} - - var thumbnail: SignalServiceProtos_AttachmentPointer { - get {return _thumbnail ?? SignalServiceProtos_AttachmentPointer()} - set {_thumbnail = newValue} - } - /// Returns true if `thumbnail` has been explicitly set. - var hasThumbnail: Bool {return self._thumbnail != nil} - /// Clears the value of `thumbnail`. Subsequent reads from it will return its default value. - mutating func clearThumbnail() {self._thumbnail = nil} - - var flags: UInt32 { - get {return _flags ?? 0} - set {_flags = newValue} - } - /// Returns true if `flags` has been explicitly set. - var hasFlags: Bool {return self._flags != nil} - /// Clears the value of `flags`. Subsequent reads from it will return its default value. - mutating func clearFlags() {self._flags = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - enum Flags: SwiftProtobuf.Enum { - typealias RawValue = Int - case voiceMessage // = 1 - - init() { - self = .voiceMessage - } - - init?(rawValue: Int) { - switch rawValue { - case 1: self = .voiceMessage - default: return nil - } - } - - var rawValue: Int { - switch self { - case .voiceMessage: return 1 - } - } - - } - - init() {} - - fileprivate var _contentType: String? = nil - fileprivate var _fileName: String? = nil - fileprivate var _thumbnail: SignalServiceProtos_AttachmentPointer? = nil - fileprivate var _flags: UInt32? = nil - } - - init() {} - - fileprivate var _id: UInt64? = nil - fileprivate var _author: String? = nil - fileprivate var _text: String? = nil - } - - struct Contact { - // 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. - - var name: SignalServiceProtos_DataMessage.Contact.Name { - get {return _name ?? SignalServiceProtos_DataMessage.Contact.Name()} - set {_name = newValue} - } - /// Returns true if `name` has been explicitly set. - var hasName: Bool {return self._name != nil} - /// Clears the value of `name`. Subsequent reads from it will return its default value. - mutating func clearName() {self._name = nil} - - var number: [SignalServiceProtos_DataMessage.Contact.Phone] = [] - - var email: [SignalServiceProtos_DataMessage.Contact.Email] = [] - - var address: [SignalServiceProtos_DataMessage.Contact.PostalAddress] = [] - - var avatar: SignalServiceProtos_DataMessage.Contact.Avatar { - get {return _avatar ?? SignalServiceProtos_DataMessage.Contact.Avatar()} - set {_avatar = newValue} - } - /// Returns true if `avatar` has been explicitly set. - var hasAvatar: Bool {return self._avatar != nil} - /// Clears the value of `avatar`. Subsequent reads from it will return its default value. - mutating func clearAvatar() {self._avatar = nil} - - var organization: String { - get {return _organization ?? String()} - set {_organization = newValue} - } - /// Returns true if `organization` has been explicitly set. - var hasOrganization: Bool {return self._organization != nil} - /// Clears the value of `organization`. Subsequent reads from it will return its default value. - mutating func clearOrganization() {self._organization = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - struct Name { - // 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. - - var givenName: String { - get {return _givenName ?? String()} - set {_givenName = newValue} - } - /// Returns true if `givenName` has been explicitly set. - var hasGivenName: Bool {return self._givenName != nil} - /// Clears the value of `givenName`. Subsequent reads from it will return its default value. - mutating func clearGivenName() {self._givenName = nil} - - var familyName: String { - get {return _familyName ?? String()} - set {_familyName = newValue} - } - /// Returns true if `familyName` has been explicitly set. - var hasFamilyName: Bool {return self._familyName != nil} - /// Clears the value of `familyName`. Subsequent reads from it will return its default value. - mutating func clearFamilyName() {self._familyName = nil} - - var prefix: String { - get {return _prefix ?? String()} - set {_prefix = newValue} - } - /// Returns true if `prefix` has been explicitly set. - var hasPrefix: Bool {return self._prefix != nil} - /// Clears the value of `prefix`. Subsequent reads from it will return its default value. - mutating func clearPrefix() {self._prefix = nil} - - var suffix: String { - get {return _suffix ?? String()} - set {_suffix = newValue} - } - /// Returns true if `suffix` has been explicitly set. - var hasSuffix: Bool {return self._suffix != nil} - /// Clears the value of `suffix`. Subsequent reads from it will return its default value. - mutating func clearSuffix() {self._suffix = nil} - - var middleName: String { - get {return _middleName ?? String()} - set {_middleName = newValue} - } - /// Returns true if `middleName` has been explicitly set. - var hasMiddleName: Bool {return self._middleName != nil} - /// Clears the value of `middleName`. Subsequent reads from it will return its default value. - mutating func clearMiddleName() {self._middleName = nil} - - var displayName: String { - get {return _displayName ?? String()} - set {_displayName = newValue} - } - /// Returns true if `displayName` has been explicitly set. - var hasDisplayName: Bool {return self._displayName != nil} - /// Clears the value of `displayName`. Subsequent reads from it will return its default value. - mutating func clearDisplayName() {self._displayName = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _givenName: String? = nil - fileprivate var _familyName: String? = nil - fileprivate var _prefix: String? = nil - fileprivate var _suffix: String? = nil - fileprivate var _middleName: String? = nil - fileprivate var _displayName: String? = nil - } - - struct Phone { - // 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. - - var value: String { - get {return _value ?? String()} - set {_value = newValue} - } - /// Returns true if `value` has been explicitly set. - var hasValue: Bool {return self._value != nil} - /// Clears the value of `value`. Subsequent reads from it will return its default value. - mutating func clearValue() {self._value = nil} - - var type: SignalServiceProtos_DataMessage.Contact.Phone.TypeEnum { - get {return _type ?? .home} - set {_type = newValue} - } - /// Returns true if `type` has been explicitly set. - var hasType: Bool {return self._type != nil} - /// Clears the value of `type`. Subsequent reads from it will return its default value. - mutating func clearType() {self._type = nil} - - var label: String { - get {return _label ?? String()} - set {_label = newValue} - } - /// Returns true if `label` has been explicitly set. - var hasLabel: Bool {return self._label != nil} - /// Clears the value of `label`. Subsequent reads from it will return its default value. - mutating func clearLabel() {self._label = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - enum TypeEnum: SwiftProtobuf.Enum { - typealias RawValue = Int - case home // = 1 - case mobile // = 2 - case work // = 3 - case custom // = 4 - - init() { - self = .home - } - - init?(rawValue: Int) { - switch rawValue { - case 1: self = .home - case 2: self = .mobile - case 3: self = .work - case 4: self = .custom - default: return nil - } - } - - var rawValue: Int { - switch self { - case .home: return 1 - case .mobile: return 2 - case .work: return 3 - case .custom: return 4 - } - } - - } - - init() {} - - fileprivate var _value: String? = nil - fileprivate var _type: SignalServiceProtos_DataMessage.Contact.Phone.TypeEnum? = nil - fileprivate var _label: String? = nil - } - - struct Email { - // 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. - - var value: String { - get {return _value ?? String()} - set {_value = newValue} - } - /// Returns true if `value` has been explicitly set. - var hasValue: Bool {return self._value != nil} - /// Clears the value of `value`. Subsequent reads from it will return its default value. - mutating func clearValue() {self._value = nil} - - var type: SignalServiceProtos_DataMessage.Contact.Email.TypeEnum { - get {return _type ?? .home} - set {_type = newValue} - } - /// Returns true if `type` has been explicitly set. - var hasType: Bool {return self._type != nil} - /// Clears the value of `type`. Subsequent reads from it will return its default value. - mutating func clearType() {self._type = nil} - - var label: String { - get {return _label ?? String()} - set {_label = newValue} - } - /// Returns true if `label` has been explicitly set. - var hasLabel: Bool {return self._label != nil} - /// Clears the value of `label`. Subsequent reads from it will return its default value. - mutating func clearLabel() {self._label = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - enum TypeEnum: SwiftProtobuf.Enum { - typealias RawValue = Int - case home // = 1 - case mobile // = 2 - case work // = 3 - case custom // = 4 - - init() { - self = .home - } - - init?(rawValue: Int) { - switch rawValue { - case 1: self = .home - case 2: self = .mobile - case 3: self = .work - case 4: self = .custom - default: return nil - } - } - - var rawValue: Int { - switch self { - case .home: return 1 - case .mobile: return 2 - case .work: return 3 - case .custom: return 4 - } - } - - } - - init() {} - - fileprivate var _value: String? = nil - fileprivate var _type: SignalServiceProtos_DataMessage.Contact.Email.TypeEnum? = nil - fileprivate var _label: String? = nil - } - - struct PostalAddress { - // 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. - - var type: SignalServiceProtos_DataMessage.Contact.PostalAddress.TypeEnum { - get {return _type ?? .home} - set {_type = newValue} - } - /// Returns true if `type` has been explicitly set. - var hasType: Bool {return self._type != nil} - /// Clears the value of `type`. Subsequent reads from it will return its default value. - mutating func clearType() {self._type = nil} - - var label: String { - get {return _label ?? String()} - set {_label = newValue} - } - /// Returns true if `label` has been explicitly set. - var hasLabel: Bool {return self._label != nil} - /// Clears the value of `label`. Subsequent reads from it will return its default value. - mutating func clearLabel() {self._label = nil} - - var street: String { - get {return _street ?? String()} - set {_street = newValue} - } - /// Returns true if `street` has been explicitly set. - var hasStreet: Bool {return self._street != nil} - /// Clears the value of `street`. Subsequent reads from it will return its default value. - mutating func clearStreet() {self._street = nil} - - var pobox: String { - get {return _pobox ?? String()} - set {_pobox = newValue} - } - /// Returns true if `pobox` has been explicitly set. - var hasPobox: Bool {return self._pobox != nil} - /// Clears the value of `pobox`. Subsequent reads from it will return its default value. - mutating func clearPobox() {self._pobox = nil} - - var neighborhood: String { - get {return _neighborhood ?? String()} - set {_neighborhood = newValue} - } - /// Returns true if `neighborhood` has been explicitly set. - var hasNeighborhood: Bool {return self._neighborhood != nil} - /// Clears the value of `neighborhood`. Subsequent reads from it will return its default value. - mutating func clearNeighborhood() {self._neighborhood = nil} - - var city: String { - get {return _city ?? String()} - set {_city = newValue} - } - /// Returns true if `city` has been explicitly set. - var hasCity: Bool {return self._city != nil} - /// Clears the value of `city`. Subsequent reads from it will return its default value. - mutating func clearCity() {self._city = nil} - - var region: String { - get {return _region ?? String()} - set {_region = newValue} - } - /// Returns true if `region` has been explicitly set. - var hasRegion: Bool {return self._region != nil} - /// Clears the value of `region`. Subsequent reads from it will return its default value. - mutating func clearRegion() {self._region = nil} - - var postcode: String { - get {return _postcode ?? String()} - set {_postcode = newValue} - } - /// Returns true if `postcode` has been explicitly set. - var hasPostcode: Bool {return self._postcode != nil} - /// Clears the value of `postcode`. Subsequent reads from it will return its default value. - mutating func clearPostcode() {self._postcode = nil} - - var country: String { - get {return _country ?? String()} - set {_country = newValue} - } - /// Returns true if `country` has been explicitly set. - var hasCountry: Bool {return self._country != nil} - /// Clears the value of `country`. Subsequent reads from it will return its default value. - mutating func clearCountry() {self._country = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - enum TypeEnum: SwiftProtobuf.Enum { - typealias RawValue = Int - case home // = 1 - case work // = 2 - case custom // = 3 - - init() { - self = .home - } - - init?(rawValue: Int) { - switch rawValue { - case 1: self = .home - case 2: self = .work - case 3: self = .custom - default: return nil - } - } - - var rawValue: Int { - switch self { - case .home: return 1 - case .work: return 2 - case .custom: return 3 - } - } - - } - - init() {} - - fileprivate var _type: SignalServiceProtos_DataMessage.Contact.PostalAddress.TypeEnum? = nil - fileprivate var _label: String? = nil - fileprivate var _street: String? = nil - fileprivate var _pobox: String? = nil - fileprivate var _neighborhood: String? = nil - fileprivate var _city: String? = nil - fileprivate var _region: String? = nil - fileprivate var _postcode: String? = nil - fileprivate var _country: String? = nil - } - - struct Avatar { - // 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. - - var avatar: SignalServiceProtos_AttachmentPointer { - get {return _avatar ?? SignalServiceProtos_AttachmentPointer()} - set {_avatar = newValue} - } - /// Returns true if `avatar` has been explicitly set. - var hasAvatar: Bool {return self._avatar != nil} - /// Clears the value of `avatar`. Subsequent reads from it will return its default value. - mutating func clearAvatar() {self._avatar = nil} - - var isProfile: Bool { - get {return _isProfile ?? false} - set {_isProfile = newValue} - } - /// Returns true if `isProfile` has been explicitly set. - var hasIsProfile: Bool {return self._isProfile != nil} - /// Clears the value of `isProfile`. Subsequent reads from it will return its default value. - mutating func clearIsProfile() {self._isProfile = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _avatar: SignalServiceProtos_AttachmentPointer? = nil - fileprivate var _isProfile: Bool? = nil - } - - init() {} - - fileprivate var _name: SignalServiceProtos_DataMessage.Contact.Name? = nil - fileprivate var _avatar: SignalServiceProtos_DataMessage.Contact.Avatar? = nil - fileprivate var _organization: String? = nil - } - - struct Preview { - // 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 url: String { - get {return _url ?? String()} - set {_url = newValue} - } - /// Returns true if `url` has been explicitly set. - var hasURL: Bool {return self._url != nil} - /// Clears the value of `url`. Subsequent reads from it will return its default value. - mutating func clearURL() {self._url = nil} - - var title: String { - get {return _title ?? String()} - set {_title = newValue} - } - /// Returns true if `title` has been explicitly set. - var hasTitle: Bool {return self._title != nil} - /// Clears the value of `title`. Subsequent reads from it will return its default value. - mutating func clearTitle() {self._title = nil} - - var image: SignalServiceProtos_AttachmentPointer { - get {return _image ?? SignalServiceProtos_AttachmentPointer()} - set {_image = newValue} - } - /// Returns true if `image` has been explicitly set. - var hasImage: Bool {return self._image != nil} - /// Clears the value of `image`. Subsequent reads from it will return its default value. - mutating func clearImage() {self._image = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _url: String? = nil - fileprivate var _title: String? = nil - fileprivate var _image: SignalServiceProtos_AttachmentPointer? = nil - } - - /// Loki - struct LokiProfile { - // 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. - - var displayName: String { - get {return _displayName ?? String()} - set {_displayName = newValue} - } - /// Returns true if `displayName` has been explicitly set. - var hasDisplayName: Bool {return self._displayName != nil} - /// Clears the value of `displayName`. Subsequent reads from it will return its default value. - mutating func clearDisplayName() {self._displayName = nil} - - var profilePicture: String { - get {return _profilePicture ?? String()} - set {_profilePicture = newValue} - } - /// Returns true if `profilePicture` has been explicitly set. - var hasProfilePicture: Bool {return self._profilePicture != nil} - /// Clears the value of `profilePicture`. Subsequent reads from it will return its default value. - mutating func clearProfilePicture() {self._profilePicture = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _displayName: String? = nil - fileprivate var _profilePicture: String? = nil - } - - /// Loki - struct ClosedGroupUpdate { - // 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. - - var name: String { - get {return _name ?? String()} - set {_name = newValue} - } - /// Returns true if `name` has been explicitly set. - var hasName: Bool {return self._name != nil} - /// Clears the value of `name`. Subsequent reads from it will return its default value. - mutating func clearName() {self._name = nil} - - /// @required - var groupPublicKey: Data { - get {return _groupPublicKey ?? SwiftProtobuf.Internal.emptyData} - set {_groupPublicKey = newValue} - } - /// Returns true if `groupPublicKey` has been explicitly set. - var hasGroupPublicKey: Bool {return self._groupPublicKey != nil} - /// Clears the value of `groupPublicKey`. Subsequent reads from it will return its default value. - mutating func clearGroupPublicKey() {self._groupPublicKey = nil} - - var groupPrivateKey: Data { - get {return _groupPrivateKey ?? SwiftProtobuf.Internal.emptyData} - set {_groupPrivateKey = newValue} - } - /// Returns true if `groupPrivateKey` has been explicitly set. - var hasGroupPrivateKey: Bool {return self._groupPrivateKey != nil} - /// Clears the value of `groupPrivateKey`. Subsequent reads from it will return its default value. - mutating func clearGroupPrivateKey() {self._groupPrivateKey = nil} - - var senderKeys: [SignalServiceProtos_DataMessage.ClosedGroupUpdate.SenderKey] = [] - - var members: [Data] = [] - - var admins: [Data] = [] - - /// @required - var type: SignalServiceProtos_DataMessage.ClosedGroupUpdate.TypeEnum { - get {return _type ?? .new} - set {_type = newValue} - } - /// Returns true if `type` has been explicitly set. - var hasType: Bool {return self._type != nil} - /// Clears the value of `type`. Subsequent reads from it will return its default value. - mutating func clearType() {self._type = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - enum TypeEnum: SwiftProtobuf.Enum { - typealias RawValue = Int - - /// groupPublicKey, name, groupPrivateKey, senderKeys, members, admins - case new // = 0 - - /// groupPublicKey, name, senderKeys, members, admins - case info // = 1 - - /// groupPublicKey - case senderKeyRequest // = 2 - - /// groupPublicKey, senderKeys - case senderKey // = 3 - - init() { - self = .new - } - - init?(rawValue: Int) { - switch rawValue { - case 0: self = .new - case 1: self = .info - case 2: self = .senderKeyRequest - case 3: self = .senderKey - default: return nil - } - } - - var rawValue: Int { - switch self { - case .new: return 0 - case .info: return 1 - case .senderKeyRequest: return 2 - case .senderKey: return 3 - } - } - - } - - struct SenderKey { - // 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 chainKey: Data { - get {return _chainKey ?? SwiftProtobuf.Internal.emptyData} - set {_chainKey = newValue} - } - /// Returns true if `chainKey` has been explicitly set. - var hasChainKey: Bool {return self._chainKey != nil} - /// Clears the value of `chainKey`. Subsequent reads from it will return its default value. - mutating func clearChainKey() {self._chainKey = nil} - - /// @required - var keyIndex: UInt32 { - get {return _keyIndex ?? 0} - set {_keyIndex = newValue} - } - /// Returns true if `keyIndex` has been explicitly set. - var hasKeyIndex: Bool {return self._keyIndex != nil} - /// Clears the value of `keyIndex`. Subsequent reads from it will return its default value. - mutating func clearKeyIndex() {self._keyIndex = nil} - - /// @required - var publicKey: Data { - get {return _publicKey ?? SwiftProtobuf.Internal.emptyData} - set {_publicKey = newValue} - } - /// Returns true if `publicKey` has been explicitly set. - var hasPublicKey: Bool {return self._publicKey != nil} - /// Clears the value of `publicKey`. Subsequent reads from it will return its default value. - mutating func clearPublicKey() {self._publicKey = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _chainKey: Data? = nil - fileprivate var _keyIndex: UInt32? = nil - fileprivate var _publicKey: Data? = nil - } - - init() {} - - fileprivate var _name: String? = nil - fileprivate var _groupPublicKey: Data? = nil - fileprivate var _groupPrivateKey: Data? = nil - fileprivate var _type: SignalServiceProtos_DataMessage.ClosedGroupUpdate.TypeEnum? = nil - } - - init() {} - - fileprivate var _body: String? = nil - fileprivate var _group: SignalServiceProtos_GroupContext? = nil - fileprivate var _flags: UInt32? = nil - fileprivate var _expireTimer: UInt32? = nil - fileprivate var _profileKey: Data? = nil - fileprivate var _timestamp: UInt64? = nil - fileprivate var _quote: SignalServiceProtos_DataMessage.Quote? = nil - fileprivate var _profile: SignalServiceProtos_DataMessage.LokiProfile? = nil - fileprivate var _closedGroupUpdate: SignalServiceProtos_DataMessage.ClosedGroupUpdate? = nil - fileprivate var _publicChatInfo: SignalServiceProtos_PublicChatInfo? = nil -} - -#if swift(>=4.2) - -extension SignalServiceProtos_DataMessage.Flags: CaseIterable { - // Support synthesized by the compiler. -} - -extension SignalServiceProtos_DataMessage.Quote.QuotedAttachment.Flags: CaseIterable { - // Support synthesized by the compiler. -} - -extension SignalServiceProtos_DataMessage.Contact.Phone.TypeEnum: CaseIterable { - // Support synthesized by the compiler. -} - -extension SignalServiceProtos_DataMessage.Contact.Email.TypeEnum: CaseIterable { - // Support synthesized by the compiler. -} - -extension SignalServiceProtos_DataMessage.Contact.PostalAddress.TypeEnum: CaseIterable { - // Support synthesized by the compiler. -} - -extension SignalServiceProtos_DataMessage.ClosedGroupUpdate.TypeEnum: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - -struct SignalServiceProtos_NullMessage { - // 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. - - var padding: Data { - get {return _padding ?? SwiftProtobuf.Internal.emptyData} - set {_padding = newValue} - } - /// Returns true if `padding` has been explicitly set. - var hasPadding: Bool {return self._padding != nil} - /// Clears the value of `padding`. Subsequent reads from it will return its default value. - mutating func clearPadding() {self._padding = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _padding: Data? = nil -} - -struct SignalServiceProtos_ReceiptMessage { - // 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 type: SignalServiceProtos_ReceiptMessage.TypeEnum { - get {return _type ?? .delivery} - set {_type = newValue} - } - /// Returns true if `type` has been explicitly set. - var hasType: Bool {return self._type != nil} - /// Clears the value of `type`. Subsequent reads from it will return its default value. - mutating func clearType() {self._type = nil} - - var timestamp: [UInt64] = [] - - var unknownFields = SwiftProtobuf.UnknownStorage() - - enum TypeEnum: SwiftProtobuf.Enum { - typealias RawValue = Int - case delivery // = 0 - case read // = 1 - - init() { - self = .delivery - } - - init?(rawValue: Int) { - switch rawValue { - case 0: self = .delivery - case 1: self = .read - default: return nil - } - } - - var rawValue: Int { - switch self { - case .delivery: return 0 - case .read: return 1 - } - } - - } - - init() {} - - fileprivate var _type: SignalServiceProtos_ReceiptMessage.TypeEnum? = nil -} - -#if swift(>=4.2) - -extension SignalServiceProtos_ReceiptMessage.TypeEnum: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - -struct SignalServiceProtos_Verified { - // 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 destination: String { - get {return _destination ?? String()} - set {_destination = newValue} - } - /// Returns true if `destination` has been explicitly set. - var hasDestination: Bool {return self._destination != nil} - /// Clears the value of `destination`. Subsequent reads from it will return its default value. - mutating func clearDestination() {self._destination = nil} - - var identityKey: Data { - get {return _identityKey ?? SwiftProtobuf.Internal.emptyData} - set {_identityKey = newValue} - } - /// Returns true if `identityKey` has been explicitly set. - var hasIdentityKey: Bool {return self._identityKey != nil} - /// Clears the value of `identityKey`. Subsequent reads from it will return its default value. - mutating func clearIdentityKey() {self._identityKey = nil} - - var state: SignalServiceProtos_Verified.State { - get {return _state ?? .default} - set {_state = newValue} - } - /// Returns true if `state` has been explicitly set. - var hasState: Bool {return self._state != nil} - /// Clears the value of `state`. Subsequent reads from it will return its default value. - mutating func clearState() {self._state = nil} - - var nullMessage: Data { - get {return _nullMessage ?? SwiftProtobuf.Internal.emptyData} - set {_nullMessage = newValue} - } - /// Returns true if `nullMessage` has been explicitly set. - var hasNullMessage: Bool {return self._nullMessage != nil} - /// Clears the value of `nullMessage`. Subsequent reads from it will return its default value. - mutating func clearNullMessage() {self._nullMessage = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - enum State: SwiftProtobuf.Enum { - typealias RawValue = Int - case `default` // = 0 - case verified // = 1 - case unverified // = 2 - - init() { - self = .default - } - - init?(rawValue: Int) { - switch rawValue { - case 0: self = .default - case 1: self = .verified - case 2: self = .unverified - default: return nil - } - } - - var rawValue: Int { - switch self { - case .default: return 0 - case .verified: return 1 - case .unverified: return 2 - } - } - - } - - init() {} - - fileprivate var _destination: String? = nil - fileprivate var _identityKey: Data? = nil - fileprivate var _state: SignalServiceProtos_Verified.State? = nil - fileprivate var _nullMessage: Data? = nil -} - -#if swift(>=4.2) - -extension SignalServiceProtos_Verified.State: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - -struct SignalServiceProtos_SyncMessage { - // 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. - - var sent: SignalServiceProtos_SyncMessage.Sent { - get {return _sent ?? SignalServiceProtos_SyncMessage.Sent()} - set {_sent = newValue} - } - /// Returns true if `sent` has been explicitly set. - var hasSent: Bool {return self._sent != nil} - /// Clears the value of `sent`. Subsequent reads from it will return its default value. - mutating func clearSent() {self._sent = nil} - - var contacts: SignalServiceProtos_SyncMessage.Contacts { - get {return _contacts ?? SignalServiceProtos_SyncMessage.Contacts()} - set {_contacts = newValue} - } - /// Returns true if `contacts` has been explicitly set. - var hasContacts: Bool {return self._contacts != nil} - /// Clears the value of `contacts`. Subsequent reads from it will return its default value. - mutating func clearContacts() {self._contacts = nil} - - var groups: SignalServiceProtos_SyncMessage.Groups { - get {return _groups ?? SignalServiceProtos_SyncMessage.Groups()} - set {_groups = newValue} - } - /// Returns true if `groups` has been explicitly set. - var hasGroups: Bool {return self._groups != nil} - /// Clears the value of `groups`. Subsequent reads from it will return its default value. - mutating func clearGroups() {self._groups = nil} - - var request: SignalServiceProtos_SyncMessage.Request { - get {return _request ?? SignalServiceProtos_SyncMessage.Request()} - set {_request = newValue} - } - /// Returns true if `request` has been explicitly set. - var hasRequest: Bool {return self._request != nil} - /// Clears the value of `request`. Subsequent reads from it will return its default value. - mutating func clearRequest() {self._request = nil} - - var read: [SignalServiceProtos_SyncMessage.Read] = [] - - var blocked: SignalServiceProtos_SyncMessage.Blocked { - get {return _blocked ?? SignalServiceProtos_SyncMessage.Blocked()} - set {_blocked = newValue} - } - /// Returns true if `blocked` has been explicitly set. - var hasBlocked: Bool {return self._blocked != nil} - /// Clears the value of `blocked`. Subsequent reads from it will return its default value. - mutating func clearBlocked() {self._blocked = nil} - - var verified: SignalServiceProtos_Verified { - get {return _verified ?? SignalServiceProtos_Verified()} - set {_verified = newValue} - } - /// Returns true if `verified` has been explicitly set. - var hasVerified: Bool {return self._verified != nil} - /// Clears the value of `verified`. Subsequent reads from it will return its default value. - mutating func clearVerified() {self._verified = nil} - - var configuration: SignalServiceProtos_SyncMessage.Configuration { - get {return _configuration ?? SignalServiceProtos_SyncMessage.Configuration()} - set {_configuration = newValue} - } - /// Returns true if `configuration` has been explicitly set. - var hasConfiguration: Bool {return self._configuration != nil} - /// Clears the value of `configuration`. Subsequent reads from it will return its default value. - mutating func clearConfiguration() {self._configuration = nil} - - var padding: Data { - get {return _padding ?? SwiftProtobuf.Internal.emptyData} - set {_padding = newValue} - } - /// Returns true if `padding` has been explicitly set. - var hasPadding: Bool {return self._padding != nil} - /// Clears the value of `padding`. Subsequent reads from it will return its default value. - mutating func clearPadding() {self._padding = nil} - - var openGroups: [SignalServiceProtos_SyncMessage.OpenGroupDetails] = [] - - var unknownFields = SwiftProtobuf.UnknownStorage() - - struct Sent { - // 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. - - var destination: String { - get {return _destination ?? String()} - set {_destination = newValue} - } - /// Returns true if `destination` has been explicitly set. - var hasDestination: Bool {return self._destination != nil} - /// Clears the value of `destination`. Subsequent reads from it will return its default value. - mutating func clearDestination() {self._destination = nil} - - var timestamp: UInt64 { - get {return _timestamp ?? 0} - set {_timestamp = newValue} - } - /// Returns true if `timestamp` has been explicitly set. - var hasTimestamp: Bool {return self._timestamp != nil} - /// Clears the value of `timestamp`. Subsequent reads from it will return its default value. - mutating func clearTimestamp() {self._timestamp = nil} - - var message: SignalServiceProtos_DataMessage { - get {return _message ?? SignalServiceProtos_DataMessage()} - set {_message = newValue} - } - /// Returns true if `message` has been explicitly set. - var hasMessage: Bool {return self._message != nil} - /// Clears the value of `message`. Subsequent reads from it will return its default value. - mutating func clearMessage() {self._message = nil} - - var expirationStartTimestamp: UInt64 { - get {return _expirationStartTimestamp ?? 0} - set {_expirationStartTimestamp = newValue} - } - /// Returns true if `expirationStartTimestamp` has been explicitly set. - var hasExpirationStartTimestamp: Bool {return self._expirationStartTimestamp != nil} - /// Clears the value of `expirationStartTimestamp`. Subsequent reads from it will return its default value. - mutating func clearExpirationStartTimestamp() {self._expirationStartTimestamp = nil} - - var unidentifiedStatus: [SignalServiceProtos_SyncMessage.Sent.UnidentifiedDeliveryStatus] = [] - - var isRecipientUpdate: Bool { - get {return _isRecipientUpdate ?? false} - set {_isRecipientUpdate = newValue} - } - /// Returns true if `isRecipientUpdate` has been explicitly set. - var hasIsRecipientUpdate: Bool {return self._isRecipientUpdate != nil} - /// Clears the value of `isRecipientUpdate`. Subsequent reads from it will return its default value. - mutating func clearIsRecipientUpdate() {self._isRecipientUpdate = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - struct UnidentifiedDeliveryStatus { - // 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. - - var destination: String { - get {return _destination ?? String()} - set {_destination = newValue} - } - /// Returns true if `destination` has been explicitly set. - var hasDestination: Bool {return self._destination != nil} - /// Clears the value of `destination`. Subsequent reads from it will return its default value. - mutating func clearDestination() {self._destination = nil} - - var unidentified: Bool { - get {return _unidentified ?? false} - set {_unidentified = newValue} - } - /// Returns true if `unidentified` has been explicitly set. - var hasUnidentified: Bool {return self._unidentified != nil} - /// Clears the value of `unidentified`. Subsequent reads from it will return its default value. - mutating func clearUnidentified() {self._unidentified = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _destination: String? = nil - fileprivate var _unidentified: Bool? = nil - } - - init() {} - - fileprivate var _destination: String? = nil - fileprivate var _timestamp: UInt64? = nil - fileprivate var _message: SignalServiceProtos_DataMessage? = nil - fileprivate var _expirationStartTimestamp: UInt64? = nil - fileprivate var _isRecipientUpdate: Bool? = nil - } - - struct Contacts { - // 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. - - var blob: SignalServiceProtos_AttachmentPointer { - get {return _blob ?? SignalServiceProtos_AttachmentPointer()} - set {_blob = newValue} - } - /// Returns true if `blob` has been explicitly set. - var hasBlob: Bool {return self._blob != nil} - /// Clears the value of `blob`. Subsequent reads from it will return its default value. - mutating func clearBlob() {self._blob = nil} - - /// Signal-iOS renamed this property. - var isComplete: Bool { - get {return _isComplete ?? false} - set {_isComplete = newValue} - } - /// Returns true if `isComplete` has been explicitly set. - var hasIsComplete: Bool {return self._isComplete != nil} - /// Clears the value of `isComplete`. Subsequent reads from it will return its default value. - mutating func clearIsComplete() {self._isComplete = nil} - - /// Loki - var data: Data { - get {return _data ?? SwiftProtobuf.Internal.emptyData} - set {_data = newValue} - } - /// Returns true if `data` has been explicitly set. - var hasData: Bool {return self._data != nil} - /// Clears the value of `data`. Subsequent reads from it will return its default value. - mutating func clearData() {self._data = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _blob: SignalServiceProtos_AttachmentPointer? = nil - fileprivate var _isComplete: Bool? = nil - fileprivate var _data: Data? = nil - } - - struct Groups { - // 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. - - var blob: SignalServiceProtos_AttachmentPointer { - get {return _blob ?? SignalServiceProtos_AttachmentPointer()} - set {_blob = newValue} - } - /// Returns true if `blob` has been explicitly set. - var hasBlob: Bool {return self._blob != nil} - /// Clears the value of `blob`. Subsequent reads from it will return its default value. - mutating func clearBlob() {self._blob = nil} - - /// Loki - var data: Data { - get {return _data ?? SwiftProtobuf.Internal.emptyData} - set {_data = newValue} - } - /// Returns true if `data` has been explicitly set. - var hasData: Bool {return self._data != nil} - /// Clears the value of `data`. Subsequent reads from it will return its default value. - mutating func clearData() {self._data = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _blob: SignalServiceProtos_AttachmentPointer? = nil - fileprivate var _data: Data? = nil - } - - /// Loki - struct OpenGroupDetails { - // 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 url: String { - get {return _url ?? String()} - set {_url = newValue} - } - /// Returns true if `url` has been explicitly set. - var hasURL: Bool {return self._url != nil} - /// Clears the value of `url`. Subsequent reads from it will return its default value. - mutating func clearURL() {self._url = nil} - - /// @required - var channelID: UInt64 { - get {return _channelID ?? 0} - set {_channelID = newValue} - } - /// Returns true if `channelID` has been explicitly set. - var hasChannelID: Bool {return self._channelID != nil} - /// Clears the value of `channelID`. Subsequent reads from it will return its default value. - mutating func clearChannelID() {self._channelID = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _url: String? = nil - fileprivate var _channelID: UInt64? = nil - } - - struct Blocked { - // 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. - - var numbers: [String] = [] - - var groupIds: [Data] = [] - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - } - - struct Request { - // 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 type: SignalServiceProtos_SyncMessage.Request.TypeEnum { - get {return _type ?? .unknown} - set {_type = newValue} - } - /// Returns true if `type` has been explicitly set. - var hasType: Bool {return self._type != nil} - /// Clears the value of `type`. Subsequent reads from it will return its default value. - mutating func clearType() {self._type = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - enum TypeEnum: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknown // = 0 - case contacts // = 1 - case groups // = 2 - case blocked // = 3 - case configuration // = 4 - - init() { - self = .unknown - } - - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .contacts - case 2: self = .groups - case 3: self = .blocked - case 4: self = .configuration - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknown: return 0 - case .contacts: return 1 - case .groups: return 2 - case .blocked: return 3 - case .configuration: return 4 - } - } - - } - - init() {} - - fileprivate var _type: SignalServiceProtos_SyncMessage.Request.TypeEnum? = nil - } - - struct Read { - // 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 sender: String { - get {return _sender ?? String()} - set {_sender = newValue} - } - /// Returns true if `sender` has been explicitly set. - var hasSender: Bool {return self._sender != nil} - /// Clears the value of `sender`. Subsequent reads from it will return its default value. - mutating func clearSender() {self._sender = nil} - - /// @required - var timestamp: UInt64 { - get {return _timestamp ?? 0} - set {_timestamp = newValue} - } - /// Returns true if `timestamp` has been explicitly set. - var hasTimestamp: Bool {return self._timestamp != nil} - /// Clears the value of `timestamp`. Subsequent reads from it will return its default value. - mutating func clearTimestamp() {self._timestamp = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _sender: String? = nil - fileprivate var _timestamp: UInt64? = nil - } - - struct Configuration { - // 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. - - var readReceipts: Bool { - get {return _readReceipts ?? false} - set {_readReceipts = newValue} - } - /// Returns true if `readReceipts` has been explicitly set. - var hasReadReceipts: Bool {return self._readReceipts != nil} - /// Clears the value of `readReceipts`. Subsequent reads from it will return its default value. - mutating func clearReadReceipts() {self._readReceipts = nil} - - var unidentifiedDeliveryIndicators: Bool { - get {return _unidentifiedDeliveryIndicators ?? false} - set {_unidentifiedDeliveryIndicators = newValue} - } - /// Returns true if `unidentifiedDeliveryIndicators` has been explicitly set. - var hasUnidentifiedDeliveryIndicators: Bool {return self._unidentifiedDeliveryIndicators != nil} - /// Clears the value of `unidentifiedDeliveryIndicators`. Subsequent reads from it will return its default value. - mutating func clearUnidentifiedDeliveryIndicators() {self._unidentifiedDeliveryIndicators = nil} - - var typingIndicators: Bool { - get {return _typingIndicators ?? false} - set {_typingIndicators = newValue} - } - /// Returns true if `typingIndicators` has been explicitly set. - var hasTypingIndicators: Bool {return self._typingIndicators != nil} - /// Clears the value of `typingIndicators`. Subsequent reads from it will return its default value. - mutating func clearTypingIndicators() {self._typingIndicators = nil} - - var linkPreviews: Bool { - get {return _linkPreviews ?? false} - set {_linkPreviews = newValue} - } - /// Returns true if `linkPreviews` has been explicitly set. - var hasLinkPreviews: Bool {return self._linkPreviews != nil} - /// Clears the value of `linkPreviews`. Subsequent reads from it will return its default value. - mutating func clearLinkPreviews() {self._linkPreviews = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _readReceipts: Bool? = nil - fileprivate var _unidentifiedDeliveryIndicators: Bool? = nil - fileprivate var _typingIndicators: Bool? = nil - fileprivate var _linkPreviews: Bool? = nil - } - - init() {} - - fileprivate var _sent: SignalServiceProtos_SyncMessage.Sent? = nil - fileprivate var _contacts: SignalServiceProtos_SyncMessage.Contacts? = nil - fileprivate var _groups: SignalServiceProtos_SyncMessage.Groups? = nil - fileprivate var _request: SignalServiceProtos_SyncMessage.Request? = nil - fileprivate var _blocked: SignalServiceProtos_SyncMessage.Blocked? = nil - fileprivate var _verified: SignalServiceProtos_Verified? = nil - fileprivate var _configuration: SignalServiceProtos_SyncMessage.Configuration? = nil - fileprivate var _padding: Data? = nil -} - -#if swift(>=4.2) - -extension SignalServiceProtos_SyncMessage.Request.TypeEnum: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - -struct SignalServiceProtos_AttachmentPointer { - // 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 id: UInt64 { - get {return _id ?? 0} - set {_id = newValue} - } - /// Returns true if `id` has been explicitly set. - var hasID: Bool {return self._id != nil} - /// Clears the value of `id`. Subsequent reads from it will return its default value. - mutating func clearID() {self._id = nil} - - var contentType: String { - get {return _contentType ?? String()} - set {_contentType = newValue} - } - /// Returns true if `contentType` has been explicitly set. - var hasContentType: Bool {return self._contentType != nil} - /// Clears the value of `contentType`. Subsequent reads from it will return its default value. - mutating func clearContentType() {self._contentType = nil} - - var key: Data { - get {return _key ?? SwiftProtobuf.Internal.emptyData} - set {_key = newValue} - } - /// Returns true if `key` has been explicitly set. - var hasKey: Bool {return self._key != nil} - /// Clears the value of `key`. Subsequent reads from it will return its default value. - mutating func clearKey() {self._key = nil} - - var size: UInt32 { - get {return _size ?? 0} - set {_size = newValue} - } - /// Returns true if `size` has been explicitly set. - var hasSize: Bool {return self._size != nil} - /// Clears the value of `size`. Subsequent reads from it will return its default value. - mutating func clearSize() {self._size = nil} - - var thumbnail: Data { - get {return _thumbnail ?? SwiftProtobuf.Internal.emptyData} - set {_thumbnail = newValue} - } - /// Returns true if `thumbnail` has been explicitly set. - var hasThumbnail: Bool {return self._thumbnail != nil} - /// Clears the value of `thumbnail`. Subsequent reads from it will return its default value. - mutating func clearThumbnail() {self._thumbnail = nil} - - var digest: Data { - get {return _digest ?? SwiftProtobuf.Internal.emptyData} - set {_digest = newValue} - } - /// Returns true if `digest` has been explicitly set. - var hasDigest: Bool {return self._digest != nil} - /// Clears the value of `digest`. Subsequent reads from it will return its default value. - mutating func clearDigest() {self._digest = nil} - - var fileName: String { - get {return _fileName ?? String()} - set {_fileName = newValue} - } - /// Returns true if `fileName` has been explicitly set. - var hasFileName: Bool {return self._fileName != nil} - /// Clears the value of `fileName`. Subsequent reads from it will return its default value. - mutating func clearFileName() {self._fileName = nil} - - var flags: UInt32 { - get {return _flags ?? 0} - set {_flags = newValue} - } - /// Returns true if `flags` has been explicitly set. - var hasFlags: Bool {return self._flags != nil} - /// Clears the value of `flags`. Subsequent reads from it will return its default value. - mutating func clearFlags() {self._flags = nil} - - var width: UInt32 { - get {return _width ?? 0} - set {_width = newValue} - } - /// Returns true if `width` has been explicitly set. - var hasWidth: Bool {return self._width != nil} - /// Clears the value of `width`. Subsequent reads from it will return its default value. - mutating func clearWidth() {self._width = nil} - - var height: UInt32 { - get {return _height ?? 0} - set {_height = newValue} - } - /// Returns true if `height` has been explicitly set. - var hasHeight: Bool {return self._height != nil} - /// Clears the value of `height`. Subsequent reads from it will return its default value. - mutating func clearHeight() {self._height = nil} - - var caption: String { - get {return _caption ?? String()} - set {_caption = newValue} - } - /// Returns true if `caption` has been explicitly set. - var hasCaption: Bool {return self._caption != nil} - /// Clears the value of `caption`. Subsequent reads from it will return its default value. - mutating func clearCaption() {self._caption = nil} - - /// Loki - var url: String { - get {return _url ?? String()} - set {_url = newValue} - } - /// Returns true if `url` has been explicitly set. - var hasURL: Bool {return self._url != nil} - /// Clears the value of `url`. Subsequent reads from it will return its default value. - mutating func clearURL() {self._url = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - enum Flags: SwiftProtobuf.Enum { - typealias RawValue = Int - case voiceMessage // = 1 - - init() { - self = .voiceMessage - } - - init?(rawValue: Int) { - switch rawValue { - case 1: self = .voiceMessage - default: return nil - } - } - - var rawValue: Int { - switch self { - case .voiceMessage: return 1 - } - } - - } - - init() {} - - fileprivate var _id: UInt64? = nil - fileprivate var _contentType: String? = nil - fileprivate var _key: Data? = nil - fileprivate var _size: UInt32? = nil - fileprivate var _thumbnail: Data? = nil - fileprivate var _digest: Data? = nil - fileprivate var _fileName: String? = nil - fileprivate var _flags: UInt32? = nil - fileprivate var _width: UInt32? = nil - fileprivate var _height: UInt32? = nil - fileprivate var _caption: String? = nil - fileprivate var _url: String? = nil -} - -#if swift(>=4.2) - -extension SignalServiceProtos_AttachmentPointer.Flags: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - -struct SignalServiceProtos_GroupContext { - // 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 id: Data { - get {return _id ?? SwiftProtobuf.Internal.emptyData} - set {_id = newValue} - } - /// Returns true if `id` has been explicitly set. - var hasID: Bool {return self._id != nil} - /// Clears the value of `id`. Subsequent reads from it will return its default value. - mutating func clearID() {self._id = nil} - - /// @required - var type: SignalServiceProtos_GroupContext.TypeEnum { - get {return _type ?? .unknown} - set {_type = newValue} - } - /// Returns true if `type` has been explicitly set. - var hasType: Bool {return self._type != nil} - /// Clears the value of `type`. Subsequent reads from it will return its default value. - mutating func clearType() {self._type = nil} - - var name: String { - get {return _name ?? String()} - set {_name = newValue} - } - /// Returns true if `name` has been explicitly set. - var hasName: Bool {return self._name != nil} - /// Clears the value of `name`. Subsequent reads from it will return its default value. - mutating func clearName() {self._name = nil} - - var members: [String] = [] - - var avatar: SignalServiceProtos_AttachmentPointer { - get {return _avatar ?? SignalServiceProtos_AttachmentPointer()} - set {_avatar = newValue} - } - /// Returns true if `avatar` has been explicitly set. - var hasAvatar: Bool {return self._avatar != nil} - /// Clears the value of `avatar`. Subsequent reads from it will return its default value. - mutating func clearAvatar() {self._avatar = nil} - - /// Loki - var admins: [String] = [] - - var unknownFields = SwiftProtobuf.UnknownStorage() - - enum TypeEnum: SwiftProtobuf.Enum { - typealias RawValue = Int - case unknown // = 0 - case update // = 1 - case deliver // = 2 - case quit // = 3 - case requestInfo // = 4 - - init() { - self = .unknown - } - - init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .update - case 2: self = .deliver - case 3: self = .quit - case 4: self = .requestInfo - default: return nil - } - } - - var rawValue: Int { - switch self { - case .unknown: return 0 - case .update: return 1 - case .deliver: return 2 - case .quit: return 3 - case .requestInfo: return 4 - } - } - - } - - init() {} - - fileprivate var _id: Data? = nil - fileprivate var _type: SignalServiceProtos_GroupContext.TypeEnum? = nil - fileprivate var _name: String? = nil - fileprivate var _avatar: SignalServiceProtos_AttachmentPointer? = nil -} - -#if swift(>=4.2) - -extension SignalServiceProtos_GroupContext.TypeEnum: CaseIterable { - // Support synthesized by the compiler. -} - -#endif // swift(>=4.2) - -struct SignalServiceProtos_ContactDetails { - // 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 number: String { - get {return _number ?? String()} - set {_number = newValue} - } - /// Returns true if `number` has been explicitly set. - var hasNumber: Bool {return self._number != nil} - /// Clears the value of `number`. Subsequent reads from it will return its default value. - mutating func clearNumber() {self._number = nil} - - var name: String { - get {return _name ?? String()} - set {_name = newValue} - } - /// Returns true if `name` has been explicitly set. - var hasName: Bool {return self._name != nil} - /// Clears the value of `name`. Subsequent reads from it will return its default value. - mutating func clearName() {self._name = nil} - - var avatar: SignalServiceProtos_ContactDetails.Avatar { - get {return _avatar ?? SignalServiceProtos_ContactDetails.Avatar()} - set {_avatar = newValue} - } - /// Returns true if `avatar` has been explicitly set. - var hasAvatar: Bool {return self._avatar != nil} - /// Clears the value of `avatar`. Subsequent reads from it will return its default value. - mutating func clearAvatar() {self._avatar = nil} - - var color: String { - get {return _color ?? String()} - set {_color = newValue} - } - /// Returns true if `color` has been explicitly set. - var hasColor: Bool {return self._color != nil} - /// Clears the value of `color`. Subsequent reads from it will return its default value. - mutating func clearColor() {self._color = nil} - - var verified: SignalServiceProtos_Verified { - get {return _verified ?? SignalServiceProtos_Verified()} - set {_verified = newValue} - } - /// Returns true if `verified` has been explicitly set. - var hasVerified: Bool {return self._verified != nil} - /// Clears the value of `verified`. Subsequent reads from it will return its default value. - mutating func clearVerified() {self._verified = nil} - - var profileKey: Data { - get {return _profileKey ?? SwiftProtobuf.Internal.emptyData} - set {_profileKey = newValue} - } - /// Returns true if `profileKey` has been explicitly set. - var hasProfileKey: Bool {return self._profileKey != nil} - /// Clears the value of `profileKey`. Subsequent reads from it will return its default value. - mutating func clearProfileKey() {self._profileKey = nil} - - var blocked: Bool { - get {return _blocked ?? false} - set {_blocked = newValue} - } - /// Returns true if `blocked` has been explicitly set. - var hasBlocked: Bool {return self._blocked != nil} - /// Clears the value of `blocked`. Subsequent reads from it will return its default value. - mutating func clearBlocked() {self._blocked = nil} - - var expireTimer: UInt32 { - get {return _expireTimer ?? 0} - set {_expireTimer = newValue} - } - /// Returns true if `expireTimer` has been explicitly set. - var hasExpireTimer: Bool {return self._expireTimer != nil} - /// Clears the value of `expireTimer`. Subsequent reads from it will return its default value. - mutating func clearExpireTimer() {self._expireTimer = nil} - - /// Loki - var nickname: String { - get {return _nickname ?? String()} - set {_nickname = newValue} - } - /// Returns true if `nickname` has been explicitly set. - var hasNickname: Bool {return self._nickname != nil} - /// Clears the value of `nickname`. Subsequent reads from it will return its default value. - mutating func clearNickname() {self._nickname = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - struct Avatar { - // 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. - - var contentType: String { - get {return _contentType ?? String()} - set {_contentType = newValue} - } - /// Returns true if `contentType` has been explicitly set. - var hasContentType: Bool {return self._contentType != nil} - /// Clears the value of `contentType`. Subsequent reads from it will return its default value. - mutating func clearContentType() {self._contentType = nil} - - var length: UInt32 { - get {return _length ?? 0} - set {_length = newValue} - } - /// Returns true if `length` has been explicitly set. - var hasLength: Bool {return self._length != nil} - /// Clears the value of `length`. Subsequent reads from it will return its default value. - mutating func clearLength() {self._length = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _contentType: String? = nil - fileprivate var _length: UInt32? = nil - } - - init() {} - - fileprivate var _number: String? = nil - fileprivate var _name: String? = nil - fileprivate var _avatar: SignalServiceProtos_ContactDetails.Avatar? = nil - fileprivate var _color: String? = nil - fileprivate var _verified: SignalServiceProtos_Verified? = nil - fileprivate var _profileKey: Data? = nil - fileprivate var _blocked: Bool? = nil - fileprivate var _expireTimer: UInt32? = nil - fileprivate var _nickname: String? = nil -} - -struct SignalServiceProtos_GroupDetails { - // 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 id: Data { - get {return _id ?? SwiftProtobuf.Internal.emptyData} - set {_id = newValue} - } - /// Returns true if `id` has been explicitly set. - var hasID: Bool {return self._id != nil} - /// Clears the value of `id`. Subsequent reads from it will return its default value. - mutating func clearID() {self._id = nil} - - var name: String { - get {return _name ?? String()} - set {_name = newValue} - } - /// Returns true if `name` has been explicitly set. - var hasName: Bool {return self._name != nil} - /// Clears the value of `name`. Subsequent reads from it will return its default value. - mutating func clearName() {self._name = nil} - - var members: [String] = [] - - var avatar: SignalServiceProtos_GroupDetails.Avatar { - get {return _avatar ?? SignalServiceProtos_GroupDetails.Avatar()} - set {_avatar = newValue} - } - /// Returns true if `avatar` has been explicitly set. - var hasAvatar: Bool {return self._avatar != nil} - /// Clears the value of `avatar`. Subsequent reads from it will return its default value. - mutating func clearAvatar() {self._avatar = nil} - - var active: Bool { - get {return _active ?? true} - set {_active = newValue} - } - /// Returns true if `active` has been explicitly set. - var hasActive: Bool {return self._active != nil} - /// Clears the value of `active`. Subsequent reads from it will return its default value. - mutating func clearActive() {self._active = nil} - - var expireTimer: UInt32 { - get {return _expireTimer ?? 0} - set {_expireTimer = newValue} - } - /// Returns true if `expireTimer` has been explicitly set. - var hasExpireTimer: Bool {return self._expireTimer != nil} - /// Clears the value of `expireTimer`. Subsequent reads from it will return its default value. - mutating func clearExpireTimer() {self._expireTimer = nil} - - var color: String { - get {return _color ?? String()} - set {_color = newValue} - } - /// Returns true if `color` has been explicitly set. - var hasColor: Bool {return self._color != nil} - /// Clears the value of `color`. Subsequent reads from it will return its default value. - mutating func clearColor() {self._color = nil} - - var blocked: Bool { - get {return _blocked ?? false} - set {_blocked = newValue} - } - /// Returns true if `blocked` has been explicitly set. - var hasBlocked: Bool {return self._blocked != nil} - /// Clears the value of `blocked`. Subsequent reads from it will return its default value. - mutating func clearBlocked() {self._blocked = nil} - - /// Loki - var admins: [String] = [] - - var unknownFields = SwiftProtobuf.UnknownStorage() - - struct Avatar { - // 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. - - var contentType: String { - get {return _contentType ?? String()} - set {_contentType = newValue} - } - /// Returns true if `contentType` has been explicitly set. - var hasContentType: Bool {return self._contentType != nil} - /// Clears the value of `contentType`. Subsequent reads from it will return its default value. - mutating func clearContentType() {self._contentType = nil} - - var length: UInt32 { - get {return _length ?? 0} - set {_length = newValue} - } - /// Returns true if `length` has been explicitly set. - var hasLength: Bool {return self._length != nil} - /// Clears the value of `length`. Subsequent reads from it will return its default value. - mutating func clearLength() {self._length = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _contentType: String? = nil - fileprivate var _length: UInt32? = nil - } - - init() {} - - fileprivate var _id: Data? = nil - fileprivate var _name: String? = nil - fileprivate var _avatar: SignalServiceProtos_GroupDetails.Avatar? = nil - fileprivate var _active: Bool? = nil - fileprivate var _expireTimer: UInt32? = nil - fileprivate var _color: String? = nil - fileprivate var _blocked: Bool? = nil -} - -/// Internal - DO NOT SEND -struct SignalServiceProtos_PublicChatInfo { - // 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. - - var serverID: UInt64 { - get {return _serverID ?? 0} - set {_serverID = newValue} - } - /// Returns true if `serverID` has been explicitly set. - var hasServerID: Bool {return self._serverID != nil} - /// Clears the value of `serverID`. Subsequent reads from it will return its default value. - mutating func clearServerID() {self._serverID = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _serverID: UInt64? = nil -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "SignalServiceProtos" - -extension SignalServiceProtos_Envelope: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".Envelope" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "type"), - 2: .same(proto: "source"), - 7: .same(proto: "sourceDevice"), - 3: .same(proto: "relay"), - 5: .same(proto: "timestamp"), - 6: .same(proto: "legacyMessage"), - 8: .same(proto: "content"), - 9: .same(proto: "serverGuid"), - 10: .same(proto: "serverTimestamp"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularEnumField(value: &self._type) - case 2: try decoder.decodeSingularStringField(value: &self._source) - case 3: try decoder.decodeSingularStringField(value: &self._relay) - case 5: try decoder.decodeSingularUInt64Field(value: &self._timestamp) - case 6: try decoder.decodeSingularBytesField(value: &self._legacyMessage) - case 7: try decoder.decodeSingularUInt32Field(value: &self._sourceDevice) - case 8: try decoder.decodeSingularBytesField(value: &self._content) - case 9: try decoder.decodeSingularStringField(value: &self._serverGuid) - case 10: try decoder.decodeSingularUInt64Field(value: &self._serverTimestamp) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._type { - try visitor.visitSingularEnumField(value: v, fieldNumber: 1) - } - if let v = self._source { - try visitor.visitSingularStringField(value: v, fieldNumber: 2) - } - if let v = self._relay { - try visitor.visitSingularStringField(value: v, fieldNumber: 3) - } - if let v = self._timestamp { - try visitor.visitSingularUInt64Field(value: v, fieldNumber: 5) - } - if let v = self._legacyMessage { - try visitor.visitSingularBytesField(value: v, fieldNumber: 6) - } - if let v = self._sourceDevice { - try visitor.visitSingularUInt32Field(value: v, fieldNumber: 7) - } - if let v = self._content { - try visitor.visitSingularBytesField(value: v, fieldNumber: 8) - } - if let v = self._serverGuid { - try visitor.visitSingularStringField(value: v, fieldNumber: 9) - } - if let v = self._serverTimestamp { - try visitor.visitSingularUInt64Field(value: v, fieldNumber: 10) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_Envelope, rhs: SignalServiceProtos_Envelope) -> Bool { - if lhs._type != rhs._type {return false} - if lhs._source != rhs._source {return false} - if lhs._sourceDevice != rhs._sourceDevice {return false} - if lhs._relay != rhs._relay {return false} - if lhs._timestamp != rhs._timestamp {return false} - if lhs._legacyMessage != rhs._legacyMessage {return false} - if lhs._content != rhs._content {return false} - if lhs._serverGuid != rhs._serverGuid {return false} - if lhs._serverTimestamp != rhs._serverTimestamp {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_Envelope.TypeEnum: SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN"), - 1: .same(proto: "CIPHERTEXT"), - 2: .same(proto: "KEY_EXCHANGE"), - 3: .same(proto: "PREKEY_BUNDLE"), - 5: .same(proto: "RECEIPT"), - 6: .same(proto: "UNIDENTIFIED_SENDER"), - 7: .same(proto: "CLOSED_GROUP_CIPHERTEXT"), - 101: .same(proto: "FALLBACK_MESSAGE"), - ] -} - -extension SignalServiceProtos_TypingMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".TypingMessage" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "timestamp"), - 2: .same(proto: "action"), - 3: .same(proto: "groupId"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularUInt64Field(value: &self._timestamp) - case 2: try decoder.decodeSingularEnumField(value: &self._action) - case 3: try decoder.decodeSingularBytesField(value: &self._groupID) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._timestamp { - try visitor.visitSingularUInt64Field(value: v, fieldNumber: 1) - } - if let v = self._action { - try visitor.visitSingularEnumField(value: v, fieldNumber: 2) - } - if let v = self._groupID { - try visitor.visitSingularBytesField(value: v, fieldNumber: 3) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_TypingMessage, rhs: SignalServiceProtos_TypingMessage) -> Bool { - if lhs._timestamp != rhs._timestamp {return false} - if lhs._action != rhs._action {return false} - if lhs._groupID != rhs._groupID {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_TypingMessage.Action: SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "STARTED"), - 1: .same(proto: "STOPPED"), - ] -} - -extension SignalServiceProtos_Content: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".Content" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "dataMessage"), - 2: .same(proto: "syncMessage"), - 3: .same(proto: "callMessage"), - 4: .same(proto: "nullMessage"), - 5: .same(proto: "receiptMessage"), - 6: .same(proto: "typingMessage"), - 101: .same(proto: "prekeyBundleMessage"), - 103: .same(proto: "lokiDeviceLinkMessage"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularMessageField(value: &self._dataMessage) - case 2: try decoder.decodeSingularMessageField(value: &self._syncMessage) - case 3: try decoder.decodeSingularMessageField(value: &self._callMessage) - case 4: try decoder.decodeSingularMessageField(value: &self._nullMessage) - case 5: try decoder.decodeSingularMessageField(value: &self._receiptMessage) - case 6: try decoder.decodeSingularMessageField(value: &self._typingMessage) - case 101: try decoder.decodeSingularMessageField(value: &self._prekeyBundleMessage) - case 103: try decoder.decodeSingularMessageField(value: &self._lokiDeviceLinkMessage) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._dataMessage { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } - if let v = self._syncMessage { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } - if let v = self._callMessage { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } - if let v = self._nullMessage { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } - if let v = self._receiptMessage { - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } - if let v = self._typingMessage { - try visitor.visitSingularMessageField(value: v, fieldNumber: 6) - } - if let v = self._prekeyBundleMessage { - try visitor.visitSingularMessageField(value: v, fieldNumber: 101) - } - if let v = self._lokiDeviceLinkMessage { - try visitor.visitSingularMessageField(value: v, fieldNumber: 103) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_Content, rhs: SignalServiceProtos_Content) -> Bool { - if lhs._dataMessage != rhs._dataMessage {return false} - if lhs._syncMessage != rhs._syncMessage {return false} - if lhs._callMessage != rhs._callMessage {return false} - if lhs._nullMessage != rhs._nullMessage {return false} - if lhs._receiptMessage != rhs._receiptMessage {return false} - if lhs._typingMessage != rhs._typingMessage {return false} - if lhs._prekeyBundleMessage != rhs._prekeyBundleMessage {return false} - if lhs._lokiDeviceLinkMessage != rhs._lokiDeviceLinkMessage {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_PrekeyBundleMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".PrekeyBundleMessage" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "identityKey"), - 2: .same(proto: "deviceID"), - 3: .same(proto: "prekeyID"), - 4: .same(proto: "signedKeyID"), - 5: .same(proto: "prekey"), - 6: .same(proto: "signedKey"), - 7: .same(proto: "signature"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularBytesField(value: &self._identityKey) - case 2: try decoder.decodeSingularUInt32Field(value: &self._deviceID) - case 3: try decoder.decodeSingularUInt32Field(value: &self._prekeyID) - case 4: try decoder.decodeSingularUInt32Field(value: &self._signedKeyID) - case 5: try decoder.decodeSingularBytesField(value: &self._prekey) - case 6: try decoder.decodeSingularBytesField(value: &self._signedKey) - case 7: try decoder.decodeSingularBytesField(value: &self._signature) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._identityKey { - try visitor.visitSingularBytesField(value: v, fieldNumber: 1) - } - if let v = self._deviceID { - try visitor.visitSingularUInt32Field(value: v, fieldNumber: 2) - } - if let v = self._prekeyID { - try visitor.visitSingularUInt32Field(value: v, fieldNumber: 3) - } - if let v = self._signedKeyID { - try visitor.visitSingularUInt32Field(value: v, fieldNumber: 4) - } - if let v = self._prekey { - try visitor.visitSingularBytesField(value: v, fieldNumber: 5) - } - if let v = self._signedKey { - try visitor.visitSingularBytesField(value: v, fieldNumber: 6) - } - if let v = self._signature { - try visitor.visitSingularBytesField(value: v, fieldNumber: 7) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_PrekeyBundleMessage, rhs: SignalServiceProtos_PrekeyBundleMessage) -> Bool { - if lhs._identityKey != rhs._identityKey {return false} - if lhs._deviceID != rhs._deviceID {return false} - if lhs._prekeyID != rhs._prekeyID {return false} - if lhs._signedKeyID != rhs._signedKeyID {return false} - if lhs._prekey != rhs._prekey {return false} - if lhs._signedKey != rhs._signedKey {return false} - if lhs._signature != rhs._signature {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_LokiDeviceLinkMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".LokiDeviceLinkMessage" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "masterPublicKey"), - 2: .same(proto: "slavePublicKey"), - 3: .same(proto: "slaveSignature"), - 4: .same(proto: "masterSignature"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &self._masterPublicKey) - case 2: try decoder.decodeSingularStringField(value: &self._slavePublicKey) - case 3: try decoder.decodeSingularBytesField(value: &self._slaveSignature) - case 4: try decoder.decodeSingularBytesField(value: &self._masterSignature) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._masterPublicKey { - try visitor.visitSingularStringField(value: v, fieldNumber: 1) - } - if let v = self._slavePublicKey { - try visitor.visitSingularStringField(value: v, fieldNumber: 2) - } - if let v = self._slaveSignature { - try visitor.visitSingularBytesField(value: v, fieldNumber: 3) - } - if let v = self._masterSignature { - try visitor.visitSingularBytesField(value: v, fieldNumber: 4) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_LokiDeviceLinkMessage, rhs: SignalServiceProtos_LokiDeviceLinkMessage) -> Bool { - if lhs._masterPublicKey != rhs._masterPublicKey {return false} - if lhs._slavePublicKey != rhs._slavePublicKey {return false} - if lhs._slaveSignature != rhs._slaveSignature {return false} - if lhs._masterSignature != rhs._masterSignature {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_CallMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".CallMessage" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "offer"), - 2: .same(proto: "answer"), - 3: .same(proto: "iceUpdate"), - 4: .same(proto: "hangup"), - 5: .same(proto: "busy"), - 6: .same(proto: "profileKey"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularMessageField(value: &self._offer) - case 2: try decoder.decodeSingularMessageField(value: &self._answer) - case 3: try decoder.decodeRepeatedMessageField(value: &self.iceUpdate) - case 4: try decoder.decodeSingularMessageField(value: &self._hangup) - case 5: try decoder.decodeSingularMessageField(value: &self._busy) - case 6: try decoder.decodeSingularBytesField(value: &self._profileKey) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._offer { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } - if let v = self._answer { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } - if !self.iceUpdate.isEmpty { - try visitor.visitRepeatedMessageField(value: self.iceUpdate, fieldNumber: 3) - } - if let v = self._hangup { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } - if let v = self._busy { - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } - if let v = self._profileKey { - try visitor.visitSingularBytesField(value: v, fieldNumber: 6) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_CallMessage, rhs: SignalServiceProtos_CallMessage) -> Bool { - if lhs._offer != rhs._offer {return false} - if lhs._answer != rhs._answer {return false} - if lhs.iceUpdate != rhs.iceUpdate {return false} - if lhs._hangup != rhs._hangup {return false} - if lhs._busy != rhs._busy {return false} - if lhs._profileKey != rhs._profileKey {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_CallMessage.Offer: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = SignalServiceProtos_CallMessage.protoMessageName + ".Offer" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "id"), - 2: .same(proto: "sessionDescription"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularUInt64Field(value: &self._id) - case 2: try decoder.decodeSingularStringField(value: &self._sessionDescription) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._id { - try visitor.visitSingularUInt64Field(value: v, fieldNumber: 1) - } - if let v = self._sessionDescription { - try visitor.visitSingularStringField(value: v, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_CallMessage.Offer, rhs: SignalServiceProtos_CallMessage.Offer) -> Bool { - if lhs._id != rhs._id {return false} - if lhs._sessionDescription != rhs._sessionDescription {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_CallMessage.Answer: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = SignalServiceProtos_CallMessage.protoMessageName + ".Answer" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "id"), - 2: .same(proto: "sessionDescription"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularUInt64Field(value: &self._id) - case 2: try decoder.decodeSingularStringField(value: &self._sessionDescription) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._id { - try visitor.visitSingularUInt64Field(value: v, fieldNumber: 1) - } - if let v = self._sessionDescription { - try visitor.visitSingularStringField(value: v, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_CallMessage.Answer, rhs: SignalServiceProtos_CallMessage.Answer) -> Bool { - if lhs._id != rhs._id {return false} - if lhs._sessionDescription != rhs._sessionDescription {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_CallMessage.IceUpdate: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = SignalServiceProtos_CallMessage.protoMessageName + ".IceUpdate" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "id"), - 2: .same(proto: "sdpMid"), - 3: .same(proto: "sdpMLineIndex"), - 4: .same(proto: "sdp"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularUInt64Field(value: &self._id) - case 2: try decoder.decodeSingularStringField(value: &self._sdpMid) - case 3: try decoder.decodeSingularUInt32Field(value: &self._sdpMlineIndex) - case 4: try decoder.decodeSingularStringField(value: &self._sdp) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._id { - try visitor.visitSingularUInt64Field(value: v, fieldNumber: 1) - } - if let v = self._sdpMid { - try visitor.visitSingularStringField(value: v, fieldNumber: 2) - } - if let v = self._sdpMlineIndex { - try visitor.visitSingularUInt32Field(value: v, fieldNumber: 3) - } - if let v = self._sdp { - try visitor.visitSingularStringField(value: v, fieldNumber: 4) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_CallMessage.IceUpdate, rhs: SignalServiceProtos_CallMessage.IceUpdate) -> Bool { - if lhs._id != rhs._id {return false} - if lhs._sdpMid != rhs._sdpMid {return false} - if lhs._sdpMlineIndex != rhs._sdpMlineIndex {return false} - if lhs._sdp != rhs._sdp {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_CallMessage.Busy: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = SignalServiceProtos_CallMessage.protoMessageName + ".Busy" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "id"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularUInt64Field(value: &self._id) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._id { - try visitor.visitSingularUInt64Field(value: v, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_CallMessage.Busy, rhs: SignalServiceProtos_CallMessage.Busy) -> Bool { - if lhs._id != rhs._id {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_CallMessage.Hangup: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = SignalServiceProtos_CallMessage.protoMessageName + ".Hangup" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "id"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularUInt64Field(value: &self._id) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._id { - try visitor.visitSingularUInt64Field(value: v, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_CallMessage.Hangup, rhs: SignalServiceProtos_CallMessage.Hangup) -> Bool { - if lhs._id != rhs._id {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_ClosedGroupCiphertextMessageWrapper: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".ClosedGroupCiphertextMessageWrapper" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "ciphertext"), - 2: .same(proto: "ephemeralPublicKey"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularBytesField(value: &self._ciphertext) - case 2: try decoder.decodeSingularBytesField(value: &self._ephemeralPublicKey) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._ciphertext { - try visitor.visitSingularBytesField(value: v, fieldNumber: 1) - } - if let v = self._ephemeralPublicKey { - try visitor.visitSingularBytesField(value: v, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_ClosedGroupCiphertextMessageWrapper, rhs: SignalServiceProtos_ClosedGroupCiphertextMessageWrapper) -> Bool { - if lhs._ciphertext != rhs._ciphertext {return false} - if lhs._ephemeralPublicKey != rhs._ephemeralPublicKey {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_DataMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".DataMessage" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "body"), - 2: .same(proto: "attachments"), - 3: .same(proto: "group"), - 4: .same(proto: "flags"), - 5: .same(proto: "expireTimer"), - 6: .same(proto: "profileKey"), - 7: .same(proto: "timestamp"), - 8: .same(proto: "quote"), - 9: .same(proto: "contact"), - 10: .same(proto: "preview"), - 101: .same(proto: "profile"), - 103: .same(proto: "closedGroupUpdate"), - 999: .same(proto: "publicChatInfo"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &self._body) - case 2: try decoder.decodeRepeatedMessageField(value: &self.attachments) - case 3: try decoder.decodeSingularMessageField(value: &self._group) - case 4: try decoder.decodeSingularUInt32Field(value: &self._flags) - case 5: try decoder.decodeSingularUInt32Field(value: &self._expireTimer) - case 6: try decoder.decodeSingularBytesField(value: &self._profileKey) - case 7: try decoder.decodeSingularUInt64Field(value: &self._timestamp) - case 8: try decoder.decodeSingularMessageField(value: &self._quote) - case 9: try decoder.decodeRepeatedMessageField(value: &self.contact) - case 10: try decoder.decodeRepeatedMessageField(value: &self.preview) - case 101: try decoder.decodeSingularMessageField(value: &self._profile) - case 103: try decoder.decodeSingularMessageField(value: &self._closedGroupUpdate) - case 999: try decoder.decodeSingularMessageField(value: &self._publicChatInfo) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._body { - try visitor.visitSingularStringField(value: v, fieldNumber: 1) - } - if !self.attachments.isEmpty { - try visitor.visitRepeatedMessageField(value: self.attachments, fieldNumber: 2) - } - if let v = self._group { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } - if let v = self._flags { - try visitor.visitSingularUInt32Field(value: v, fieldNumber: 4) - } - if let v = self._expireTimer { - try visitor.visitSingularUInt32Field(value: v, fieldNumber: 5) - } - if let v = self._profileKey { - try visitor.visitSingularBytesField(value: v, fieldNumber: 6) - } - if let v = self._timestamp { - try visitor.visitSingularUInt64Field(value: v, fieldNumber: 7) - } - if let v = self._quote { - try visitor.visitSingularMessageField(value: v, fieldNumber: 8) - } - if !self.contact.isEmpty { - try visitor.visitRepeatedMessageField(value: self.contact, fieldNumber: 9) - } - if !self.preview.isEmpty { - try visitor.visitRepeatedMessageField(value: self.preview, fieldNumber: 10) - } - if let v = self._profile { - try visitor.visitSingularMessageField(value: v, fieldNumber: 101) - } - if let v = self._closedGroupUpdate { - try visitor.visitSingularMessageField(value: v, fieldNumber: 103) - } - if let v = self._publicChatInfo { - try visitor.visitSingularMessageField(value: v, fieldNumber: 999) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_DataMessage, rhs: SignalServiceProtos_DataMessage) -> Bool { - if lhs._body != rhs._body {return false} - if lhs.attachments != rhs.attachments {return false} - if lhs._group != rhs._group {return false} - if lhs._flags != rhs._flags {return false} - if lhs._expireTimer != rhs._expireTimer {return false} - if lhs._profileKey != rhs._profileKey {return false} - if lhs._timestamp != rhs._timestamp {return false} - if lhs._quote != rhs._quote {return false} - if lhs.contact != rhs.contact {return false} - if lhs.preview != rhs.preview {return false} - if lhs._profile != rhs._profile {return false} - if lhs._closedGroupUpdate != rhs._closedGroupUpdate {return false} - if lhs._publicChatInfo != rhs._publicChatInfo {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_DataMessage.Flags: SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "END_SESSION"), - 2: .same(proto: "EXPIRATION_TIMER_UPDATE"), - 4: .same(proto: "PROFILE_KEY_UPDATE"), - 128: .same(proto: "UNLINK_DEVICE"), - ] -} - -extension SignalServiceProtos_DataMessage.Quote: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = SignalServiceProtos_DataMessage.protoMessageName + ".Quote" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "id"), - 2: .same(proto: "author"), - 3: .same(proto: "text"), - 4: .same(proto: "attachments"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularUInt64Field(value: &self._id) - case 2: try decoder.decodeSingularStringField(value: &self._author) - case 3: try decoder.decodeSingularStringField(value: &self._text) - case 4: try decoder.decodeRepeatedMessageField(value: &self.attachments) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._id { - try visitor.visitSingularUInt64Field(value: v, fieldNumber: 1) - } - if let v = self._author { - try visitor.visitSingularStringField(value: v, fieldNumber: 2) - } - if let v = self._text { - try visitor.visitSingularStringField(value: v, fieldNumber: 3) - } - if !self.attachments.isEmpty { - try visitor.visitRepeatedMessageField(value: self.attachments, fieldNumber: 4) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_DataMessage.Quote, rhs: SignalServiceProtos_DataMessage.Quote) -> Bool { - if lhs._id != rhs._id {return false} - if lhs._author != rhs._author {return false} - if lhs._text != rhs._text {return false} - if lhs.attachments != rhs.attachments {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_DataMessage.Quote.QuotedAttachment: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = SignalServiceProtos_DataMessage.Quote.protoMessageName + ".QuotedAttachment" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "contentType"), - 2: .same(proto: "fileName"), - 3: .same(proto: "thumbnail"), - 4: .same(proto: "flags"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &self._contentType) - case 2: try decoder.decodeSingularStringField(value: &self._fileName) - case 3: try decoder.decodeSingularMessageField(value: &self._thumbnail) - case 4: try decoder.decodeSingularUInt32Field(value: &self._flags) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._contentType { - try visitor.visitSingularStringField(value: v, fieldNumber: 1) - } - if let v = self._fileName { - try visitor.visitSingularStringField(value: v, fieldNumber: 2) - } - if let v = self._thumbnail { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } - if let v = self._flags { - try visitor.visitSingularUInt32Field(value: v, fieldNumber: 4) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_DataMessage.Quote.QuotedAttachment, rhs: SignalServiceProtos_DataMessage.Quote.QuotedAttachment) -> Bool { - if lhs._contentType != rhs._contentType {return false} - if lhs._fileName != rhs._fileName {return false} - if lhs._thumbnail != rhs._thumbnail {return false} - if lhs._flags != rhs._flags {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_DataMessage.Quote.QuotedAttachment.Flags: SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "VOICE_MESSAGE"), - ] -} - -extension SignalServiceProtos_DataMessage.Contact: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = SignalServiceProtos_DataMessage.protoMessageName + ".Contact" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "name"), - 3: .same(proto: "number"), - 4: .same(proto: "email"), - 5: .same(proto: "address"), - 6: .same(proto: "avatar"), - 7: .same(proto: "organization"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularMessageField(value: &self._name) - case 3: try decoder.decodeRepeatedMessageField(value: &self.number) - case 4: try decoder.decodeRepeatedMessageField(value: &self.email) - case 5: try decoder.decodeRepeatedMessageField(value: &self.address) - case 6: try decoder.decodeSingularMessageField(value: &self._avatar) - case 7: try decoder.decodeSingularStringField(value: &self._organization) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._name { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } - if !self.number.isEmpty { - try visitor.visitRepeatedMessageField(value: self.number, fieldNumber: 3) - } - if !self.email.isEmpty { - try visitor.visitRepeatedMessageField(value: self.email, fieldNumber: 4) - } - if !self.address.isEmpty { - try visitor.visitRepeatedMessageField(value: self.address, fieldNumber: 5) - } - if let v = self._avatar { - try visitor.visitSingularMessageField(value: v, fieldNumber: 6) - } - if let v = self._organization { - try visitor.visitSingularStringField(value: v, fieldNumber: 7) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_DataMessage.Contact, rhs: SignalServiceProtos_DataMessage.Contact) -> Bool { - if lhs._name != rhs._name {return false} - if lhs.number != rhs.number {return false} - if lhs.email != rhs.email {return false} - if lhs.address != rhs.address {return false} - if lhs._avatar != rhs._avatar {return false} - if lhs._organization != rhs._organization {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_DataMessage.Contact.Name: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = SignalServiceProtos_DataMessage.Contact.protoMessageName + ".Name" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "givenName"), - 2: .same(proto: "familyName"), - 3: .same(proto: "prefix"), - 4: .same(proto: "suffix"), - 5: .same(proto: "middleName"), - 6: .same(proto: "displayName"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &self._givenName) - case 2: try decoder.decodeSingularStringField(value: &self._familyName) - case 3: try decoder.decodeSingularStringField(value: &self._prefix) - case 4: try decoder.decodeSingularStringField(value: &self._suffix) - case 5: try decoder.decodeSingularStringField(value: &self._middleName) - case 6: try decoder.decodeSingularStringField(value: &self._displayName) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._givenName { - try visitor.visitSingularStringField(value: v, fieldNumber: 1) - } - if let v = self._familyName { - try visitor.visitSingularStringField(value: v, fieldNumber: 2) - } - if let v = self._prefix { - try visitor.visitSingularStringField(value: v, fieldNumber: 3) - } - if let v = self._suffix { - try visitor.visitSingularStringField(value: v, fieldNumber: 4) - } - if let v = self._middleName { - try visitor.visitSingularStringField(value: v, fieldNumber: 5) - } - if let v = self._displayName { - try visitor.visitSingularStringField(value: v, fieldNumber: 6) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_DataMessage.Contact.Name, rhs: SignalServiceProtos_DataMessage.Contact.Name) -> Bool { - if lhs._givenName != rhs._givenName {return false} - if lhs._familyName != rhs._familyName {return false} - if lhs._prefix != rhs._prefix {return false} - if lhs._suffix != rhs._suffix {return false} - if lhs._middleName != rhs._middleName {return false} - if lhs._displayName != rhs._displayName {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_DataMessage.Contact.Phone: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = SignalServiceProtos_DataMessage.Contact.protoMessageName + ".Phone" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "value"), - 2: .same(proto: "type"), - 3: .same(proto: "label"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &self._value) - case 2: try decoder.decodeSingularEnumField(value: &self._type) - case 3: try decoder.decodeSingularStringField(value: &self._label) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._value { - try visitor.visitSingularStringField(value: v, fieldNumber: 1) - } - if let v = self._type { - try visitor.visitSingularEnumField(value: v, fieldNumber: 2) - } - if let v = self._label { - try visitor.visitSingularStringField(value: v, fieldNumber: 3) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_DataMessage.Contact.Phone, rhs: SignalServiceProtos_DataMessage.Contact.Phone) -> Bool { - if lhs._value != rhs._value {return false} - if lhs._type != rhs._type {return false} - if lhs._label != rhs._label {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_DataMessage.Contact.Phone.TypeEnum: SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "HOME"), - 2: .same(proto: "MOBILE"), - 3: .same(proto: "WORK"), - 4: .same(proto: "CUSTOM"), - ] -} - -extension SignalServiceProtos_DataMessage.Contact.Email: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = SignalServiceProtos_DataMessage.Contact.protoMessageName + ".Email" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "value"), - 2: .same(proto: "type"), - 3: .same(proto: "label"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &self._value) - case 2: try decoder.decodeSingularEnumField(value: &self._type) - case 3: try decoder.decodeSingularStringField(value: &self._label) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._value { - try visitor.visitSingularStringField(value: v, fieldNumber: 1) - } - if let v = self._type { - try visitor.visitSingularEnumField(value: v, fieldNumber: 2) - } - if let v = self._label { - try visitor.visitSingularStringField(value: v, fieldNumber: 3) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_DataMessage.Contact.Email, rhs: SignalServiceProtos_DataMessage.Contact.Email) -> Bool { - if lhs._value != rhs._value {return false} - if lhs._type != rhs._type {return false} - if lhs._label != rhs._label {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_DataMessage.Contact.Email.TypeEnum: SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "HOME"), - 2: .same(proto: "MOBILE"), - 3: .same(proto: "WORK"), - 4: .same(proto: "CUSTOM"), - ] -} - -extension SignalServiceProtos_DataMessage.Contact.PostalAddress: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = SignalServiceProtos_DataMessage.Contact.protoMessageName + ".PostalAddress" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "type"), - 2: .same(proto: "label"), - 3: .same(proto: "street"), - 4: .same(proto: "pobox"), - 5: .same(proto: "neighborhood"), - 6: .same(proto: "city"), - 7: .same(proto: "region"), - 8: .same(proto: "postcode"), - 9: .same(proto: "country"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularEnumField(value: &self._type) - case 2: try decoder.decodeSingularStringField(value: &self._label) - case 3: try decoder.decodeSingularStringField(value: &self._street) - case 4: try decoder.decodeSingularStringField(value: &self._pobox) - case 5: try decoder.decodeSingularStringField(value: &self._neighborhood) - case 6: try decoder.decodeSingularStringField(value: &self._city) - case 7: try decoder.decodeSingularStringField(value: &self._region) - case 8: try decoder.decodeSingularStringField(value: &self._postcode) - case 9: try decoder.decodeSingularStringField(value: &self._country) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._type { - try visitor.visitSingularEnumField(value: v, fieldNumber: 1) - } - if let v = self._label { - try visitor.visitSingularStringField(value: v, fieldNumber: 2) - } - if let v = self._street { - try visitor.visitSingularStringField(value: v, fieldNumber: 3) - } - if let v = self._pobox { - try visitor.visitSingularStringField(value: v, fieldNumber: 4) - } - if let v = self._neighborhood { - try visitor.visitSingularStringField(value: v, fieldNumber: 5) - } - if let v = self._city { - try visitor.visitSingularStringField(value: v, fieldNumber: 6) - } - if let v = self._region { - try visitor.visitSingularStringField(value: v, fieldNumber: 7) - } - if let v = self._postcode { - try visitor.visitSingularStringField(value: v, fieldNumber: 8) - } - if let v = self._country { - try visitor.visitSingularStringField(value: v, fieldNumber: 9) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_DataMessage.Contact.PostalAddress, rhs: SignalServiceProtos_DataMessage.Contact.PostalAddress) -> Bool { - if lhs._type != rhs._type {return false} - if lhs._label != rhs._label {return false} - if lhs._street != rhs._street {return false} - if lhs._pobox != rhs._pobox {return false} - if lhs._neighborhood != rhs._neighborhood {return false} - if lhs._city != rhs._city {return false} - if lhs._region != rhs._region {return false} - if lhs._postcode != rhs._postcode {return false} - if lhs._country != rhs._country {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_DataMessage.Contact.PostalAddress.TypeEnum: SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "HOME"), - 2: .same(proto: "WORK"), - 3: .same(proto: "CUSTOM"), - ] -} - -extension SignalServiceProtos_DataMessage.Contact.Avatar: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = SignalServiceProtos_DataMessage.Contact.protoMessageName + ".Avatar" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "avatar"), - 2: .same(proto: "isProfile"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularMessageField(value: &self._avatar) - case 2: try decoder.decodeSingularBoolField(value: &self._isProfile) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._avatar { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } - if let v = self._isProfile { - try visitor.visitSingularBoolField(value: v, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_DataMessage.Contact.Avatar, rhs: SignalServiceProtos_DataMessage.Contact.Avatar) -> Bool { - if lhs._avatar != rhs._avatar {return false} - if lhs._isProfile != rhs._isProfile {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_DataMessage.Preview: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = SignalServiceProtos_DataMessage.protoMessageName + ".Preview" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "url"), - 2: .same(proto: "title"), - 3: .same(proto: "image"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &self._url) - case 2: try decoder.decodeSingularStringField(value: &self._title) - case 3: try decoder.decodeSingularMessageField(value: &self._image) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._url { - try visitor.visitSingularStringField(value: v, fieldNumber: 1) - } - if let v = self._title { - try visitor.visitSingularStringField(value: v, fieldNumber: 2) - } - if let v = self._image { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_DataMessage.Preview, rhs: SignalServiceProtos_DataMessage.Preview) -> Bool { - if lhs._url != rhs._url {return false} - if lhs._title != rhs._title {return false} - if lhs._image != rhs._image {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_DataMessage.LokiProfile: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = SignalServiceProtos_DataMessage.protoMessageName + ".LokiProfile" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "displayName"), - 2: .same(proto: "profilePicture"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &self._displayName) - case 2: try decoder.decodeSingularStringField(value: &self._profilePicture) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._displayName { - try visitor.visitSingularStringField(value: v, fieldNumber: 1) - } - if let v = self._profilePicture { - try visitor.visitSingularStringField(value: v, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_DataMessage.LokiProfile, rhs: SignalServiceProtos_DataMessage.LokiProfile) -> Bool { - if lhs._displayName != rhs._displayName {return false} - if lhs._profilePicture != rhs._profilePicture {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_DataMessage.ClosedGroupUpdate: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = SignalServiceProtos_DataMessage.protoMessageName + ".ClosedGroupUpdate" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "name"), - 2: .same(proto: "groupPublicKey"), - 3: .same(proto: "groupPrivateKey"), - 4: .same(proto: "senderKeys"), - 5: .same(proto: "members"), - 6: .same(proto: "admins"), - 7: .same(proto: "type"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &self._name) - case 2: try decoder.decodeSingularBytesField(value: &self._groupPublicKey) - case 3: try decoder.decodeSingularBytesField(value: &self._groupPrivateKey) - case 4: try decoder.decodeRepeatedMessageField(value: &self.senderKeys) - case 5: try decoder.decodeRepeatedBytesField(value: &self.members) - case 6: try decoder.decodeRepeatedBytesField(value: &self.admins) - case 7: try decoder.decodeSingularEnumField(value: &self._type) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._name { - try visitor.visitSingularStringField(value: v, fieldNumber: 1) - } - if let v = self._groupPublicKey { - try visitor.visitSingularBytesField(value: v, fieldNumber: 2) - } - if let v = self._groupPrivateKey { - try visitor.visitSingularBytesField(value: v, fieldNumber: 3) - } - if !self.senderKeys.isEmpty { - try visitor.visitRepeatedMessageField(value: self.senderKeys, fieldNumber: 4) - } - if !self.members.isEmpty { - try visitor.visitRepeatedBytesField(value: self.members, fieldNumber: 5) - } - if !self.admins.isEmpty { - try visitor.visitRepeatedBytesField(value: self.admins, fieldNumber: 6) - } - if let v = self._type { - try visitor.visitSingularEnumField(value: v, fieldNumber: 7) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_DataMessage.ClosedGroupUpdate, rhs: SignalServiceProtos_DataMessage.ClosedGroupUpdate) -> Bool { - if lhs._name != rhs._name {return false} - if lhs._groupPublicKey != rhs._groupPublicKey {return false} - if lhs._groupPrivateKey != rhs._groupPrivateKey {return false} - if lhs.senderKeys != rhs.senderKeys {return false} - if lhs.members != rhs.members {return false} - if lhs.admins != rhs.admins {return false} - if lhs._type != rhs._type {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_DataMessage.ClosedGroupUpdate.TypeEnum: SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "NEW"), - 1: .same(proto: "INFO"), - 2: .same(proto: "SENDER_KEY_REQUEST"), - 3: .same(proto: "SENDER_KEY"), - ] -} - -extension SignalServiceProtos_DataMessage.ClosedGroupUpdate.SenderKey: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = SignalServiceProtos_DataMessage.ClosedGroupUpdate.protoMessageName + ".SenderKey" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "chainKey"), - 2: .same(proto: "keyIndex"), - 3: .same(proto: "publicKey"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularBytesField(value: &self._chainKey) - case 2: try decoder.decodeSingularUInt32Field(value: &self._keyIndex) - case 3: try decoder.decodeSingularBytesField(value: &self._publicKey) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._chainKey { - try visitor.visitSingularBytesField(value: v, fieldNumber: 1) - } - if let v = self._keyIndex { - try visitor.visitSingularUInt32Field(value: v, fieldNumber: 2) - } - if let v = self._publicKey { - try visitor.visitSingularBytesField(value: v, fieldNumber: 3) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_DataMessage.ClosedGroupUpdate.SenderKey, rhs: SignalServiceProtos_DataMessage.ClosedGroupUpdate.SenderKey) -> Bool { - if lhs._chainKey != rhs._chainKey {return false} - if lhs._keyIndex != rhs._keyIndex {return false} - if lhs._publicKey != rhs._publicKey {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_NullMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".NullMessage" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "padding"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularBytesField(value: &self._padding) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._padding { - try visitor.visitSingularBytesField(value: v, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_NullMessage, rhs: SignalServiceProtos_NullMessage) -> Bool { - if lhs._padding != rhs._padding {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_ReceiptMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".ReceiptMessage" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "type"), - 2: .same(proto: "timestamp"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularEnumField(value: &self._type) - case 2: try decoder.decodeRepeatedUInt64Field(value: &self.timestamp) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._type { - try visitor.visitSingularEnumField(value: v, fieldNumber: 1) - } - if !self.timestamp.isEmpty { - try visitor.visitRepeatedUInt64Field(value: self.timestamp, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_ReceiptMessage, rhs: SignalServiceProtos_ReceiptMessage) -> Bool { - if lhs._type != rhs._type {return false} - if lhs.timestamp != rhs.timestamp {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_ReceiptMessage.TypeEnum: SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "DELIVERY"), - 1: .same(proto: "READ"), - ] -} - -extension SignalServiceProtos_Verified: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".Verified" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "destination"), - 2: .same(proto: "identityKey"), - 3: .same(proto: "state"), - 4: .same(proto: "nullMessage"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &self._destination) - case 2: try decoder.decodeSingularBytesField(value: &self._identityKey) - case 3: try decoder.decodeSingularEnumField(value: &self._state) - case 4: try decoder.decodeSingularBytesField(value: &self._nullMessage) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._destination { - try visitor.visitSingularStringField(value: v, fieldNumber: 1) - } - if let v = self._identityKey { - try visitor.visitSingularBytesField(value: v, fieldNumber: 2) - } - if let v = self._state { - try visitor.visitSingularEnumField(value: v, fieldNumber: 3) - } - if let v = self._nullMessage { - try visitor.visitSingularBytesField(value: v, fieldNumber: 4) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_Verified, rhs: SignalServiceProtos_Verified) -> Bool { - if lhs._destination != rhs._destination {return false} - if lhs._identityKey != rhs._identityKey {return false} - if lhs._state != rhs._state {return false} - if lhs._nullMessage != rhs._nullMessage {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_Verified.State: SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "DEFAULT"), - 1: .same(proto: "VERIFIED"), - 2: .same(proto: "UNVERIFIED"), - ] -} - -extension SignalServiceProtos_SyncMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".SyncMessage" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "sent"), - 2: .same(proto: "contacts"), - 3: .same(proto: "groups"), - 4: .same(proto: "request"), - 5: .same(proto: "read"), - 6: .same(proto: "blocked"), - 7: .same(proto: "verified"), - 9: .same(proto: "configuration"), - 8: .same(proto: "padding"), - 100: .same(proto: "openGroups"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularMessageField(value: &self._sent) - case 2: try decoder.decodeSingularMessageField(value: &self._contacts) - case 3: try decoder.decodeSingularMessageField(value: &self._groups) - case 4: try decoder.decodeSingularMessageField(value: &self._request) - case 5: try decoder.decodeRepeatedMessageField(value: &self.read) - case 6: try decoder.decodeSingularMessageField(value: &self._blocked) - case 7: try decoder.decodeSingularMessageField(value: &self._verified) - case 8: try decoder.decodeSingularBytesField(value: &self._padding) - case 9: try decoder.decodeSingularMessageField(value: &self._configuration) - case 100: try decoder.decodeRepeatedMessageField(value: &self.openGroups) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._sent { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } - if let v = self._contacts { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } - if let v = self._groups { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } - if let v = self._request { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } - if !self.read.isEmpty { - try visitor.visitRepeatedMessageField(value: self.read, fieldNumber: 5) - } - if let v = self._blocked { - try visitor.visitSingularMessageField(value: v, fieldNumber: 6) - } - if let v = self._verified { - try visitor.visitSingularMessageField(value: v, fieldNumber: 7) - } - if let v = self._padding { - try visitor.visitSingularBytesField(value: v, fieldNumber: 8) - } - if let v = self._configuration { - try visitor.visitSingularMessageField(value: v, fieldNumber: 9) - } - if !self.openGroups.isEmpty { - try visitor.visitRepeatedMessageField(value: self.openGroups, fieldNumber: 100) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_SyncMessage, rhs: SignalServiceProtos_SyncMessage) -> Bool { - if lhs._sent != rhs._sent {return false} - if lhs._contacts != rhs._contacts {return false} - if lhs._groups != rhs._groups {return false} - if lhs._request != rhs._request {return false} - if lhs.read != rhs.read {return false} - if lhs._blocked != rhs._blocked {return false} - if lhs._verified != rhs._verified {return false} - if lhs._configuration != rhs._configuration {return false} - if lhs._padding != rhs._padding {return false} - if lhs.openGroups != rhs.openGroups {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_SyncMessage.Sent: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = SignalServiceProtos_SyncMessage.protoMessageName + ".Sent" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "destination"), - 2: .same(proto: "timestamp"), - 3: .same(proto: "message"), - 4: .same(proto: "expirationStartTimestamp"), - 5: .same(proto: "unidentifiedStatus"), - 6: .same(proto: "isRecipientUpdate"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &self._destination) - case 2: try decoder.decodeSingularUInt64Field(value: &self._timestamp) - case 3: try decoder.decodeSingularMessageField(value: &self._message) - case 4: try decoder.decodeSingularUInt64Field(value: &self._expirationStartTimestamp) - case 5: try decoder.decodeRepeatedMessageField(value: &self.unidentifiedStatus) - case 6: try decoder.decodeSingularBoolField(value: &self._isRecipientUpdate) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._destination { - try visitor.visitSingularStringField(value: v, fieldNumber: 1) - } - if let v = self._timestamp { - try visitor.visitSingularUInt64Field(value: v, fieldNumber: 2) - } - if let v = self._message { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } - if let v = self._expirationStartTimestamp { - try visitor.visitSingularUInt64Field(value: v, fieldNumber: 4) - } - if !self.unidentifiedStatus.isEmpty { - try visitor.visitRepeatedMessageField(value: self.unidentifiedStatus, fieldNumber: 5) - } - if let v = self._isRecipientUpdate { - try visitor.visitSingularBoolField(value: v, fieldNumber: 6) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_SyncMessage.Sent, rhs: SignalServiceProtos_SyncMessage.Sent) -> Bool { - if lhs._destination != rhs._destination {return false} - if lhs._timestamp != rhs._timestamp {return false} - if lhs._message != rhs._message {return false} - if lhs._expirationStartTimestamp != rhs._expirationStartTimestamp {return false} - if lhs.unidentifiedStatus != rhs.unidentifiedStatus {return false} - if lhs._isRecipientUpdate != rhs._isRecipientUpdate {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_SyncMessage.Sent.UnidentifiedDeliveryStatus: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = SignalServiceProtos_SyncMessage.Sent.protoMessageName + ".UnidentifiedDeliveryStatus" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "destination"), - 2: .same(proto: "unidentified"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &self._destination) - case 2: try decoder.decodeSingularBoolField(value: &self._unidentified) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._destination { - try visitor.visitSingularStringField(value: v, fieldNumber: 1) - } - if let v = self._unidentified { - try visitor.visitSingularBoolField(value: v, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_SyncMessage.Sent.UnidentifiedDeliveryStatus, rhs: SignalServiceProtos_SyncMessage.Sent.UnidentifiedDeliveryStatus) -> Bool { - if lhs._destination != rhs._destination {return false} - if lhs._unidentified != rhs._unidentified {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_SyncMessage.Contacts: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = SignalServiceProtos_SyncMessage.protoMessageName + ".Contacts" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "blob"), - 2: .same(proto: "isComplete"), - 101: .same(proto: "data"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularMessageField(value: &self._blob) - case 2: try decoder.decodeSingularBoolField(value: &self._isComplete) - case 101: try decoder.decodeSingularBytesField(value: &self._data) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._blob { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } - if let v = self._isComplete { - try visitor.visitSingularBoolField(value: v, fieldNumber: 2) - } - if let v = self._data { - try visitor.visitSingularBytesField(value: v, fieldNumber: 101) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_SyncMessage.Contacts, rhs: SignalServiceProtos_SyncMessage.Contacts) -> Bool { - if lhs._blob != rhs._blob {return false} - if lhs._isComplete != rhs._isComplete {return false} - if lhs._data != rhs._data {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_SyncMessage.Groups: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = SignalServiceProtos_SyncMessage.protoMessageName + ".Groups" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "blob"), - 101: .same(proto: "data"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularMessageField(value: &self._blob) - case 101: try decoder.decodeSingularBytesField(value: &self._data) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._blob { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } - if let v = self._data { - try visitor.visitSingularBytesField(value: v, fieldNumber: 101) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_SyncMessage.Groups, rhs: SignalServiceProtos_SyncMessage.Groups) -> Bool { - if lhs._blob != rhs._blob {return false} - if lhs._data != rhs._data {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_SyncMessage.OpenGroupDetails: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = SignalServiceProtos_SyncMessage.protoMessageName + ".OpenGroupDetails" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "url"), - 2: .same(proto: "channelID"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &self._url) - case 2: try decoder.decodeSingularUInt64Field(value: &self._channelID) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._url { - try visitor.visitSingularStringField(value: v, fieldNumber: 1) - } - if let v = self._channelID { - try visitor.visitSingularUInt64Field(value: v, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_SyncMessage.OpenGroupDetails, rhs: SignalServiceProtos_SyncMessage.OpenGroupDetails) -> Bool { - if lhs._url != rhs._url {return false} - if lhs._channelID != rhs._channelID {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_SyncMessage.Blocked: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = SignalServiceProtos_SyncMessage.protoMessageName + ".Blocked" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "numbers"), - 2: .same(proto: "groupIds"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeRepeatedStringField(value: &self.numbers) - case 2: try decoder.decodeRepeatedBytesField(value: &self.groupIds) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if !self.numbers.isEmpty { - try visitor.visitRepeatedStringField(value: self.numbers, fieldNumber: 1) - } - if !self.groupIds.isEmpty { - try visitor.visitRepeatedBytesField(value: self.groupIds, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_SyncMessage.Blocked, rhs: SignalServiceProtos_SyncMessage.Blocked) -> Bool { - if lhs.numbers != rhs.numbers {return false} - if lhs.groupIds != rhs.groupIds {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_SyncMessage.Request: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = SignalServiceProtos_SyncMessage.protoMessageName + ".Request" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "type"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularEnumField(value: &self._type) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._type { - try visitor.visitSingularEnumField(value: v, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_SyncMessage.Request, rhs: SignalServiceProtos_SyncMessage.Request) -> Bool { - if lhs._type != rhs._type {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_SyncMessage.Request.TypeEnum: SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN"), - 1: .same(proto: "CONTACTS"), - 2: .same(proto: "GROUPS"), - 3: .same(proto: "BLOCKED"), - 4: .same(proto: "CONFIGURATION"), - ] -} - -extension SignalServiceProtos_SyncMessage.Read: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = SignalServiceProtos_SyncMessage.protoMessageName + ".Read" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "sender"), - 2: .same(proto: "timestamp"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &self._sender) - case 2: try decoder.decodeSingularUInt64Field(value: &self._timestamp) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._sender { - try visitor.visitSingularStringField(value: v, fieldNumber: 1) - } - if let v = self._timestamp { - try visitor.visitSingularUInt64Field(value: v, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_SyncMessage.Read, rhs: SignalServiceProtos_SyncMessage.Read) -> Bool { - if lhs._sender != rhs._sender {return false} - if lhs._timestamp != rhs._timestamp {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_SyncMessage.Configuration: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = SignalServiceProtos_SyncMessage.protoMessageName + ".Configuration" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "readReceipts"), - 2: .same(proto: "unidentifiedDeliveryIndicators"), - 3: .same(proto: "typingIndicators"), - 4: .same(proto: "linkPreviews"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularBoolField(value: &self._readReceipts) - case 2: try decoder.decodeSingularBoolField(value: &self._unidentifiedDeliveryIndicators) - case 3: try decoder.decodeSingularBoolField(value: &self._typingIndicators) - case 4: try decoder.decodeSingularBoolField(value: &self._linkPreviews) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._readReceipts { - try visitor.visitSingularBoolField(value: v, fieldNumber: 1) - } - if let v = self._unidentifiedDeliveryIndicators { - try visitor.visitSingularBoolField(value: v, fieldNumber: 2) - } - if let v = self._typingIndicators { - try visitor.visitSingularBoolField(value: v, fieldNumber: 3) - } - if let v = self._linkPreviews { - try visitor.visitSingularBoolField(value: v, fieldNumber: 4) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_SyncMessage.Configuration, rhs: SignalServiceProtos_SyncMessage.Configuration) -> Bool { - if lhs._readReceipts != rhs._readReceipts {return false} - if lhs._unidentifiedDeliveryIndicators != rhs._unidentifiedDeliveryIndicators {return false} - if lhs._typingIndicators != rhs._typingIndicators {return false} - if lhs._linkPreviews != rhs._linkPreviews {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_AttachmentPointer: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".AttachmentPointer" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "id"), - 2: .same(proto: "contentType"), - 3: .same(proto: "key"), - 4: .same(proto: "size"), - 5: .same(proto: "thumbnail"), - 6: .same(proto: "digest"), - 7: .same(proto: "fileName"), - 8: .same(proto: "flags"), - 9: .same(proto: "width"), - 10: .same(proto: "height"), - 11: .same(proto: "caption"), - 101: .same(proto: "url"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularFixed64Field(value: &self._id) - case 2: try decoder.decodeSingularStringField(value: &self._contentType) - case 3: try decoder.decodeSingularBytesField(value: &self._key) - case 4: try decoder.decodeSingularUInt32Field(value: &self._size) - case 5: try decoder.decodeSingularBytesField(value: &self._thumbnail) - case 6: try decoder.decodeSingularBytesField(value: &self._digest) - case 7: try decoder.decodeSingularStringField(value: &self._fileName) - case 8: try decoder.decodeSingularUInt32Field(value: &self._flags) - case 9: try decoder.decodeSingularUInt32Field(value: &self._width) - case 10: try decoder.decodeSingularUInt32Field(value: &self._height) - case 11: try decoder.decodeSingularStringField(value: &self._caption) - case 101: try decoder.decodeSingularStringField(value: &self._url) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._id { - try visitor.visitSingularFixed64Field(value: v, fieldNumber: 1) - } - if let v = self._contentType { - try visitor.visitSingularStringField(value: v, fieldNumber: 2) - } - if let v = self._key { - try visitor.visitSingularBytesField(value: v, fieldNumber: 3) - } - if let v = self._size { - try visitor.visitSingularUInt32Field(value: v, fieldNumber: 4) - } - if let v = self._thumbnail { - try visitor.visitSingularBytesField(value: v, fieldNumber: 5) - } - if let v = self._digest { - try visitor.visitSingularBytesField(value: v, fieldNumber: 6) - } - if let v = self._fileName { - try visitor.visitSingularStringField(value: v, fieldNumber: 7) - } - if let v = self._flags { - try visitor.visitSingularUInt32Field(value: v, fieldNumber: 8) - } - if let v = self._width { - try visitor.visitSingularUInt32Field(value: v, fieldNumber: 9) - } - if let v = self._height { - try visitor.visitSingularUInt32Field(value: v, fieldNumber: 10) - } - if let v = self._caption { - try visitor.visitSingularStringField(value: v, fieldNumber: 11) - } - if let v = self._url { - try visitor.visitSingularStringField(value: v, fieldNumber: 101) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_AttachmentPointer, rhs: SignalServiceProtos_AttachmentPointer) -> Bool { - if lhs._id != rhs._id {return false} - if lhs._contentType != rhs._contentType {return false} - if lhs._key != rhs._key {return false} - if lhs._size != rhs._size {return false} - if lhs._thumbnail != rhs._thumbnail {return false} - if lhs._digest != rhs._digest {return false} - if lhs._fileName != rhs._fileName {return false} - if lhs._flags != rhs._flags {return false} - if lhs._width != rhs._width {return false} - if lhs._height != rhs._height {return false} - if lhs._caption != rhs._caption {return false} - if lhs._url != rhs._url {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_AttachmentPointer.Flags: SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "VOICE_MESSAGE"), - ] -} - -extension SignalServiceProtos_GroupContext: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".GroupContext" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "id"), - 2: .same(proto: "type"), - 3: .same(proto: "name"), - 4: .same(proto: "members"), - 5: .same(proto: "avatar"), - 6: .same(proto: "admins"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularBytesField(value: &self._id) - case 2: try decoder.decodeSingularEnumField(value: &self._type) - case 3: try decoder.decodeSingularStringField(value: &self._name) - case 4: try decoder.decodeRepeatedStringField(value: &self.members) - case 5: try decoder.decodeSingularMessageField(value: &self._avatar) - case 6: try decoder.decodeRepeatedStringField(value: &self.admins) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._id { - try visitor.visitSingularBytesField(value: v, fieldNumber: 1) - } - if let v = self._type { - try visitor.visitSingularEnumField(value: v, fieldNumber: 2) - } - if let v = self._name { - try visitor.visitSingularStringField(value: v, fieldNumber: 3) - } - if !self.members.isEmpty { - try visitor.visitRepeatedStringField(value: self.members, fieldNumber: 4) - } - if let v = self._avatar { - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } - if !self.admins.isEmpty { - try visitor.visitRepeatedStringField(value: self.admins, fieldNumber: 6) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_GroupContext, rhs: SignalServiceProtos_GroupContext) -> Bool { - if lhs._id != rhs._id {return false} - if lhs._type != rhs._type {return false} - if lhs._name != rhs._name {return false} - if lhs.members != rhs.members {return false} - if lhs._avatar != rhs._avatar {return false} - if lhs.admins != rhs.admins {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_GroupContext.TypeEnum: SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN"), - 1: .same(proto: "UPDATE"), - 2: .same(proto: "DELIVER"), - 3: .same(proto: "QUIT"), - 4: .same(proto: "REQUEST_INFO"), - ] -} - -extension SignalServiceProtos_ContactDetails: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".ContactDetails" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "number"), - 2: .same(proto: "name"), - 3: .same(proto: "avatar"), - 4: .same(proto: "color"), - 5: .same(proto: "verified"), - 6: .same(proto: "profileKey"), - 7: .same(proto: "blocked"), - 8: .same(proto: "expireTimer"), - 101: .same(proto: "nickname"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &self._number) - case 2: try decoder.decodeSingularStringField(value: &self._name) - case 3: try decoder.decodeSingularMessageField(value: &self._avatar) - case 4: try decoder.decodeSingularStringField(value: &self._color) - case 5: try decoder.decodeSingularMessageField(value: &self._verified) - case 6: try decoder.decodeSingularBytesField(value: &self._profileKey) - case 7: try decoder.decodeSingularBoolField(value: &self._blocked) - case 8: try decoder.decodeSingularUInt32Field(value: &self._expireTimer) - case 101: try decoder.decodeSingularStringField(value: &self._nickname) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._number { - try visitor.visitSingularStringField(value: v, fieldNumber: 1) - } - if let v = self._name { - try visitor.visitSingularStringField(value: v, fieldNumber: 2) - } - if let v = self._avatar { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } - if let v = self._color { - try visitor.visitSingularStringField(value: v, fieldNumber: 4) - } - if let v = self._verified { - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } - if let v = self._profileKey { - try visitor.visitSingularBytesField(value: v, fieldNumber: 6) - } - if let v = self._blocked { - try visitor.visitSingularBoolField(value: v, fieldNumber: 7) - } - if let v = self._expireTimer { - try visitor.visitSingularUInt32Field(value: v, fieldNumber: 8) - } - if let v = self._nickname { - try visitor.visitSingularStringField(value: v, fieldNumber: 101) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_ContactDetails, rhs: SignalServiceProtos_ContactDetails) -> Bool { - if lhs._number != rhs._number {return false} - if lhs._name != rhs._name {return false} - if lhs._avatar != rhs._avatar {return false} - if lhs._color != rhs._color {return false} - if lhs._verified != rhs._verified {return false} - if lhs._profileKey != rhs._profileKey {return false} - if lhs._blocked != rhs._blocked {return false} - if lhs._expireTimer != rhs._expireTimer {return false} - if lhs._nickname != rhs._nickname {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_ContactDetails.Avatar: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = SignalServiceProtos_ContactDetails.protoMessageName + ".Avatar" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "contentType"), - 2: .same(proto: "length"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &self._contentType) - case 2: try decoder.decodeSingularUInt32Field(value: &self._length) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._contentType { - try visitor.visitSingularStringField(value: v, fieldNumber: 1) - } - if let v = self._length { - try visitor.visitSingularUInt32Field(value: v, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_ContactDetails.Avatar, rhs: SignalServiceProtos_ContactDetails.Avatar) -> Bool { - if lhs._contentType != rhs._contentType {return false} - if lhs._length != rhs._length {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_GroupDetails: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".GroupDetails" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "id"), - 2: .same(proto: "name"), - 3: .same(proto: "members"), - 4: .same(proto: "avatar"), - 5: .same(proto: "active"), - 6: .same(proto: "expireTimer"), - 7: .same(proto: "color"), - 8: .same(proto: "blocked"), - 9: .same(proto: "admins"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularBytesField(value: &self._id) - case 2: try decoder.decodeSingularStringField(value: &self._name) - case 3: try decoder.decodeRepeatedStringField(value: &self.members) - case 4: try decoder.decodeSingularMessageField(value: &self._avatar) - case 5: try decoder.decodeSingularBoolField(value: &self._active) - case 6: try decoder.decodeSingularUInt32Field(value: &self._expireTimer) - case 7: try decoder.decodeSingularStringField(value: &self._color) - case 8: try decoder.decodeSingularBoolField(value: &self._blocked) - case 9: try decoder.decodeRepeatedStringField(value: &self.admins) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._id { - try visitor.visitSingularBytesField(value: v, fieldNumber: 1) - } - if let v = self._name { - try visitor.visitSingularStringField(value: v, fieldNumber: 2) - } - if !self.members.isEmpty { - try visitor.visitRepeatedStringField(value: self.members, fieldNumber: 3) - } - if let v = self._avatar { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } - if let v = self._active { - try visitor.visitSingularBoolField(value: v, fieldNumber: 5) - } - if let v = self._expireTimer { - try visitor.visitSingularUInt32Field(value: v, fieldNumber: 6) - } - if let v = self._color { - try visitor.visitSingularStringField(value: v, fieldNumber: 7) - } - if let v = self._blocked { - try visitor.visitSingularBoolField(value: v, fieldNumber: 8) - } - if !self.admins.isEmpty { - try visitor.visitRepeatedStringField(value: self.admins, fieldNumber: 9) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_GroupDetails, rhs: SignalServiceProtos_GroupDetails) -> Bool { - if lhs._id != rhs._id {return false} - if lhs._name != rhs._name {return false} - if lhs.members != rhs.members {return false} - if lhs._avatar != rhs._avatar {return false} - if lhs._active != rhs._active {return false} - if lhs._expireTimer != rhs._expireTimer {return false} - if lhs._color != rhs._color {return false} - if lhs._blocked != rhs._blocked {return false} - if lhs.admins != rhs.admins {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_GroupDetails.Avatar: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = SignalServiceProtos_GroupDetails.protoMessageName + ".Avatar" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "contentType"), - 2: .same(proto: "length"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &self._contentType) - case 2: try decoder.decodeSingularUInt32Field(value: &self._length) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._contentType { - try visitor.visitSingularStringField(value: v, fieldNumber: 1) - } - if let v = self._length { - try visitor.visitSingularUInt32Field(value: v, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_GroupDetails.Avatar, rhs: SignalServiceProtos_GroupDetails.Avatar) -> Bool { - if lhs._contentType != rhs._contentType {return false} - if lhs._length != rhs._length {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension SignalServiceProtos_PublicChatInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".PublicChatInfo" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "serverID"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularUInt64Field(value: &self._serverID) - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if let v = self._serverID { - try visitor.visitSingularUInt64Field(value: v, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: SignalServiceProtos_PublicChatInfo, rhs: SignalServiceProtos_PublicChatInfo) -> Bool { - if lhs._serverID != rhs._serverID {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} diff --git a/SignalUtilitiesKit/SignalServiceProfile.swift b/SignalUtilitiesKit/SignalServiceProfile.swift deleted file mode 100644 index e1175884f..000000000 --- a/SignalUtilitiesKit/SignalServiceProfile.swift +++ /dev/null @@ -1,54 +0,0 @@ -// -// Copyright (c) 2018 Open Whisper Systems. All rights reserved. -// - -import Foundation - -@objc -public class SignalServiceProfile: NSObject { - - public enum ValidationError: Error { - case invalid(description: String) - case invalidIdentityKey(description: String) - case invalidProfileName(description: String) - } - - public let recipientId: String - public let identityKey: Data - public let profileNameEncrypted: Data? - public let avatarUrlPath: String? - public let unidentifiedAccessVerifier: Data? - public let hasUnrestrictedUnidentifiedAccess: Bool - - public init(recipientId: String, responseObject: Any?) throws { - self.recipientId = recipientId - - guard let params = ParamParser(responseObject: responseObject) else { - throw ValidationError.invalid(description: "invalid response: \(String(describing: responseObject))") - } - - let identityKeyWithType = try params.requiredBase64EncodedData(key: "identityKey") - let kIdentityKeyLength = 33 - guard identityKeyWithType.count == kIdentityKeyLength else { - throw ValidationError.invalidIdentityKey(description: "malformed identity key \(identityKeyWithType.hexadecimalString) with decoded length: \(identityKeyWithType.count)") - } - do { - // `removeKeyType` is an objc category method only on NSData, so temporarily cast. - self.identityKey = try (identityKeyWithType as NSData).removeKeyType() as Data - } catch { - // `removeKeyType` throws an SCKExceptionWrapperError, which, typically should - // be unwrapped by any objc code calling this method. - owsFailDebug("identify key had unexpected format") - throw ValidationError.invalidIdentityKey(description: "malformed identity key \(identityKeyWithType.hexadecimalString) with data: \(identityKeyWithType)") - } - - self.profileNameEncrypted = try params.optionalBase64EncodedData(key: "name") - - let avatarUrlPath: String? = try params.optional(key: "avatar") - self.avatarUrlPath = avatarUrlPath - - self.unidentifiedAccessVerifier = try params.optionalBase64EncodedData(key: "unidentifiedAccess") - - self.hasUnrestrictedUnidentifiedAccess = try params.optional(key: "unrestrictedUnidentifiedAccess") ?? false - } -} diff --git a/SignalUtilitiesKit/Threads/TSContactThread.m b/SignalUtilitiesKit/Threads/TSContactThread.m index 9db8c904f..93efedf57 100644 --- a/SignalUtilitiesKit/Threads/TSContactThread.m +++ b/SignalUtilitiesKit/Threads/TSContactThread.m @@ -3,7 +3,6 @@ // #import "TSContactThread.h" -#import "ContactsManagerProtocol.h" #import "NotificationsProtocol.h" #import "OWSIdentityManager.h" #import "SSKEnvironment.h" diff --git a/SignalUtilitiesKit/Threads/TSGroupModel.h b/SignalUtilitiesKit/Threads/TSGroupModel.h index bf567fb81..9a3de614f 100644 --- a/SignalUtilitiesKit/Threads/TSGroupModel.h +++ b/SignalUtilitiesKit/Threads/TSGroupModel.h @@ -2,7 +2,6 @@ // Copyright (c) 2018 Open Whisper Systems. All rights reserved. // -#import #import #import diff --git a/SignalUtilitiesKit/ThreadUtil.h b/SignalUtilitiesKit/Threads/ThreadUtil.h similarity index 100% rename from SignalUtilitiesKit/ThreadUtil.h rename to SignalUtilitiesKit/Threads/ThreadUtil.h diff --git a/SignalUtilitiesKit/ThreadUtil.m b/SignalUtilitiesKit/Threads/ThreadUtil.m similarity index 97% rename from SignalUtilitiesKit/ThreadUtil.m rename to SignalUtilitiesKit/Threads/ThreadUtil.m index f8b4c34b6..b42ffda76 100644 --- a/SignalUtilitiesKit/ThreadUtil.m +++ b/SignalUtilitiesKit/Threads/ThreadUtil.m @@ -143,13 +143,13 @@ NS_ASSUME_NONNULL_BEGIN } + (void)ensureUnreadIndicator:(ThreadDynamicInteractions *)dynamicInteractions - thread:(TSThread *)thread - transaction:(YapDatabaseReadTransaction *)transaction - maxRangeSize:(int)maxRangeSize - blockingSafetyNumberChanges:(NSArray *)blockingSafetyNumberChanges - nonBlockingSafetyNumberChanges:(NSArray *)nonBlockingSafetyNumberChanges - hideUnreadMessagesIndicator:(BOOL)hideUnreadMessagesIndicator - firstUnseenSortId:(nullable NSNumber *)firstUnseenSortId + thread:(TSThread *)thread + transaction:(YapDatabaseReadTransaction *)transaction + maxRangeSize:(int)maxRangeSize + blockingSafetyNumberChanges:(NSArray *)blockingSafetyNumberChanges + nonBlockingSafetyNumberChanges:(NSArray *)nonBlockingSafetyNumberChanges + hideUnreadMessagesIndicator:(BOOL)hideUnreadMessagesIndicator + firstUnseenSortId:(nullable NSNumber *)firstUnseenSortId { OWSAssertDebug(dynamicInteractions); OWSAssertDebug(thread); diff --git a/SignalUtilitiesKit/FunctionalUtil.h b/SignalUtilitiesKit/Utilities/FunctionalUtil.h similarity index 100% rename from SignalUtilitiesKit/FunctionalUtil.h rename to SignalUtilitiesKit/Utilities/FunctionalUtil.h diff --git a/SignalUtilitiesKit/FunctionalUtil.m b/SignalUtilitiesKit/Utilities/FunctionalUtil.m similarity index 100% rename from SignalUtilitiesKit/FunctionalUtil.m rename to SignalUtilitiesKit/Utilities/FunctionalUtil.m diff --git a/SignalUtilitiesKit/Utilities/LKGroupUtilities.m b/SignalUtilitiesKit/Utilities/LKGroupUtilities.m index 9cced30f0..78c79b86b 100644 --- a/SignalUtilitiesKit/Utilities/LKGroupUtilities.m +++ b/SignalUtilitiesKit/Utilities/LKGroupUtilities.m @@ -37,7 +37,7 @@ return [[MMSGroupPrefix stringByAppendingString:groupID] dataUsingEncoding:NSUTF8StringEncoding]; } -+(NSString *)getEncodedGroupID: (NSData *)groupID ++(NSString *)getEncodedGroupID:(NSData *)groupID { return [[NSString alloc] initWithData:groupID encoding:NSUTF8StringEncoding]; } @@ -54,13 +54,7 @@ +(NSData *)getDecodedGroupIDAsData:(NSData *)groupID { - OWSAssertDebug(groupID.length > 0); - NSString *encodedGroupID = [[NSString alloc]initWithData:groupID encoding:NSUTF8StringEncoding]; - NSString *decodedGroupID = [encodedGroupID componentsSeparatedByString:@"!"][0]; - if ([encodedGroupID componentsSeparatedByString:@"!"].count > 1) { - decodedGroupID = [encodedGroupID componentsSeparatedByString:@"!"][1]; - } - return [decodedGroupID dataUsingEncoding:NSUTF8StringEncoding]; + return [[LKGroupUtilities getDecodedGroupID:groupID] dataUsingEncoding:NSUTF8StringEncoding]; } @end diff --git a/SignalUtilitiesKit/Notification+Loki.swift b/SignalUtilitiesKit/Utilities/Notification+Loki.swift similarity index 100% rename from SignalUtilitiesKit/Notification+Loki.swift rename to SignalUtilitiesKit/Utilities/Notification+Loki.swift diff --git a/SignalUtilitiesKit/ParamParser.swift b/SignalUtilitiesKit/Utilities/ParamParser.swift similarity index 100% rename from SignalUtilitiesKit/ParamParser.swift rename to SignalUtilitiesKit/Utilities/ParamParser.swift diff --git a/SignalUtilitiesKit/SSKIncrementingIdFinder.swift b/SignalUtilitiesKit/Utilities/SSKIncrementingIdFinder.swift similarity index 100% rename from SignalUtilitiesKit/SSKIncrementingIdFinder.swift rename to SignalUtilitiesKit/Utilities/SSKIncrementingIdFinder.swift diff --git a/SignalUtilitiesKit/SwiftSingletons.swift b/SignalUtilitiesKit/Utilities/SwiftSingletons.swift similarity index 100% rename from SignalUtilitiesKit/SwiftSingletons.swift rename to SignalUtilitiesKit/Utilities/SwiftSingletons.swift