Commit graph

710 commits

Author SHA1 Message Date
Matthew Chen 0d9b780f75 Remove scroll up button. 2019-03-27 10:41:48 -04:00
Michael Kirk d02152cf14 fix release build 2019-03-26 21:44:59 -06:00
Matthew Chen d253c5aa91 Add accessibilityIdentifiers to conversation view. 2019-03-25 09:31:19 -04:00
Matthew Chen a6e00c8fec Respond to CR. 2019-03-22 16:53:55 -04:00
Matthew Chen a7ae79aaad Ignore keyboard notifications while the view is disappearing or has disappeared. 2019-03-22 10:26:25 -04:00
Michael Kirk e3cc8bb101 Keep results bar visible when dismissing keyboard or returning to view. 2019-03-21 12:04:37 -07:00
Michael Kirk 3850ca29b0 Bigger hack to fix problem with lesser hack.
There were two symptoms to this bad "leave app while dismissing keyboard"
state...

The first, most noticeable symptom was that the main window no longer respected
the device orientation. This was caused by UIKit temporarily disabling
autorotate during an interactive keyboard dismissal, and not cleaning up after
itself when we hid the window mid dismissal due to our screen protection
feature. This was solved previously in: ca0a555f8

The second symptom remained, and is solved by this commit. Wherein after
getting in this bad state, the interactive keyboard dismiss function behaves
oddly. Normally when interactively dismissing the keyboard in a scroll view,
the keyboard top follows your finger, until you lift up your finger, at which
point, depending on how close you are to the bottom, the keyboard should
completely dismiss, or cancel and return to its fully popped position. In the
degraded state, the keyboard would follow your finger, but when you lifted your
finger, it would stay where your finger left it, it would not complete/cancel
the dismiss.

The solution is, instead of only re-enabling autorotate, to use a higher level
private method which is called upon complete/cancellation of the interactive
dismissal. The method, `UIScrollToDismissSupport#finishScrollViewTransition`,
as well as re-enabling autorotate, does some other work to restore the UI to
it's normal post interactive-keyboard-dismiss gesture state.

For posterity here's the decompiled pseudocode:

