Commit graph

57 commits

Author SHA1 Message Date
Matthew Chen 71d7490e35 Re-sync local profile state with service if necessary.
// FREEBIE
2017-08-29 16:29:54 -04:00
Michael Kirk 4c51f1810c sync local profile as soon as it's created
// FREEBIE
2017-08-29 11:05:19 -04:00
Michael Kirk ab84cbd670 use messageSender property now that the class relies on it in multiple
places.

(due to rebase)

// FREEBIE
2017-08-29 10:49:22 -04:00
Michael Kirk 42934e5fd4 remove retry logic per code review
the system naturally recovers anyway, upon sending messages, no need to
hit the user with another alert.

// FREEBIE
2017-08-29 10:49:22 -04:00
Michael Kirk 55d0db8c46 Disable profile-key sending with feature flag
// FREEBIE
2017-08-29 10:39:36 -04:00
Michael Kirk 4382f33618 Send blank PROFILE_MESSAGE after whitelisting someone
So they can immediately fetch your profile.
Note, we're going to put this behind a feature flag for initial release
since iOS prints an empty bubble when receiving a message like this.

// FREEBIE
2017-08-29 10:35:54 -04:00
Michael Kirk 526d5e33b9 Sync profile key to sibling devices when updating contact
// FREEBIE
2017-08-29 10:35:18 -04:00
Michael Kirk 1f3d2d1ed6 Send any profile key in contact sync
// FREEBIE
2017-08-29 10:35:18 -04:00
Matthew Chen cdfdb80fd1 Respond to CR.
// FREEBIE
2017-08-28 13:11:13 -04:00
Matthew Chen 7e4859241a Clear the local profile avatar immediately when we request upload form.
// FREEBIE
2017-08-28 13:09:33 -04:00
Matthew Chen 0fa19b5269 Clear own avatar on service if necessary when updating local profile. Clear others' avatar when appropriate.
// FREEBIE
2017-08-28 11:59:36 -04:00
Matthew Chen 50a8d0f165 Clear own avatar on service if necessary when updating local profile. Clear others' avatar when appropriate.
// FREEBIE
2017-08-28 11:57:39 -04:00
Michael Kirk 1e51bf4899 extract event names
// FREEBIE
2017-08-25 17:19:31 -04:00
Michael Kirk 251e206b6d profiles vs. censorship circumvention
// FREEBIE
2017-08-25 17:17:43 -04:00
Matthew Chen 374a59e937 Remove an old TODO.
// FREEBIE
2017-08-25 16:01:09 -04:00
Matthew Chen e8a6ca1c22 Show an error when profile name is too long.
// FREEBIE
2017-08-25 16:01:09 -04:00
Michael Kirk bde40a1f9c Ensure avatar upates right after profile change.
// FREEBIE
2017-08-25 12:40:19 -04:00
Matthew Chen 89bacf5cce Respond to CR.
// FREEBIE
2017-08-24 17:29:52 -04:00
Matthew Chen 65db75a91d Fix group profile whitelist check.
// FREEBIE
2017-08-24 17:29:32 -04:00
Matthew Chen 9bf80a215f Don't add avatar to new contacts.
// FREEBIE
2017-08-24 17:28:18 -04:00
Michael Kirk 903d792af4 Debug action to clobber local profile and key
// FREEBIE
2017-08-24 14:52:49 -04:00
Michael Kirk 279eb89023 Fix whitelist
whitelist cache are a bunch of NSNumber's, we need to check their
boolValue

// FREEBIE
2017-08-23 14:59:25 -04:00
Michael Kirk 0a57e7db09 Fix slow start crash after upgrade to 2.16
We were opening a write transaction before our sync extensions were
registered. This seems to have caused our views to rebuild themselves
once they did register, which in turn can cause device timeout.

Instead of opening transcations in `init`, we only build the
localProfile once it's needed.

A future PR will ensure transactions
aren't being created before syncViews are registered.

// FREEBIE
2017-08-23 11:02:24 -04:00
Matthew Chen 68ee56174a Pad empty profile names instead of nil.
// FREEBIE
2017-08-21 17:49:04 -04:00
Matthew Chen 9dfeb132cb Respond to CR.
// FREEBIE
2017-08-21 17:27:30 -04:00
Matthew Chen 1e43e93371 Observe profile changes in conversation view.
// FREEBIE
2017-08-21 17:25:07 -04:00
Michael Kirk 72fbb02028 aes-gcm via openssl
// FREEBIE
2017-08-21 16:37:16 -04:00
Michael Kirk 7c386b1d1e CR: RTL, trim profile names, ensure not empty
- RTL support with localizable format strings
- Trim decrypted profile names
- more rigorous empty check

