diff --git a/Signal/src/ViewControllers/FullImageViewController.m b/Signal/src/ViewControllers/FullImageViewController.m index 5bf3b60a4..33e4e5020 100644 --- a/Signal/src/ViewControllers/FullImageViewController.m +++ b/Signal/src/ViewControllers/FullImageViewController.m @@ -60,6 +60,7 @@ @property (nonatomic) id messageItem; @property (nonatomic) UIToolbar *footerBar; +@property (nonatomic) NSArray *oldMenuItems; @end @@ -257,6 +258,9 @@ [[UIMenuItem alloc] initWithTitle:NSLocalizedString(@"EDIT_ITEM_SHARE_ACTION", @"Short name for edit menu item to share contents of media message.") action:@selector(shareAttachment:)], ]; + if (!self.oldMenuItems) { + self.oldMenuItems = [UIMenuController sharedMenuController].menuItems; + } [UIMenuController sharedMenuController].menuItems = menuItems; CGPoint location = [sender locationInView:self.view]; CGRect targetRect = CGRectMake(location.x, @@ -342,6 +346,12 @@ } - (void)dismiss { + + // Restore the edit menu items if necessary. + if (self.oldMenuItems) { + [UIMenuController sharedMenuController].menuItems = self.oldMenuItems; + } + self.view.userInteractionEnabled = NO; [UIView animateWithDuration:0.25f delay:0 diff --git a/Signal/src/ViewControllers/MessagesViewController.m b/Signal/src/ViewControllers/MessagesViewController.m index a84002d96..40bdfd1f3 100644 --- a/Signal/src/ViewControllers/MessagesViewController.m +++ b/Signal/src/ViewControllers/MessagesViewController.m @@ -556,13 +556,20 @@ typedef enum : NSUInteger { // need to set them every time we enter this view. SEL saveSelector = NSSelectorFromString(@"save:"); SEL shareSelector = NSSelectorFromString(@"share:"); - [UIMenuController sharedMenuController].menuItems = @[ [[UIMenuItem alloc] initWithTitle:NSLocalizedString(@"EDIT_ITEM_SAVE_ACTION", - @"Short name for edit menu item to save contents of media message.") - action:saveSelector], - [[UIMenuItem alloc] initWithTitle:NSLocalizedString(@"EDIT_ITEM_SHARE_ACTION", - @"Short name for edit menu item to share contents of media message.") - action:shareSelector], - ]; + [UIMenuController sharedMenuController].menuItems = @[ + [[UIMenuItem alloc] initWithTitle:NSLocalizedString(@"EDIT_ITEM_SAVE_ACTION", + @"Short name for edit menu item to save contents of media message.") + action:saveSelector], + [[UIMenuItem alloc] initWithTitle:NSLocalizedString(@"EDIT_ITEM_SHARE_ACTION", + @"Short name for edit menu item to share contents of media message.") + action:shareSelector], + [[UIMenuItem alloc] initWithTitle:NSLocalizedString(@"EDIT_ITEM_COPY_ACTION", + @"Short name for edit menu item to copy contents of media message.") + action:@selector(copy:)], + [[UIMenuItem alloc] initWithTitle:NSLocalizedString(@"EDIT_ITEM_DELETE_ACTION", + @"Short name for edit menu item to delete contents of media message.") + action:@selector(delete:)], + ]; [self ensureBlockStateIndicator]; @@ -1720,7 +1727,7 @@ typedef enum : NSUInteger { messageItem:messageItem isAnimated:NO]; - [vc presentFromViewController:self.navigationController]; + [vc presentFromViewController:self]; } } } else if ([[messageItem media] isKindOfClass:[TSAnimatedAdapter class]]) { @@ -1749,7 +1756,7 @@ typedef enum : NSUInteger { forInteraction:interaction messageItem:messageItem isAnimated:YES]; - [vc presentFromViewController:self.navigationController]; + [vc presentFromViewController:self]; } } } else if ([[messageItem media] isKindOfClass:[TSVideoAttachmentAdapter class]]) { diff --git a/Signal/translations/en.lproj/Localizable.strings b/Signal/translations/en.lproj/Localizable.strings index 0cdff1500..d6dd162d6 100644 --- a/Signal/translations/en.lproj/Localizable.strings +++ b/Signal/translations/en.lproj/Localizable.strings @@ -325,6 +325,9 @@ /* Short name for edit menu item to share contents of media message. */ "EDIT_ITEM_SHARE_ACTION" = "Share"; +/* Short name for edit menu item to share contents of media message. */ +"EDIT_ITEM_DELETE_ACTION" = "Delete"; + /* body of email sent to contacts when inviting to install Signal. Embeds {{link to install Signal}} and {{link to WhisperSystems home page}} */ "EMAIL_INVITE_BODY" = "Hey,\n\nLately I've been using Signal to keep the conversations on my iPhone private. I'd like you to install it too, so we can be confident that only you and I can read our messages or hear our calls.\n\nSignal is available for iPhones and Android. Get it here: %@\n\nSignal works like your existing messaging app. We can send pictures and video, make calls, and start group chats. The best part is, no one else can see any of it, not even the people who make Signal!\n\nYou can read more about Open Whisper Systems, the people who make Signal, here: %@";