CR: cleanup

// FREEBIE
pull/1/head
sdkjfhsdkjhfsdlkjhfsdf 7 years ago
parent 6e2d9c8141
commit 3a6ddd4bf8

@ -1540,8 +1540,8 @@
/* action sheet item */ /* action sheet item */
"SHARE_ACTION_TWEET" = "Twitter"; "SHARE_ACTION_TWEET" = "Twitter";
/* alert body when sharing filefailed because of untrusted/changed identity keys */ /* alert body when sharing file failed 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."; "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. */ /* Indicates that the share extension is still loading. */
"SHARE_EXTENSION_LOADING" = "Loading..."; "SHARE_EXTENSION_LOADING" = "Loading...";

@ -1,5 +1,5 @@
// //
// Copyright (c) 2017 Open Whisper Systems. All rights reserved. // Copyright (c) 2018 Open Whisper Systems. All rights reserved.
// //
import Foundation import Foundation
@ -17,6 +17,12 @@ public class AttachmentApprovalViewController: OWSViewController, CaptioningTool
let TAG = "[AttachmentApprovalViewController]" let TAG = "[AttachmentApprovalViewController]"
weak var delegate: AttachmentApprovalViewControllerDelegate? 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 // MARK: Properties
let attachment: SignalAttachment let attachment: SignalAttachment
@ -240,14 +246,10 @@ public class AttachmentApprovalViewController: OWSViewController, CaptioningTool
} }
// When the keyboard is popped, it can obscure the attachment view. // 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 private var shouldAllowAttachmentViewResizing: Bool = true
enum AttachmetViewScale { private func scaleAttachmentView(_ fit: AttachmentViewScale) {
case fullsize, compact
}
private func scaleAttachmentView(_ fit: AttachmetViewScale) {
guard shouldAllowAttachmentViewResizing else { guard shouldAllowAttachmentViewResizing else {
if self.scrollView.transform != CGAffineTransform.identity { if self.scrollView.transform != CGAffineTransform.identity {
UIView.animate(withDuration: 0.2) { UIView.animate(withDuration: 0.2) {

@ -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" #import "SharingThreadPickerViewController.h"
@ -239,11 +239,11 @@ NS_ASSUME_NONNULL_BEGIN
NSString *failureTitle = NSLocalizedString(@"SHARE_EXTENSION_SENDING_FAILURE_TITLE", @"Alert title"); 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 *_Nullable untrustedRecipientId = error.userInfo[OWSErrorRecipientIdentifierKey];
NSString *failureFormat = NSLocalizedString(@"SHARE_EXTENSION_FAILED_SENDING_BECAUSE_UNTRUSTED_IDENTITY_KEY", NSString *failureFormat = NSLocalizedString(@"SHARE_EXTENSION_FAILED_SENDING_BECAUSE_UNTRUSTED_IDENTITY_FORMAT",
@"alert body when sharing filefailed because of untrusted/changed identity keys"); @"alert body when sharing file failed because of untrusted/changed identity keys");
NSString *displayName = [self.contactsManager displayNameForPhoneIdentifier:untrustedRecipientId]; NSString *displayName = [self.contactsManager displayNameForPhoneIdentifier:untrustedRecipientId];
NSString *failureMessage = [NSString stringWithFormat:failureFormat, displayName]; NSString *failureMessage = [NSString stringWithFormat:failureFormat, displayName];

Loading…
Cancel
Save