```
/* @class UIScrollToDismissSupport */
-(void)finishScrollViewTransition {
    *(int8_t *)&self->_scrollViewTransitionFinishing = 0x0;
    [self->_controller setInterfaceAutorotationDisabled:0x0];
    [self hideScrollViewHorizontalScrollIndicator:0x0];
    ebx = *ivar_offset(_scrollViewNotificationInfo);
    [*(self + ebx) release];
    *(self + ebx) = 0x0;
    esi = *ivar_offset(_scrollViewForTransition);
    [*(self + esi) release];
    *(self + esi) = 0x0;
    return;
}
```
2019-03-21 10:37:54 -07:00
Matthew Chen 882dd16d7c Apply presentAlert() throughout codebase. 2019-03-21 10:55:04 -04:00
Matthew Chen 9fe3aa06ed Respond to CR. 2019-03-19 11:15:09 -04:00
Matthew Chen 6ab8ea9b6e Respond to CR. 2019-03-19 11:13:06 -04:00
Matthew Chen a8e9b87f03 Rework menu actions focus item layout. 2019-03-19 11:12:30 -04:00
Matthew Chen 4f06e6dd6e Conversation view always observes view model. 2019-03-19 10:03:58 -04:00
Matthew Chen 3b008ad963 Fix conversation view content offset and scroll down button layout. 2019-03-14 15:47:59 -04:00
Michael Kirk 284357137f Photo/Movie Capture 2019-03-14 12:20:21 -07:00
Matthew Chen 7a67a7b6b5 Hide the status bar in the image picker / attachment approval. 2019-03-12 17:22:46 -04:00
Matthew Chen 0aebac0d07 Fix layout of the 'scroll down' button. 2019-03-11 23:29:01 -04:00
Matthew Chen 0a1947c961 Dismiss message actions UI on orientation change. 2019-03-11 23:28:20 -04:00
Matthew Chen 41a2a954f5 Dismiss message actions UI on orientation change. 2019-03-11 23:28:20 -04:00
Matthew Chen 6fe3ce6d87 Deconflict "bottom view" layout and keyboard animations. 2019-03-11 23:23:08 -04:00
Michael Kirk 1c78350f9a Clear input bar UI earlier in send process for snappier send animation. 2019-03-11 12:37:18 -07:00
Michael Kirk 71dd4eb151 in-conversation search
- use MediaTime for computing benchmarks
2019-02-28 16:19:16 -07:00
Michael Kirk b11308b2f8 Return to conversation after deleting long text 2019-02-26 17:19:18 -07:00
Matthew Chen 7711ee92a7 Revert "Conversation view always observes view model."
This reverts commit 9d39e829a44f28f324f79e0b74a6c8692678d788.
2019-02-26 10:56:23 -05:00
Matthew Chen 6ed4045fbe Conversation view always observes view model. 2019-02-26 10:56:11 -05:00
Matthew Chen 56e5feca46 Introduce ConversationSnapshot. 2019-02-26 10:55:44 -05:00
Matthew Chen 586b362b89 Introduce ConversationSnapshot. 2019-02-26 10:55:44 -05:00
Michael Kirk 233bc3858b dismiss menu actions when selected item is deleted 2019-02-25 14:10:12 -07:00
Michael Kirk bc4260b444 Send long-text with other attachments 2019-02-25 13:27:49 -07:00
Michael Kirk a218d6c465 Send first chars of longtext in protobuf 2019-02-25 13:27:49 -07:00
Michael Kirk fabd3996c2 pop view if message is deleted
- use global ui database connection
2019-02-21 16:18:14 -07:00
Michael Kirk d29ce740cb Voice Note Lock 2019-02-06 17:34:29 -07:00
Matthew Chen 4feb0011d7 Reduce logging. 2019-01-31 15:48:50 -05:00
Matthew Chen 6ff6ee2e2e Rework layout of conversation input toolbar. 2019-01-23 13:02:52 -05:00
Matthew Chen 8452f5e74b Open link preview URLs when tapped. 2019-01-23 09:58:37 -05:00
Matthew Chen 3d757b492a Add link previews to conversation message bubbles. 2019-01-23 09:32:30 -05:00
Matthew Chen ca8a4b3751 Make LinkPreviewView reusable. 2019-01-23 09:27:52 -05:00
Matthew Chen 8c7c9b27a2 Merge tag '2.34.0.26' 2019-01-23 09:14:26 -05:00
Matthew Chen 416aa2b347 Add rough draft of link preview view to composer. 2019-01-23 09:11:13 -05:00
Michael Kirk f1e508cb60 Recover status bar style when canceling PhotoPicker 2019-01-22 09:13:22 -07:00
Matthew Chen 977ee9ffe9 Merge remote-tracking branch 'private/release/2.34.0' 2019-01-22 11:10:04 -05:00
Matthew Chen d6a51a2a42 Fix merge breakage. 2019-01-22 10:21:43 -05:00
Matthew Chen 31ea64bdaf Build link previews. 2019-01-22 09:42:25 -05:00
Matthew Chen 127ccccb80 Tweak conversation view's "load more" behavior. 2019-01-17 14:36:31 -05:00
Matthew Chen b8e2cb6267 Respond to CR. 2019-01-15 16:33:54 -05:00
Matthew Chen 18c890bb95 Fix input toolbar margins issue. 2019-01-15 16:30:32 -05:00
Matthew Chen d32372ec26 Respond to CR. 2019-01-11 17:55:21 -05:00
Matthew Chen 9dda2fa8c0 Improve scroll state continuity during conversation view rotations. 2019-01-11 17:55:21 -05:00
Matthew Chen cb228bdd29 Fix conversation view keyboard. 2019-01-10 12:04:12 -05:00
Matthew Chen 18a1d49b46 Landscape orientation. 2019-01-09 15:14:36 -05:00
Matthew Chen 721cab7887 Landscape orientation. 2019-01-09 15:14:36 -05:00
Matthew Chen 9497a38d76 Landscape orientation. 2019-01-09 15:14:36 -05:00
Matthew Chen b5d5822b7b Landscape orientation. 2019-01-09 15:14:36 -05:00
Matthew Chen aefe0eabed Landscape orientation. 2019-01-09 15:14:36 -05:00
Matthew Chen 045b112724 Landscape orientation. 2019-01-09 15:14:36 -05:00
Matthew Chen 460f160cbb Landscape orientation. 2019-01-09 15:13:48 -05:00
Michael Kirk 014cf9c500 fix crash on iOS9 2019-01-08 09:55:35 -07:00
Matthew Chen 7df17251a2 Fix edge cases in conversation view scroll continuity. 2019-01-07 15:37:31 -05:00
Matthew Chen b92051c881 Fix edge cases in conversation view scroll continuity. 2019-01-07 15:37:31 -05:00
Matthew Chen 6b881b9efe Fix edge cases in conversation view scroll continuity. 2019-01-07 15:37:31 -05:00
Matthew Chen c5b0c73055 Introduce conversation view mapping; rework conversation view scrolling. 2019-01-07 12:47:15 -05:00
Matthew Chen c775dbcd66 Introduce conversation view mapping; rework conversation view scrolling. 2019-01-07 12:47:15 -05:00
Matthew Chen 449633e0dc Respond to CR. 2019-01-04 09:19:41 -05:00
Matthew Chen fc8fbebd97 Note to Self. 2019-01-03 18:06:56 -05:00
Matthew Chen e52feb3c36 Note to Self. 2019-01-03 18:06:56 -05:00
Matthew Chen 4a84a19d00 Merge tag '2.33.0.11' 2019-01-02 17:24:07 -05:00
Michael Kirk 049b858125 Fix crash when update corresponds to a move.
reloading during performBatchUpdates requires the *original* indexPath, not the
new index path.
2019-01-02 16:42:48 -05:00
Michael Kirk df79fc9ed0 Move String+OWS into SSK
name Switcharoo String+OWS/String+SSK categories to reflect where they live.
2018-12-20 09:54:08 -07:00
Michael Kirk af7ee5e1d1 address compiler breakage after rebase 2018-12-19 15:16:36 -07:00
Michael Kirk 5671fd2520 Revert "Revert 'new sort id'."
This reverts commit ebae75af00.
2018-12-19 15:16:36 -07:00
Matthew Chen 039755c0df Respond to CR. 2018-12-18 13:35:49 -05:00
Matthew Chen f2d585f439 Always allow long-press for message actions. 2018-12-18 13:34:08 -05:00
Michael Kirk f51416b2d2 save a few ms on send, hoist async dispatch to caller, and use it for clearing draft 2018-12-17 14:44:34 -07:00
Michael Kirk 81bc357bbb more robust handling of unsaved outgoing messages 2018-12-17 14:43:50 -07:00
Michael Kirk 087e320036 Track 'persisted' viewItems separately 2018-12-17 14:43:50 -07:00
Michael Kirk e3610d4360 Apply other requisite ViewItem attributes 2018-12-17 14:43:50 -07:00
Michael Kirk 668cc22af3 Perf: Insert outgoing message into conversation before save completes.
This was a huge savings - e.g. 50-70% of the time between tapping send and
rendering the message takes place in the save/postWriteTransaction blocks
2018-12-17 14:43:50 -07:00
Michael Kirk ac2c9cc521 Benchmark Events by ID 2018-12-13 14:32:27 -07:00
Matthew Chen 9c46ce8662 Re-enable prefetching a bit sooner. 2018-12-13 14:34:08 -05:00
Matthew Chen 6797d43510 Auto-extend conversation load window size. 2018-12-13 14:28:49 -05:00
Matthew Chen 8a6f30518a Auto-extend conversation load window size. 2018-12-13 14:28:49 -05:00
Matthew Chen 6bc8f6d3a3 More perf tweaks for conversation view. 2018-12-13 13:32:00 -05:00
Matthew Chen 00c6ed2f3c Tweak scroll down animation behavior in conversation view. 2018-12-10 09:24:18 -05:00
Michael Kirk eb96eec94a Merge branch 'release/2.32.0' 2018-12-07 09:55:43 -05:00
Michael Kirk e834550649 ensure layout invalidated after leaving media landscape 2018-12-06 19:48:32 -05:00
Michael Kirk 1a5c47df2f Fix SAE, limit max attachments 2018-12-05 13:56:34 -05:00
Michael Kirk fcc4b516a5 fix typo in logging 2018-11-26 12:37:58 -07:00
Michael Kirk 4f0092615a Support captions *and* independent message body 2018-11-26 12:37:58 -07:00
Michael Kirk b87b2522e3 Merge tag '2.32.0.13' 2018-11-16 23:28:51 -06:00
Matthew Chen 910b249112 "Auto load more" async while scrolling. 2018-11-15 22:02:59 -05:00
Matthew Chen 8b24fba095 Add "add more" button to image picker. Provide caption editing continuity. 2018-11-15 14:10:19 -05:00
Michael Kirk 87bfdbb72c Sender Rail 2018-11-15 12:25:28 -06:00
Michael Kirk fa82d43e6c put custom image picker behind feature flag 2018-11-12 14:32:43 -06:00
Matthew Chen 3daf7d4744 Add OWSAttachmentDownloads. 2018-11-08 15:31:00 -05:00
Michael Kirk 42bf267607 fixup plumbing for incoming messages/synced transcripts 2018-11-08 12:52:09 -06:00
Michael Kirk 57681bd6f3 Gallery supports album messages 2018-11-08 12:52:09 -06:00
Matthew Chen 9a44f24bc1 Reduce typing indicators. 2018-11-07 14:31:47 -05:00
Michael Kirk 3ff3779f17 CR: remove unnecessary assert 2018-11-07 10:12:50 -06:00
Michael Kirk 7cef41f8e2 Multi-approval 2018-11-07 10:09:21 -06:00
Michael Kirk 4c5d46e8f8 Custom photo picker, respects theme/call banner
- share GridViewCell
- Multiple image selection, with feature flag, cant currently approve multiple
2018-11-05 22:23:40 -06:00
Matthew Chen af249de681 Fix race in CVM startup. 2018-11-05 09:02:05 -05:00
Matthew Chen 47fda2e377 Add debug UI for multi-image sends. 2018-11-02 13:04:05 -04:00
Matthew Chen eedc9f9a26 Sketch out "typing indicators" interaction and cell. 2018-11-01 16:44:47 -04:00
Michael Kirk 77bd9b8852 Extract most Gallery functionality from the gallery NavigationController.
By not overriding the initializer for an OWSNavigationController subclass,
we can use the dynamic disaptch intialization chain.

