CR: cleanup

// FREEBIE
This commit is contained in:
sdkjfhsdkjhfsdlkjhfsdf 2018-01-02 11:23:54 -06:00
parent 6e2d9c8141
commit 3a6ddd4bf8
3 changed files with 15 additions and 13 deletions

View File

@ -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...";

View File

@ -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) {

View File

@ -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];