From 363d84fd2d54d03c051df23e984dcc81fd1de5c7 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Mon, 1 May 2017 18:06:53 -0400 Subject: [PATCH] =?UTF-8?q?Update=20=E2=80=9Cnew=20conversation=E2=80=9D?= =?UTF-8?q?=20view=20to=20use=20OWSTableView,=20contacts=20view=20helper,?= =?UTF-8?q?=20etc.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit // FREEBIE --- Signal.xcodeproj/project.pbxproj | 14 +- Signal/src/AppDelegate.m | 2 +- Signal/src/Storyboard/Main.storyboard | 82 +- .../src/ViewControllers/ContactsViewHelper.m | 8 +- .../MessageComposeTableViewController.h | 5 +- .../MessageComposeTableViewController.m | 1136 ++++++++--------- .../NewNonContactConversationViewController.h | 19 + .../NewNonContactConversationViewController.m | 127 ++ .../SelectThreadViewController.m | 3 +- .../ViewControllers/SignalsViewController.h | 2 +- .../ViewControllers/SignalsViewController.m | 24 +- Signal/src/views/NoSignalContactsView.swift | 60 - Signal/src/views/NoSignalContactsView.xib | 75 -- .../translations/en.lproj/Localizable.strings | 37 +- 14 files changed, 737 insertions(+), 857 deletions(-) create mode 100644 Signal/src/ViewControllers/NewNonContactConversationViewController.h create mode 100644 Signal/src/ViewControllers/NewNonContactConversationViewController.m delete mode 100644 Signal/src/views/NoSignalContactsView.swift delete mode 100644 Signal/src/views/NoSignalContactsView.xib diff --git a/Signal.xcodeproj/project.pbxproj b/Signal.xcodeproj/project.pbxproj index 5a1ce3cfa..87390efa5 100644 --- a/Signal.xcodeproj/project.pbxproj +++ b/Signal.xcodeproj/project.pbxproj @@ -24,6 +24,7 @@ 34535D821E256BE9008A4747 /* UIView+OWS.m in Sources */ = {isa = PBXBuildFile; fileRef = 34535D811E256BE9008A4747 /* UIView+OWS.m */; }; 345671011E89A5F1006EE662 /* ThreadUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 345671001E89A5F1006EE662 /* ThreadUtil.m */; }; 3456710A1E8A9F5D006EE662 /* TSGenericAttachmentAdapter.m in Sources */ = {isa = PBXBuildFile; fileRef = 345671091E8A9F5D006EE662 /* TSGenericAttachmentAdapter.m */; }; + 3471B1DA1EB7C63600F6AEC8 /* NewNonContactConversationViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3471B1D91EB7C63600F6AEC8 /* NewNonContactConversationViewController.m */; }; 3472229F1EB22FFE00E53955 /* AddToGroupViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3472229E1EB22FFE00E53955 /* AddToGroupViewController.m */; }; 34B3F8711E8DF1700035BE1A /* AboutTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F8351E8DF1700035BE1A /* AboutTableViewController.m */; }; 34B3F8721E8DF1700035BE1A /* AdvancedSettingsTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F8371E8DF1700035BE1A /* AdvancedSettingsTableViewController.m */; }; @@ -170,8 +171,6 @@ 45D231781DC7E8F10034FA89 /* SessionResetJob.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45D231761DC7E8F10034FA89 /* SessionResetJob.swift */; }; 45DF5DF21DDB843F00C936C7 /* CompareSafetyNumbersActivity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45DF5DF11DDB843F00C936C7 /* CompareSafetyNumbersActivity.swift */; }; 45DF5DF31DDB843F00C936C7 /* CompareSafetyNumbersActivity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45DF5DF11DDB843F00C936C7 /* CompareSafetyNumbersActivity.swift */; }; - 45E1F3A31DEF1DF000852CF1 /* NoSignalContactsView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 45E1F3A21DEF1DF000852CF1 /* NoSignalContactsView.xib */; }; - 45E1F3A51DEF20A100852CF1 /* NoSignalContactsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45E1F3A41DEF20A100852CF1 /* NoSignalContactsView.swift */; }; 45E2E9201E153B3D00457AA0 /* Strings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45E2E91F1E153B3D00457AA0 /* Strings.swift */; }; 45E615161E8C590B0018AD52 /* DisplayableTextFilter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45E615151E8C590B0018AD52 /* DisplayableTextFilter.swift */; }; 45E615171E8C59100018AD52 /* DisplayableTextFilter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45E615151E8C590B0018AD52 /* DisplayableTextFilter.swift */; }; @@ -383,6 +382,8 @@ 345671001E89A5F1006EE662 /* ThreadUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ThreadUtil.m; sourceTree = ""; }; 345671081E8A9F5D006EE662 /* TSGenericAttachmentAdapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSGenericAttachmentAdapter.h; sourceTree = ""; }; 345671091E8A9F5D006EE662 /* TSGenericAttachmentAdapter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSGenericAttachmentAdapter.m; sourceTree = ""; }; + 3471B1D81EB7C63600F6AEC8 /* NewNonContactConversationViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NewNonContactConversationViewController.h; sourceTree = ""; }; + 3471B1D91EB7C63600F6AEC8 /* NewNonContactConversationViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NewNonContactConversationViewController.m; sourceTree = ""; }; 3472229D1EB22FFE00E53955 /* AddToGroupViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddToGroupViewController.h; sourceTree = ""; }; 3472229E1EB22FFE00E53955 /* AddToGroupViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AddToGroupViewController.m; sourceTree = ""; }; 34B3F8341E8DF1700035BE1A /* AboutTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AboutTableViewController.h; sourceTree = ""; }; @@ -569,8 +570,6 @@ 45CD81F11DC03A22004C9430 /* OWSLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSLogger.m; sourceTree = ""; }; 45D231761DC7E8F10034FA89 /* SessionResetJob.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SessionResetJob.swift; path = Jobs/SessionResetJob.swift; sourceTree = ""; }; 45DF5DF11DDB843F00C936C7 /* CompareSafetyNumbersActivity.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CompareSafetyNumbersActivity.swift; sourceTree = ""; }; - 45E1F3A21DEF1DF000852CF1 /* NoSignalContactsView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = NoSignalContactsView.xib; sourceTree = ""; }; - 45E1F3A41DEF20A100852CF1 /* NoSignalContactsView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NoSignalContactsView.swift; sourceTree = ""; }; 45E282DE1D08E67800ADD4C8 /* gl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = gl; path = translations/gl.lproj/Localizable.strings; sourceTree = ""; }; 45E282DF1D08E6CC00ADD4C8 /* id */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = id; path = translations/id.lproj/Localizable.strings; sourceTree = ""; }; 45E2E91E1E13EE3500457AA0 /* OWSCallNotificationsAdaptee.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OWSCallNotificationsAdaptee.h; path = UserInterface/OWSCallNotificationsAdaptee.h; sourceTree = ""; }; @@ -903,6 +902,8 @@ 34B3F8531E8DF1700035BE1A /* MessagesViewController.xib */, 34B3F8541E8DF1700035BE1A /* NewGroupViewController.h */, 34B3F8551E8DF1700035BE1A /* NewGroupViewController.m */, + 3471B1D81EB7C63600F6AEC8 /* NewNonContactConversationViewController.h */, + 3471B1D91EB7C63600F6AEC8 /* NewNonContactConversationViewController.m */, 34B3F8561E8DF1700035BE1A /* NotificationSettingsOptionsViewController.h */, 34B3F8571E8DF1700035BE1A /* NotificationSettingsOptionsViewController.m */, 34B3F8581E8DF1700035BE1A /* NotificationSettingsViewController.h */, @@ -1300,8 +1301,6 @@ 45B201751DAECBFE00C461E0 /* HighlightableLabel.swift */, 4531C9C21DD8E6D800F08304 /* JSQMessagesCollectionViewCell+OWS.h */, 4531C9C31DD8E6D800F08304 /* JSQMessagesCollectionViewCell+OWS.m */, - 45E1F3A41DEF20A100852CF1 /* NoSignalContactsView.swift */, - 45E1F3A21DEF1DF000852CF1 /* NoSignalContactsView.xib */, 45C681B91D305C080050903A /* OWSCallCollectionViewCell.h */, 45C681BA1D305C080050903A /* OWSCallCollectionViewCell.m */, 45C681C01D305C9E0050903A /* OWSCallCollectionViewCell.xib */, @@ -1787,7 +1786,6 @@ AD41D7B61A6F6F0600241130 /* play_button@2x.png in Resources */, AD83FF3F1A73426500B5C81A /* audio_pause_button_blue.png in Resources */, 34330A5A1E7875FB00DF2FB9 /* fontawesome-webfont.ttf in Resources */, - 45E1F3A31DEF1DF000852CF1 /* NoSignalContactsView.xib in Resources */, A5509ECA1A69AB8B00ABA4BC /* Main.storyboard in Resources */, 45F2B1971D9CA207000D2C69 /* OWSIncomingMessageCollectionViewCell.xib in Resources */, AD83FF421A73426500B5C81A /* audio_play_button.png in Resources */, @@ -2058,6 +2056,7 @@ 34533F181EA8D2070006114F /* OWSAudioAttachmentPlayer.m in Sources */, 452EA09E1EA7ABE00078744B /* AttachmentPointerView.swift in Sources */, 45666EC91D994C0D008FE134 /* OWSGroupAvatarBuilder.m in Sources */, + 3471B1DA1EB7C63600F6AEC8 /* NewNonContactConversationViewController.m in Sources */, 34B3F87A1E8DF1700035BE1A /* DebugUITableViewController.m in Sources */, 34B3F87C1E8DF1700035BE1A /* FingerprintViewController.m in Sources */, 76EB058218170B33006006FC /* Environment.m in Sources */, @@ -2132,7 +2131,6 @@ B68112EA1A4D9EC400BA82FF /* UIImage+normalizeImage.m in Sources */, B609597C1C2C0FC6004E8797 /* iRate.m in Sources */, 4574A5D61DD6704700C6B692 /* CallService.swift in Sources */, - 45E1F3A51DEF20A100852CF1 /* NoSignalContactsView.swift in Sources */, 34B3F8721E8DF1700035BE1A /* AdvancedSettingsTableViewController.m in Sources */, 45F170D61E315310003FC1F2 /* Weak.swift in Sources */, 34B3F8891E8DF1700035BE1A /* OWSConversationSettingsTableViewController.m in Sources */, diff --git a/Signal/src/AppDelegate.m b/Signal/src/AppDelegate.m index 3d1616423..f80830853 100644 --- a/Signal/src/AppDelegate.m +++ b/Signal/src/AppDelegate.m @@ -444,7 +444,7 @@ static NSString *const kURLHostVerifyPrefix = @"verify"; performActionForShortcutItem:(UIApplicationShortcutItem *)shortcutItem completionHandler:(void (^)(BOOL succeeded))completionHandler { if ([TSAccountManager isRegistered]) { - [[Environment getCurrent].signalsViewController composeNew]; + [[Environment getCurrent].signalsViewController composeNew:nil]; completionHandler(YES); } else { UIAlertController *controller = diff --git a/Signal/src/Storyboard/Main.storyboard b/Signal/src/Storyboard/Main.storyboard index 262f96a15..543c771df 100644 --- a/Signal/src/Storyboard/Main.storyboard +++ b/Signal/src/Storyboard/Main.storyboard @@ -1,11 +1,11 @@ - - + + - + @@ -84,7 +84,7 @@ - + @@ -387,7 +387,7 @@ - + @@ -432,10 +432,10 @@ - + - + - + - + diff --git a/Signal/translations/en.lproj/Localizable.strings b/Signal/translations/en.lproj/Localizable.strings index 2a0527a87..7bc5b257c 100644 --- a/Signal/translations/en.lproj/Localizable.strings +++ b/Signal/translations/en.lproj/Localizable.strings @@ -92,7 +92,7 @@ "ATTACHMENT_DOWNLOADING_STATUS_FAILED" = "Failed. Tap to retry."; /* Status label when an attachment is currently downloading */ -"ATTACHMENT_DOWNLOADING_STATUS_IN_PROGRESS" = "Downloading..."; +"ATTACHMENT_DOWNLOADING_STATUS_IN_PROGRESS" = "Downloading…"; /* Status label when an attachment is enqueued, but hasn't yet started downloading */ "ATTACHMENT_DOWNLOADING_STATUS_QUEUED" = "Queued"; @@ -551,13 +551,13 @@ "HOURS_TIME_AMOUNT" = "%u hours"; /* Call setup status label */ -"IN_CALL_CONNECTING" = "Connecting..."; +"IN_CALL_CONNECTING" = "Connecting…"; /* Call setup status label */ -"IN_CALL_RINGING" = "Ringing..."; +"IN_CALL_RINGING" = "Ringing…"; /* Call setup status label */ -"IN_CALL_SECURING" = "Answered. Securing..."; +"IN_CALL_SECURING" = "Answered. Securing…"; /* Call setup status label */ "IN_CALL_TALKING" = "Secured. Active."; @@ -574,7 +574,7 @@ /* No comment provided by engineer. */ "INCOMING_INCOMPLETE_CALL" = "Incomplete incoming call from"; -/* Text for button at the top of the contact picker */ +/* Label for the cell that presents the 'invite contacts' workflow. */ "INVITE_FRIENDS_CONTACT_TABLE_BUTTON" = "Invite Friends to Signal"; /* Search */ @@ -628,12 +628,6 @@ /* table cell label in conversation settings */ "LIST_GROUP_MEMBERS_ACTION" = "List Group Members"; -/* No comment provided by engineer. */ -"LOADING_CONTACTS_LABEL_LINE1" = "Loading your contacts."; - -/* No comment provided by engineer. */ -"LOADING_CONTACTS_LABEL_LINE2" = "Sit tight."; - /* No comment provided by engineer. */ "LOGGING_SECTION" = "Logging"; @@ -662,7 +656,7 @@ "MESSAGE_STATUS_SENT" = "Sent"; /* message footer while attachment is uploading */ -"MESSAGE_STATUS_UPLOADING" = "Uploading..."; +"MESSAGE_STATUS_UPLOADING" = "Uploading…"; /* A label for audio attachments of unknown type. */ "MESSAGES_VIEW_AUDIO_TYPE_GENERIC" = "Audio"; @@ -744,11 +738,11 @@ /* No comment provided by engineer. */ "NETWORK_STATUS_TEXT" = "You can check your network status by looking at the colored bar above your inbox."; -/* Text for button to start a new conversation with a non-contact */ -"NEW_CONVERSATION_FOR_NON_CONTACT_FORMAT" = "New conversation with %@"; +/* A label the cell that lets you add a new member to a group. */ +"NEW_CONVERSATION_FIND_BY_PHONE_NUMBER" = "Find by Phone Number"; /* A label for the cell that lets you add a new non-contact member to a group. */ -"NEW_GROUP_ADD_NON_CONTACT" = "Add by phone number…"; +"NEW_GROUP_ADD_NON_CONTACT" = "Add by phone number"; /* Action Sheet title prompting the user for a group avatar */ "NEW_GROUP_ADD_PHOTO_ACTION" = "Set Group Photo"; @@ -774,6 +768,12 @@ /* The alert title if user tries to exit the new group view without saving changes. */ "NEW_GROUP_VIEW_UNSAVED_CHANGES_TITLE" = "Unsaved Changes"; +/* A label for the 'add by phone number' button in the 'new non-contact conversation' view */ +"NEW_NONCONTACT_CONVERSATION_VIEW_BUTTON" = "Search"; + +/* Title for the 'new non-contact conversation' view. */ +"NEW_NONCONTACT_CONVERSATION_VIEW_TITLE" = "Find User"; + /* Label for a button that lets users search for contacts by phone number */ "NO_CONTACTS_SEARCH_BY_PHONE_NUMBER" = "Find Contacts by Phone Number"; @@ -1028,7 +1028,7 @@ "SEND_INVITE_SUCCESS" = "You've invited your friend to use Signal!"; /* Text for button to send a Signal invite via SMS. %@ is placeholder for the receipient's phone number. */ -"SEND_INVITE_VIA_SMS_BUTTON_FORMAT" = "Send Invite via SMS to: %@"; +"SEND_INVITE_VIA_SMS_BUTTON_FORMAT" = "Invite via SMS: %@"; /* No comment provided by engineer. */ "SEND_SMS_CONFIRM_TITLE" = "Invite a friend via insecure SMS?"; @@ -1063,6 +1063,9 @@ /* A label that indicates the user has no Signal contacts. */ "SETTINGS_BLOCK_LIST_NO_CONTACTS" = "You have no contacts on Signal."; +/* A label that indicates the user's search has no matching results. */ +"SETTINGS_BLOCK_LIST_NO_SEARCH_RESULTS" = "No Search Results"; + /* Label for the block list section of the settings view */ "SETTINGS_BLOCK_LIST_TITLE" = "Blocked"; @@ -1091,7 +1094,7 @@ "SETTINGS_DELETE_ACCOUNT_BUTTON" = "Delete Account"; /* Alert message before user confirms clearing history */ -"SETTINGS_DELETE_HISTORYLOG_CONFIRMATION" = "Are you sure you want to delete all your history (messages, attachments, call history ...) ? This action cannot be reverted."; +"SETTINGS_DELETE_HISTORYLOG_CONFIRMATION" = "Are you sure you want to delete all your history (messages, attachments, call history …) ? This action cannot be reverted."; /* No comment provided by engineer. */ "SETTINGS_DELETE_HISTORYLOG_CONFIRMATION_BUTTON" = "I'm sure.";