The root difficulty here is that super.init(navBarClass:) wants to call
self.init(nibNam)
2018-11-01 12:53:59 -06:00
Matthew Chen 32d3eed7ba Add ConversationViewModel. 2018-11-01 14:51:47 -04:00
Matthew Chen 3d0e7386a4 Respond to CR. 2018-10-31 12:19:07 -04:00
Matthew Chen a98c82645c Start work on typing indicators.
* Update proto schema to reflect typing indicators.
* Sketch out OWSTypingIndicatorMessage.
* Add "online" to the service message params.
* Sketch out logic to send typing indicator messages.
* Sketch out OWSTypingIndicators class.
2018-10-31 12:11:29 -04:00
Matthew Chen 40aa78e001 Merge remote-tracking branch 'origin/release/2.31.0' 2018-10-31 11:42:41 -04:00
Michael Kirk 3d9cd4f4ed CR: comments and code clarity 2018-10-30 11:35:34 -06:00
Michael Kirk cb9aa6304c find -E . -type f -regex ".*\.(m|h)" -exec sed -i "" -e "s/try_/throws_/" {} \; 2018-10-30 11:35:34 -06:00
Michael Kirk 3a6aafc454 Swift Exception wrap NSData+keyVersionByte 2018-10-30 11:35:34 -06:00
Michael Kirk 3560f3be5c Durable send operation
TODO
-[x] respect order of queue
-[x] replacements
  -[x] those w/o completion handler
  -[x] basic send+log operation persists
  -[x] send+ui completion
  -[x] share extension
  -[x] update state jobs
