3D Touch: Quick Compose

pull/1/head
Frederic Jacobs 9 years ago
parent 0fd9acfb2c
commit 777e7e16f0

@ -21,7 +21,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.1.4</string>
<string>2.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
@ -38,7 +38,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>2.1.90</string>
<string>2.2.0</string>
<key>LOGS_EMAIL</key>
<string>support@whispersystems.org</string>
<key>LOGS_URL</key>
@ -71,6 +71,17 @@
<string>Signal uses your contacts to find users you know. We do not store your contacts on the server.</string>
<key>NSMicrophoneUsageDescription</key>
<string>Signal needs access to your microphone to make and receive phone calls.</string>
<key>UIApplicationShortcutItems</key>
<array>
<dict>
<key>UIApplicationShortcutItemIconType</key>
<string>UIApplicationShortcutIconTypeCompose</string>
<key>UIApplicationShortcutItemTitle</key>
<string>New Message</string>
<key>UIApplicationShortcutItemType</key>
<string>org.whispersystems.signal.quickCompose</string>
</dict>
</array>
<key>UIBackgroundModes</key>
<array>
<string>audio</string>

@ -186,6 +186,22 @@ static NSString * const kURLHostVerifyPrefix = @"verify";
}
- (void)application:(UIApplication *)application
performActionForShortcutItem:(UIApplicationShortcutItem *)shortcutItem
completionHandler:(void (^)(BOOL succeeded))completionHandler {
if ([TSAccountManager isRegistered]) {
[[Environment getCurrent].signalsViewController composeNew];
} else {
UIAlertController *controller = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"REGISTER_CONTACTS_WELCOME", nil)
message:@"Someone's exited to send his first message! Register now to send your first message."
preferredStyle:UIAlertControllerStyleAlert];
completionHandler(YES);
[self.window.rootViewController presentViewController:controller animated:YES completion:^{
completionHandler(NO);
}];
}
}
- (void)prepareScreenshotProtection{
self.blankWindow = ({
UIWindow *window = [[UIWindow alloc] initWithFrame:self.window.bounds];

@ -96,7 +96,7 @@
<inset key="imageInsets" minX="-10" minY="0.0" maxX="10" maxY="0.0"/>
<color key="tintColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<connections>
<segue destination="cZ7-de-SUi" kind="modal" id="Ea3-ew-jtL"/>
<segue destination="cZ7-de-SUi" kind="modal" identifier="composeNew" id="Ea3-ew-jtL"/>
</connections>
</barButtonItem>
</navigationItem>

@ -25,5 +25,6 @@
@property (nonatomic, retain) CallState* latestCall;
- (NSNumber*)updateInboxCountLabel;
- (void)composeNew;
@end

@ -126,6 +126,16 @@ static NSString* const kShowSignupFlowSegue = @"showSignupFlow";
return _previewActions;
}
- (void)composeNew {
if (self.presentedViewController) {
[self dismissViewControllerAnimated:YES completion:nil];
}
[self.navigationController popToRootViewControllerAnimated:YES];
[self performSegueWithIdentifier:@"composeNew" sender:self];
}
- (void)swappedSegmentedControl {
if (self.segmentedControl.selectedSegmentIndex == 0) {
[self selectedInbox:nil];

Loading…
Cancel
Save