Commit Graph

247 Commits (c8fa47d9c96c81474efc5e37c1469f767f68603c)
 

Author SHA1 Message Date
Michael Kirk 1ebb82f987 Contacts don't have safety numbers until they've exchanged keys.
// FREEBIE
9 years ago
Michael Kirk 2e06bb148f Send group message so long as at least one recipient is found
Previously we were haulting if even one recipient was unregistered.

// FREEBIE
9 years ago
Michael Kirk ebeae2608d Fix crash on messaging unregistered user
// FREEBIE
9 years ago
Michael Kirk 027fa10730 Only dispatch async at top level.
Previously each method was dispatching it's callbacks async. This is a
waste of code, processing, and makes crash logs impenetrable.

// FREEBIE
9 years ago
Michael Kirk b4c504f61d EndSessionMessage notifies remote side of reset session
Otherwise they'll send us messages we can't decrypt.

Also: Log and fail when message doesn't send due to no thread being specified.

// FREEBIE
9 years ago
Michael Kirk 47cad611e5 Fix register w/o background fetch & stale push tokens
* Separate account registration from push token registration
* Provide better errors when validation fails (e.g. numbers don't match, numbers blank)
* More logging during registration
* Call success after setting phone number to avoid any future race condition

  This isn't currently causing problems, but it's unexpected that we'd
  mutate the state *after* calling a callback which might inuitively rely
  on that state.

* Don't throw exception off thread when device keys 404's
* Better async startup handling
  - move processing off main thread
  - reduce code duplication
  - don't wrap it in a transaction in the future case where we want to
    further access the DB

// FREEBIE
9 years ago
Michael Kirk 03f05f217c Prevent session corruption
Mutating the session is not thread safe.

// FREEBIE
9 years ago
Michael Kirk 9c426e0a4b again: Don't send empty message to self after changing disappearing (#54)
timer

previously fixed in: 91fcd01632

But got lost in a rebase after moving TSMessagesManager+sendMessage to
OWSMessageSender.

// FREEBIE
9 years ago
Michael Kirk b6676fb029 Better error messages when failure to send due to:
- no internet
- unregistered recipient

// FREEBIE
9 years ago
Michael Kirk 3e10a49258 Fix disappearing messages don't become consistent after reinstall (#52)
Fixes the bug wherein:

Given the sender had disappearing messages enabled
And the receiver thinks it's disabled (this can happen due to re-install)
When we receive a disappearing message
The message does start expiring timer and disappear
But you see a notice "<sender> disabled disappearing messages"
Rather than the expected "<Sender> set disappearing messages timer to X".

// FREEBIE
9 years ago
Michael Kirk 31bd1d07a3 Handle group keychange error (#50)
// FREEBIE
9 years ago
Michael Kirk 4ba1e86ec1 Explain send failures for text and media messages
Motivation
----------
We were often swallowing errors or yielding generic errors when it would
be better to provide specific errors.

We also didn't create an attachment when attachments failed to send,
making it impossible to show the user what was happening with an
in-progress or failed attachment.

Primary Changes
---------------
- Funnel all message sending through MessageSender, and remove message sending
  from MessagesManager.
  - Record most recent sending error so we can expose it in the UI
  - Can resend attachments.
  - Update message status for attachments, just like text messages
- Extracted UploadingService from MessagesManager
  - Saving attachment stream before uploading gives uniform API for send vs.
    resend
  - update status for downloading transcript attachments
- TSAttachments have a local id, separate from the server allocated id
  This allows us to save the attachment before the allocation request. Which is
  is good because:
  1. can show feedback to user faster.
  2. allows us to show an error when allocation fails.

Code Cleanup
------------
- Replaced a lot of global singleton access with injected dependencies to make
  for easier testing.
- Never save group meta messages. Rather than checking before (hopefully) every
  save, do it in the save method.
- Don't use callbacks for sync code.
- Handle errors on writing attachment data
- Fix old long broken tests that weren't even running. =(
- Removed dead code
- Use constants vs define
- Port flaky travis fixes from Signal-iOS

// FREEBIE
9 years ago
Matthew Douglass d4c55d6940 Maps numbers to names in TSGroupModel
* Maps numbers to names in TSGroupModel

Use an injected ContactsManager to look up proper user names for phone numbers in [TSGroupModel getInfoStringAboutUpdateTo].
Fixes WhisperSystems/Signal-iOS#757

* Supports custom messages for TSOutgoingMessage

This will enable Signal-iOS to push detailed information about TSGroupModel updates through SignalServiceKit and into the TSInfoMessage created by TSMessagesManager+sendMessages

// FREEBIE
9 years ago
Ronny 556dca6502 Check return value of malloc
fixes #27

//FREEBIE
9 years ago
Michael Kirk 91fcd01632 Don't send empty message to self after changing disappearing timer
fixes #1393

// FREEBIE
9 years ago
Michael Kirk f83f808986 Fix ci for xcode 8
* Makefile for builds (CLI FTW)

Easier to make sure we're doing the same thing locally as in travis

// FREEBIE
9 years ago
Michael Kirk a32a18ac67 Fix set timer updates in group thread.
// FREEBIE
9 years ago
Michael Kirk 23854dc72d Report info message type for timer duration changes
// FREEBIE
9 years ago
Michael Kirk 8fed13f9bb Don't start expiration timer until message is sent.
Started extracting a MessageSender class from TSMessagesManager+send for
easier testability and in hopes of further slimming down that son of a
gun.

// FREEBIE
9 years ago
Michael Kirk 0b4d81002f Fix attachment deleting for outgoing messages
Broken in the disappearing messages beta due to sloppy refactoring. =(

// FREEBIE
9 years ago
Michael Kirk 34868b9b0f fix captions in groups and sync messages (#42)
* Fix incoming group caption for groups.
* sync message transcript captions are expired

// FREEBIE
9 years ago
Michael Kirk 40cdc7f224 disappearing messages
* Support for disappearing messages
* update inbox thread preview when receiving message

// FREEBIE
9 years ago
Michael Kirk c1ade86a8b New fingerprint format
In coordination with Desktop and Android, iOS will be using all-numeric
fingerprints, aka "Safety Numbers".

Furthermore, the concept of verifying one identity and then the other
has been removed. Instead we ask users to exchange a single number, or
scan a single QR code. These credentials are built by combining the
users identities.

// FREEBIE
9 years ago
Michael Kirk ce1aa04b61 Fix device listing (#38)
broken while refactoring to async

// FREEBIE
9 years ago
Michael Kirk cf035a597d Merge pull request #37 from WhisperSystems/mkirk/more-resilient-db-setup
more resilient db setup
9 years ago
Michael Kirk ff9729f421 Avoid blocking app launch
// FREEBIE
9 years ago
Michael Kirk f256617636 If we can't find a class definition, don't explode, just log.
If we have a serialized object in our data store that wasn't properly
removed, we can be faced with an exception when enumerating objects in
the database, e.g. when we add a new Yap Index.

// FREEBIE
9 years ago
Michael Kirk 5b06b4351f Fix timeout on launch for some users (#36)
This would especially affect users with large databases on older
devices.

Some of these database extensions aren't strictly necessary to launch
the app. Theoretically we could see weird read receipt behavior for
the initial 10-30 seconds after the app is launched for first time.

// FREEBIE
9 years ago
Michael Kirk 06538f6b46 Not an error. Don't log it as such. (#35)
ContactThreads and GroupThreads share a collection.

// FREEBIE
9 years ago
Michael Kirk c5edc9997a Production log level to INFO (#34)
// FREEBIE
9 years ago
Michael Kirk 1098bc203e Fix crash on boot (#33)
A botched migration 6 months ago left some lingering TSRecipients
serialized in our data store, laying in wait to explode the next time we
enumerate every object in the database (e.g. when we add an index).

// FREEBIE
9 years ago
Michael Kirk 2dba7d141a Fix contact/group sync messages. (#32)
Initially we don't have device messages for our remote device. We need to send the empty device list to get the updated list of remote devices.

Introduced lots of dependency injection to make MessagesManager more testable.

// FREEBIE
9 years ago
Michael Kirk 1824af5335 Fixes: "unsupported attachment" when group is missing avatar (#31)
// FREEBIE
9 years ago
Michael Kirk a0df56a68e Fix multiple keychange errors (#29)
* Don't attempt to send a message unless we've successfully built a deveice-messages
* Only process message exception when we're done with retries.

// FREEBIE
9 years ago
Michael Kirk 9821e0c0d0 Merge pull request #28 from WhisperSystems/desktop-integration
Desktop integration fixups
9 years ago
Michael Kirk 27dfb59a0c Emit notification when message is read.
We observe this in Signal to remove notifications for messages that were
read remotely.

// FREEBIE
9 years ago
Michael Kirk 800e2a9541 Log exception rather than crash upon failed deserialization
while populating secondary indexes

// FREEBIE
9 years ago
Michael Kirk 65e6778033 log network manager requests
// FREEBIE
9 years ago
Michael Kirk af155bf9ed Avoid deadlock when receiving read receipt before incoming message
// FREEBIE
9 years ago
Michael Kirk eb96f846a4 Send user agent to desktop so they can pick a theme for us
// FREEBIE
9 years ago
Michael Kirk d802918603 Merge pull request #26 from WhisperSystems/read-voice-messages
Read voice messages
9 years ago
Michael Kirk 3e5af16dc3 Don't explode when attachment support revoked.
Also, more nullability annotations.

NSURL can't be given a nil filepath. This can occur when a previously
supported attachment was downloaded, and then viewed after that
attachment was no longer supported (e.g. when installing back and forth
across versions)

// FREEBIE
9 years ago
Michael Kirk 1df99c5812 fix voice messages for iOS
// FREEBIE
9 years ago
Michael Kirk 7d70f6e770 Merge pull request #25 from WhisperSystems/dt
Multi Device (Desktop) Integration

// FREEBIE
9 years ago
Michael Kirk 0933b92128 Fix race condition with read receipts before incoming message
// FREEBIE
9 years ago
Michael Kirk 2de6927453 Remove sync data files after sync
// FREEBIE
9 years ago
Michael Kirk c8a5f50763 Fixup DevicesManager
* By providing a view extension for secondary devices we can use that in
  a view mapping to power our devices view controller, and avoid any race
  conditions with uncommitted transactions.

* Fix crash when you're not in your own contacts

* New device appears on top

* Don't show "edit" button unless there are devices, or rather, the helpers to do so.

* Fix glitchy refresh

  Saving unchanged records was causing the tableview to redraw, which was
  mostly invisible, except that if the refresh indicator were running, it
  would twitch.

// FREEBIE
9 years ago
Michael Kirk c39e8b0bc6 extract constant for image/png
// FREEBIE
9 years ago
Michael Kirk acb89f0b0f Outgoing Read Receipts
// FREEBIE
9 years ago
Michael Kirk 580781e3e4 Incoming Read Receipts
// FREEBIE
9 years ago