-[x] App Lifecyle
  -[x] settable
  -[x] Mark as ready on startup
  -[x] Fail appropriate jobs on startup

NICE TO HAVE
-[x] concurrent per senders
-[ ] longer retry (e.g. 24hrs)
-[ ] App Lifecyle
  -[x] retry failed jobs on startup?
  -[ ] reachability

DONE
-[x] basic passing test
-[x] datamodel
-[x] queue/classes
2018-10-25 11:54:59 -06:00
Michael Kirk e20df022c8 always show footer for in-progress sending 2018-10-25 11:54:58 -06:00
Michael Kirk ce9ca1bdaa audio player type 2018-10-24 07:46:27 -06:00
Michael Kirk 3b4188f34b hoist audio session singleton to Environment 2018-10-24 07:46:25 -06:00
Michael Kirk 3d022adf4e WIP: audio activities 2018-10-24 07:44:50 -06:00
Matthew Chen 0b4ed1175d Create AppEnvironment. 2018-10-15 15:08:37 -04:00
Matthew Chen f1d93d4472 Merge remote-tracking branch 'origin/release/2.30.2' 2018-10-12 16:00:42 -04:00
Matthew Chen 0b41e5e240 Rework profile fetch to reflect UD changes. 2018-10-04 11:56:37 -04:00
Michael Kirk f243914fe5 NSTemporaryDirectory -> OWSTemporaryDirectory/AccessibleAfterFirstAuth
Remove redundant move - AFNetworking alread moves the CFNetwork tmp file for
us.
2018-10-03 14:01:36 -06:00
Michael Kirk 006021ea41 Fix: group color change doesn't immediately apply
Because we were fetching a new thread instance, instead of updating the
existing thread instance, classes which were bound to the old thread instance
weren't updating. This affected the HeaderView.AvatarView.thread and the
ConversationStyle.thread.
2018-10-01 17:06:09 -06:00
Matthew Chen 0125535d4d Pull out SignalCoreKit. 2018-10-01 09:06:40 -04:00
Michael Kirk 06eae47e09 ConversationViewItem -> protocol 2018-09-28 12:58:33 -06:00
Matthew Chen ebae75af00 Revert 'new sort id'. 2018-09-27 19:40:51 -04:00
Michael Kirk c21020d7e7 Use received date for footer-collapse supression 2018-09-26 09:52:34 -06:00
Michael Kirk 6f8eddc955 unread indicator uses sortId
- removed timestamp parameter. This wasn't totally obvious, previously we were tracking two pieces of state

