From caeb97b466676d5ece36a179e2aeb389c61e6eb9 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Thu, 1 Mar 2018 15:32:51 -0500 Subject: [PATCH] Respond to CR. --- Gemfile.lock | 36 ++++++++++--------- .../OWS2FASettingsViewController.m | 3 +- .../API/Requests/TSRegisterForPushRequest.h | 10 +++--- .../API/Requests/TSRegisterForPushRequest.m | 16 +++++---- 4 files changed, 35 insertions(+), 30 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index c58a26a6b..d490c3783 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ GEM remote: https://rubygems.org/ specs: - CFPropertyList (2.3.5) + CFPropertyList (2.3.6) activesupport (4.2.10) i18n (~> 0.7) minitest (~> 5.1) @@ -9,32 +9,33 @@ GEM tzinfo (~> 1.1) addressable (2.5.2) public_suffix (>= 2.0.2, < 4.0) + atomos (0.1.2) babosa (1.0.2) claide (1.0.2) - cocoapods (1.3.1) + cocoapods (1.4.0) activesupport (>= 4.0.2, < 5) claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.3.1) - cocoapods-deintegrate (>= 1.0.1, < 2.0) + cocoapods-core (= 1.4.0) + cocoapods-deintegrate (>= 1.0.2, < 2.0) cocoapods-downloader (>= 1.1.3, < 2.0) cocoapods-plugins (>= 1.0.0, < 2.0) cocoapods-search (>= 1.0.0, < 2.0) cocoapods-stats (>= 1.0.0, < 2.0) - cocoapods-trunk (>= 1.2.0, < 2.0) + cocoapods-trunk (>= 1.3.0, < 2.0) cocoapods-try (>= 1.1.0, < 2.0) colored2 (~> 3.1) escape (~> 0.0.4) fourflusher (~> 2.0.1) gh_inspector (~> 1.0) - molinillo (~> 0.5.7) + molinillo (~> 0.6.4) nap (~> 1.0) ruby-macho (~> 1.1) - xcodeproj (>= 1.5.1, < 2.0) - cocoapods-core (1.3.1) + xcodeproj (>= 1.5.4, < 2.0) + cocoapods-core (1.4.0) activesupport (>= 4.0.2, < 6) fuzzy_match (~> 2.0.4) nap (~> 1.0) - cocoapods-deintegrate (1.0.1) + cocoapods-deintegrate (1.0.2) cocoapods-downloader (1.1.3) cocoapods-plugins (1.0.0) nap @@ -48,6 +49,7 @@ GEM colored2 (3.1.2) commander-fastlane (4.4.5) highline (~> 1.7.2) + concurrent-ruby (1.0.5) declarative (0.0.10) declarative-option (0.1.0) domain_name (0.5.20170404) @@ -98,7 +100,7 @@ GEM xcpretty-travis-formatter (>= 0.0.3) fourflusher (2.0.1) fuzzy_match (2.0.4) - gh_inspector (1.0.3) + gh_inspector (1.1.2) google-api-client (0.13.6) addressable (~> 2.5, >= 2.5.1) googleauth (~> 0.5) @@ -118,7 +120,8 @@ GEM http-cookie (1.0.3) domain_name (~> 0.5) httpclient (2.8.3) - i18n (0.8.6) + i18n (0.9.5) + concurrent-ruby (~> 1.0) json (2.1.0) jwt (1.5.6) little-plugger (1.1.4) @@ -130,8 +133,8 @@ GEM mime-types-data (~> 3.2015) mime-types-data (3.2016.0521) mini_magick (4.5.1) - minitest (5.10.3) - molinillo (0.5.7) + minitest (5.11.3) + molinillo (0.6.4) multi_json (1.12.2) multi_xml (0.6.0) multipart-post (2.0.0) @@ -161,7 +164,7 @@ GEM unicode-display_width (~> 1.1, >= 1.1.1) thread_safe (0.3.6) tty-screen (0.5.0) - tzinfo (1.2.3) + tzinfo (1.2.5) thread_safe (~> 0.1) uber (0.1.0) unf (0.1.4) @@ -169,8 +172,9 @@ GEM unf_ext (0.0.7.4) unicode-display_width (1.3.0) word_wrap (1.0.0) - xcodeproj (1.5.2) + xcodeproj (1.5.6) CFPropertyList (~> 2.3.3) + atomos (~> 0.1.2) claide (>= 1.0.2, < 2.0) colored2 (~> 3.1) nanaimo (~> 0.2.3) @@ -187,4 +191,4 @@ DEPENDENCIES fastlane BUNDLED WITH - 1.14.6 + 1.16.1 diff --git a/Signal/src/ViewControllers/OWS2FASettingsViewController.m b/Signal/src/ViewControllers/OWS2FASettingsViewController.m index fd8938577..5c9cd5873 100644 --- a/Signal/src/ViewControllers/OWS2FASettingsViewController.m +++ b/Signal/src/ViewControllers/OWS2FASettingsViewController.m @@ -322,8 +322,7 @@ NS_ASSUME_NONNULL_BEGIN if (textAfterChange.length > kMaxPinLength) { textAfterChange = [textAfterChange substringToIndex:kMaxPinLength]; } - // 6. Construct the "formatted" new text by inserting a hyphen if necessary. - // reformat the phone number, trying to keep the cursor beside the inserted or deleted digit + // 6. Construct the final text. textField.text = textAfterChange; NSUInteger cursorPositionAfterChange = MIN(left.length + center.length, textAfterChange.length); UITextPosition *pos = diff --git a/SignalServiceKit/src/Network/API/Requests/TSRegisterForPushRequest.h b/SignalServiceKit/src/Network/API/Requests/TSRegisterForPushRequest.h index 97025b4af..5dff583b2 100644 --- a/SignalServiceKit/src/Network/API/Requests/TSRegisterForPushRequest.h +++ b/SignalServiceKit/src/Network/API/Requests/TSRegisterForPushRequest.h @@ -1,15 +1,15 @@ // -// TSRegisterForPushRequest.h -// TextSecureiOS -// -// Created by Frederic Jacobs on 10/13/13. -// Copyright (c) 2013 Open Whisper Systems. All rights reserved. +// Copyright (c) 2018 Open Whisper Systems. All rights reserved. // #import "TSRequest.h" +NS_ASSUME_NONNULL_BEGIN + @interface TSRegisterForPushRequest : TSRequest - (id)initWithPushIdentifier:(NSString *)identifier voipIdentifier:(NSString *)voipId; @end + +NS_ASSUME_NONNULL_END diff --git a/SignalServiceKit/src/Network/API/Requests/TSRegisterForPushRequest.m b/SignalServiceKit/src/Network/API/Requests/TSRegisterForPushRequest.m index a158f680b..14e937efb 100644 --- a/SignalServiceKit/src/Network/API/Requests/TSRegisterForPushRequest.m +++ b/SignalServiceKit/src/Network/API/Requests/TSRegisterForPushRequest.m @@ -5,6 +5,8 @@ #import "TSRegisterForPushRequest.h" #import "TSConstants.h" +NS_ASSUME_NONNULL_BEGIN + @implementation TSRegisterForPushRequest - (id)initWithPushIdentifier:(NSString *)identifier voipIdentifier:(NSString *)voipId { @@ -17,15 +19,15 @@ self.HTTPMethod = @"PUT"; - NSMutableDictionary *parameters = [@{ @"apnRegistrationId" : identifier } mutableCopy]; - - if (voipId) { - parameters[@"voipRegistrationId"] = voipId; - } - - self.parameters = parameters; + OWSAssert(voipId); + self.parameters = @{ + @"apnRegistrationId" : identifier, + @"voipRegistrationId" : voipId ?: @"", + }; return self; } @end + +NS_ASSUME_NONNULL_END