From 3a6ddd4bf837c8dceeda9144f24051e48cf46ac5 Mon Sep 17 00:00:00 2001 From: sdkjfhsdkjhfsdlkjhfsdf Date: Tue, 2 Jan 2018 11:23:54 -0600 Subject: [PATCH] CR: cleanup // FREEBIE --- Signal/translations/en.lproj/Localizable.strings | 4 ++-- .../AttachmentApprovalViewController.swift | 16 +++++++++------- .../SharingThreadPickerViewController.m | 8 ++++---- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Signal/translations/en.lproj/Localizable.strings b/Signal/translations/en.lproj/Localizable.strings index d6352bc12..987c5cf90 100644 --- a/Signal/translations/en.lproj/Localizable.strings +++ b/Signal/translations/en.lproj/Localizable.strings @@ -1540,8 +1540,8 @@ /* action sheet item */ "SHARE_ACTION_TWEET" = "Twitter"; -/* alert body when sharing filefailed because of untrusted/changed identity keys */ -"SHARE_EXTENSION_FAILED_SENDING_BECAUSE_UNTRUSTED_IDENTITY_KEY" = "Your safety number with %@ has recently changed. You may wish to verify it in the main app before resending."; +/* alert body when sharing file failed because of untrusted/changed identity keys */ +"SHARE_EXTENSION_FAILED_SENDING_BECAUSE_UNTRUSTED_IDENTITY_FORMAT" = "Your safety number with %@ has recently changed. You may wish to verify it in the main app before resending."; /* Indicates that the share extension is still loading. */ "SHARE_EXTENSION_LOADING" = "Loading..."; diff --git a/SignalMessaging/attachments/AttachmentApprovalViewController.swift b/SignalMessaging/attachments/AttachmentApprovalViewController.swift index 5bcb99564..ab143a5cb 100644 --- a/SignalMessaging/attachments/AttachmentApprovalViewController.swift +++ b/SignalMessaging/attachments/AttachmentApprovalViewController.swift @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Open Whisper Systems. All rights reserved. +// Copyright (c) 2018 Open Whisper Systems. All rights reserved. // import Foundation @@ -17,6 +17,12 @@ public class AttachmentApprovalViewController: OWSViewController, CaptioningTool let TAG = "[AttachmentApprovalViewController]" weak var delegate: AttachmentApprovalViewControllerDelegate? + // We sometimes shrink the attachment view so that it remains somewhat visible + // when the keyboard is presented. + enum AttachmentViewScale { + case fullsize, compact + } + // MARK: Properties let attachment: SignalAttachment @@ -240,14 +246,10 @@ public class AttachmentApprovalViewController: OWSViewController, CaptioningTool } // When the keyboard is popped, it can obscure the attachment view. - // so we sometimes allows resizing the attachment. + // so we sometimes allow resizing the attachment. private var shouldAllowAttachmentViewResizing: Bool = true - enum AttachmetViewScale { - case fullsize, compact - } - - private func scaleAttachmentView(_ fit: AttachmetViewScale) { + private func scaleAttachmentView(_ fit: AttachmentViewScale) { guard shouldAllowAttachmentViewResizing else { if self.scrollView.transform != CGAffineTransform.identity { UIView.animate(withDuration: 0.2) { diff --git a/SignalMessaging/attachments/SharingThreadPickerViewController.m b/SignalMessaging/attachments/SharingThreadPickerViewController.m index c5f9a58b4..7028148f4 100644 --- a/SignalMessaging/attachments/SharingThreadPickerViewController.m +++ b/SignalMessaging/attachments/SharingThreadPickerViewController.m @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Open Whisper Systems. All rights reserved. +// Copyright (c) 2018 Open Whisper Systems. All rights reserved. // #import "SharingThreadPickerViewController.h" @@ -239,11 +239,11 @@ NS_ASSUME_NONNULL_BEGIN NSString *failureTitle = NSLocalizedString(@"SHARE_EXTENSION_SENDING_FAILURE_TITLE", @"Alert title"); - if (error.code == OWSErrorCodeUntrustedIdentity) { + if ([error.domain isEqual:OWSSignalServiceKitErrorDomain] && error.code == OWSErrorCodeUntrustedIdentity) { NSString *_Nullable untrustedRecipientId = error.userInfo[OWSErrorRecipientIdentifierKey]; - NSString *failureFormat = NSLocalizedString(@"SHARE_EXTENSION_FAILED_SENDING_BECAUSE_UNTRUSTED_IDENTITY_KEY", - @"alert body when sharing filefailed because of untrusted/changed identity keys"); + NSString *failureFormat = NSLocalizedString(@"SHARE_EXTENSION_FAILED_SENDING_BECAUSE_UNTRUSTED_IDENTITY_FORMAT", + @"alert body when sharing file failed because of untrusted/changed identity keys"); NSString *displayName = [self.contactsManager displayNameForPhoneIdentifier:untrustedRecipientId]; NSString *failureMessage = [NSString stringWithFormat:failureFormat, displayName];