1. `unreadIndicator.firstUnseenTimestamp`:
    the first unseen timestamp for a conversation that exists in the database
2. `unreadIndicator.timestamp`:
    the timestamp of the first interaction *after* the unread indicator that fits in the loading window

We don't actually need to track `2` because it was only used in a comparison like:

   viewItem.interaction.timestampForSorting >= unreadIndicator.timestamp

But by definition, unreadIndicator.firstUnseenTimestamp is always less than or
equal to unreadIndicator.timestamp. Put into terms of the `sortId` corallary,
the sortId of the first unseen interaction in the database is always less than
or equal to the sortId of the first unseen interaction that fits in the loading
window.

In other words, there's no situation where

   viewItem.interaction.sortId >= unreadIndicator.firstUnseenSortId
2018-09-26 09:52:34 -06:00
Michael Kirk 3240e0d9d0 Be explicit about receivedAt time
We were often using `timestampForLegacySorting`, which is convoluted for when
we actually just want received time.

In some sense this is a superficial change, but it's part of auditing that
we've completed moved away from timestampForLegacySorting.
2018-09-26 09:52:34 -06:00
Michael Kirk b281b37637 replace thread.lastMessageDate/archivalDate -> thread.lastSortId, thread.archivedAsOfSortId
Update migration accordingly

Date shown on home view cell is message.receivedAt
2018-09-26 09:52:34 -06:00
Michael Kirk 90aa593dcd sortId vs. Read status 2018-09-26 09:52:33 -06:00
Michael Kirk d6d6c4fca4 ConversationVC - lastSeenSortId 2018-09-26 09:52:33 -06:00
Michael Kirk ab55e85304 step 1: timestampForSorting audit, change signature
No change in functionality in this commit, I just broke the signature to have a
systematic audit of the callsites. Added TODO's with the plan for each call.
2018-09-26 09:52:33 -06:00
Michael Kirk df61316495 minimize diff senderTimestamp -> timestamp 2018-09-26 09:52:33 -06:00
Michael Kirk 00d0d1e002 Remove legacy Error backdating - no changes in functionality
Historically we would backdate the SN change messages, but since adopting
non-blocking SN changes long ago, they're already sorted properly by creation
time, so backdating has been unnecessary for a while.