// FREEBIE
2017-08-17 12:24:31 -04:00
Matthew Chen 164bf19b47 Respond to CR.
// FREEBIE
2017-08-17 11:22:25 -04:00
Matthew Chen d476bc286d * Add debug UI tools for clearing and logging the profile whitelist.
* Auto-add new contact threads to profile whitelist when local user sends first message to that thread.
* Ensure dynamic interactions have a non-negative timestamp even if the conversation was empty.
* Only call updateMessageMappingRangeOptions _after_ beginLongLivedReadTransaction and updating messageMappings.
* Improve documentation around how to avoid corrupt mappings in conversation view.
* Fix edge cases around large initial range sizes.
* Always treat dynamic interactions as read.
* Rebuild the “unseen” database views to remove dynamic interactions (see above).

// FREEBIE
2017-08-17 11:22:25 -04:00
Matthew Chen 943945b4bd Fix “profiles not encoded” bug.
// FREEBIE
2017-08-16 16:03:16 -04:00
Matthew Chen 46d27cef30 Respond to CR.
// FREEBIE
2017-08-16 10:46:56 -04:00
Matthew Chen 1dd75a05ff Tweak concurrency in profile manager.
// FREEBIE
2017-08-16 10:40:17 -04:00
Matthew Chen 02f8b13f4f Rework concurrency in the profile manager.
// FREEBIE
2017-08-16 10:40:17 -04:00
Matthew Chen cdb181eadc Sketch out profile header in app settings view.
// FREEBIE
2017-08-15 16:47:12 -04:00
Michael Kirk abec536729 simplify check for max file size per CR
// FREEBIE
2017-08-15 16:25:01 -04:00
Michael Kirk 2c3e99c372 better var name per code review
// FREEBIE
2017-08-15 15:51:41 -04:00
Michael Kirk fd02644ca7 resize profile avatar
// FREEBIE
2017-08-15 15:51:41 -04:00
Michael Kirk 9f72db44ac Avoid lossy re-encoding of profile image
// FREEBIE
2017-08-15 15:45:52 -04:00
Michael Kirk 135243e383 CR: variable rename, better comments, fix up tests
// FREEBIE
2017-08-14 15:18:12 -04:00
Michael Kirk 7499b3aaf0 Avatar API integration / WIP crypto scheme
Crypto Scheme:

- Name (un)padding
- WIP AES-GCM (funtioning, but need to verify against android
  implementation, and tag functionality)

Changes to avatar API:

- hard code avatar domain (cdn.signal.org)
- avatar form hands out new avatar key, invalidating old avatar
- preliminary aes-gcm integration

Also:

- New type to represent AES128 keys, rather than passing around opaque
  data blobs everywhere, we can use the compiler to help us make sure
  we're passing compliant keying material.

- Started using factory pattern for API requests. This is intended to be
  a lighter weight way to implement new API requests, rather than the
  current 1-method class ceremony.

// FREEBIE
2017-08-14 12:45:37 -04:00
Michael Kirk 283d36c55b remove avatar digest.
For ease of CDN cache expiry, each new avatar will have a unique URL, so
no need for a separate digest. Contents of file at URL will be verified
by forthcoming crypto scheme.

// FREEBIE
2017-08-11 11:28:38 -04:00
Michael Kirk fc3f9ae396 Replace server sent avatar URL with hardcoded
// FREEBIE
2017-08-11 11:19:05 -04:00
Michael Kirk a3ae22c84f Upload profile avatar to service
WIP, this currently lacks crypto pending further discussion.

// FREEBIE
2017-08-09 11:44:34 -04:00
Matthew Chen 09e65a674b Incomplete work to upload avatars.
// FREEBIE
2017-08-04 17:35:16 -04:00
Matthew Chen f6668d24c1 Download profile avatars.
// FREEBIE
2017-08-04 17:35:02 -04:00
Matthew Chen 9266c3a4f9 Clear profile state when a user’s profile key changes.
// FREEBIE
2017-08-04 17:34:27 -04:00
Matthew Chen 8b9749202d Load local user profile avatar if necessary.
// FREEBIE
2017-08-04 17:34:27 -04:00
Matthew Chen 823927685d Update profile on service.
// FREEBIE
2017-08-04 15:25:17 -04:00
Matthew Chen 83d01eed76 Don’t encrypt/decrypt avatar URL or digest.
// FREEBIE
2017-08-04 15:25:10 -04:00