I also audited that all other error messages are saved directly after creation.

I applied deprecation attributes as appropriate as I audited.
2018-09-26 09:52:33 -06:00
Michael Kirk eef1368ad3 Timestamp audit step1: change signature
There is no change in functionality in this commit.

Apart from clarifying what the timestamp means (it's the timestamp of the
*sender*), this intentionally breaks all the call sites, so I could have a sane
way to thoroughly audit wherever we're passing in timestamps, to see where
we're depending on them to affect sort order.

For the sake of a cleaner diff of meaningful changes, instead of "fixing"
everything in this commit, I've just added comments and renamed signatures.
2018-09-26 09:52:33 -06:00
Matthew Chen 29bb69032a DRY up the debounce of db extension version increment. 2018-09-20 08:55:19 -04:00
Matthew Chen e1db60c1c0 Rework creation of singletons. 2018-09-19 15:11:26 -04:00
Michael Kirk 920a82564f Merge tag '2.29.3.3' 2018-09-15 09:17:08 -05:00
Michael Kirk 2eca462efc can view conversation settings for left group 2018-09-12 19:16:14 -05:00
Michael Kirk b1da5e93d9 group blocking v. conversation view 2018-09-12 19:16:14 -05:00
Michael Kirk eadb04efcc WIP: ContactViewHelper incorporates group blocking
-[ ] UI
  -[ ] Conversation Settings
    -[x] Show switch for group
    -[ ] localize
    -[ ] migrate existing localizations? (nice to have)
    -[ ] can view conversation settings (but not edit them) in left group
    -[ ] special block copy for groups
    -[ ] special unblock copy for groups
  -[ ] ConversationViewHelper
   -[x] Track blocked groups
   -[ ] HomeView
   -[ ] ConversationView
   -[ ] Any others?
   -[ ] Rename? Extract BlockList cache?
  -[ ] Block List
    -[ ] Group Section
    -[ ] Unblock group
  -[ ] Interstitial interacting with blocked threads (e.g. thread picker)
    -[ ] BlockListUIUtils w/ thread
        -[x] Block
        -[x] Unblock
        -[ ] Replace usages where possible
        -[x] block manager
-[ ] Sync
  -[x] tentative protos
  -[ ] confirm protos w/ team
  -[x] send new protos
-[ ] Message Processing
  -[ ] Drop messages from blocked groups
2018-09-12 19:16:14 -05:00
Matthew Chen df7acfeed3 Simplify OWSPreferences access. 2018-09-07 16:28:21 -04:00
Matthew Chen 3a12446be8 Modify environment accessors to use our 'shared' convention. 2018-09-07 16:20:41 -04:00
Matthew Chen f9eab5cd24 Merge remote-tracking branch 'origin/release/2.29.2' 2018-09-07 15:27:50 -04:00
Michael Kirk c7662b5a86 Step 2/2 %s/OWSAssert/OWSAssertDebug for existing previous assert semantics
Going forward, we want to prefer safer asserts, but we don't want to blindly
apply crashing asserts across the codebase
2018-09-07 10:00:48 -06:00
Matthew Chen dc3467dcda Tidy up attachment usage. 2018-09-06 16:03:29 -04:00
Matthew Chen 498828f93c Rename AttachmentStream methods. 2018-09-06 15:30:00 -04:00
Michael Kirk 5d9cd86d13 size toolbar WRT draft 2018-09-04 10:38:43 -06:00
Matthew Chen fac7f6932f Rename TSGroupMetaMessage enum values. 2018-09-04 09:30:01 -04:00
Matthew Chen 1cc0fbcb12 Elaborate logging around 'perform updates' crash. 2018-08-28 15:41:58 -04:00
Matthew Chen f473f60111 Apply OWS log functions in Objective-C. 2018-08-27 12:58:52 -04:00
Matthew Chen cc5a480baa Apply OWS log functions in Objective-C. 2018-08-27 12:58:52 -04:00